* libvirt.spec.in: libvirt-devel depends on pkgconfig

* proxy/libvirt_proxy.c src/libvirt.c src/proxy_internal.[ch]
  src/xs_internal.[ch]: the virtGetOsType entry point was calling
  the xenstore directly instead of going though driver, refactored
  and implemented a specific new RPC with the proxy when this is
  called as non-root fixes rhbz#214264 .
Daniel
This commit is contained in:
Daniel Veillard
2006-11-07 16:28:16 +00:00
parent 4a9ce62fe9
commit d762148aaf
10 changed files with 231 additions and 69 deletions

View File

@@ -337,7 +337,7 @@ proxyReadClientSocket(int nr) {
virProxyFullPacket request;
virProxyPacketPtr req = (virProxyPacketPtr) &request;
int ret;
char *xml;
char *xml, *ostype;
retry:
ret = read(pollInfos[nr].fd, req, sizeof(virProxyPacket));
@@ -587,6 +587,27 @@ retry2:
free(xml);
}
break;
case VIR_PROXY_DOMAIN_OSTYPE:
if (req->len != sizeof(virProxyPacket))
goto comm_error;
ostype = xenStoreDomainGetOSTypeID(conn, request.data.arg);
if (!ostype) {
req->data.arg = -1;
req->len = sizeof(virProxyPacket);
} else {
int ostypelen = strlen(ostype);
if (ostypelen > (int) sizeof(request.extra.str)) {
req->data.arg = -2;
req->len = sizeof(virProxyPacket);
} else {
req->data.arg = 0;
memmove(&request.extra.str[0], ostype, ostypelen);
req->len = sizeof(virProxyPacket) + ostypelen;
}
free(ostype);
}
break;
default:
goto comm_error;
}