mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-11 05:24:44 -05:00
* 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:
+10
-5
@@ -1239,18 +1239,23 @@ virDomainGetID(virDomainPtr domain)
|
||||
char *
|
||||
virDomainGetOSType(virDomainPtr domain)
|
||||
{
|
||||
char *vm, *str = NULL;
|
||||
char *str = NULL;
|
||||
int i;
|
||||
|
||||
if (!VIR_IS_DOMAIN(domain)) {
|
||||
virLibDomainError(domain, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
vm = virDomainGetVM(domain);
|
||||
if (vm) {
|
||||
str = virDomainGetVMInfo(domain, vm, "image/ostype");
|
||||
free(vm);
|
||||
for (i = 0;i < domain->conn->nb_drivers;i++) {
|
||||
if ((domain->conn->drivers[i] != NULL) &&
|
||||
(domain->conn->drivers[i]->domainGetOSType != NULL)) {
|
||||
str = domain->conn->drivers[i]->domainGetOSType(domain);
|
||||
if (str != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (str == NULL)
|
||||
str = strdup("linux");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user