mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
Wed May 2 18:42:00 BST 2007 Richard Jones <rjones@redhat.com>
* src/libvirt.c, src/qemu_internal.c: Allow network drivers to DECLINE to take accept a call. Only fail outright if the network driver reports an error. * src/qemu_internal.c (qemuNetworkOpen): Fix path to driver used in the non-root case.
This commit is contained in:
parent
b15d511db4
commit
5b74f3c2cd
@ -1,3 +1,11 @@
|
||||
Wed May 2 18:42:00 BST 2007 Richard Jones <rjones@redhat.com>
|
||||
|
||||
* src/libvirt.c, src/qemu_internal.c: Allow network
|
||||
drivers to DECLINE to take accept a call. Only fail
|
||||
outright if the network driver reports an error.
|
||||
* src/qemu_internal.c (qemuNetworkOpen): Fix path to
|
||||
driver used in the non-root case.
|
||||
|
||||
Wed May 2 18:38:00 BST 2007 Richard Jones <rjones@redhat.com>
|
||||
|
||||
* src/proxy_internal.c, src/qemu_internal.c, src/test.c,
|
||||
|
@ -295,8 +295,8 @@ do_open (const char *name, int flags)
|
||||
|
||||
for (i = 0; i < virNetworkDriverTabCount; i++) {
|
||||
res = virNetworkDriverTab[i]->open (ret, name, flags);
|
||||
if (res == -1) goto failed;
|
||||
else if (res == 0) {
|
||||
if (res == VIR_DRV_OPEN_ERROR) goto failed;
|
||||
else if (res == VIR_DRV_OPEN_SUCCESS) {
|
||||
ret->networkDriver = virNetworkDriverTab[i];
|
||||
break;
|
||||
}
|
||||
|
@ -963,10 +963,10 @@ static int qemuNetworkOpen(virConnectPtr conn,
|
||||
netpriv->qemud_fd = priv->qemud_fd;
|
||||
netpriv->shared = 1;
|
||||
conn->networkPrivateData = netpriv;
|
||||
return 0;
|
||||
return VIR_DRV_OPEN_SUCCESS;
|
||||
} else {
|
||||
/* Non-QEMU driver is active - open a new connection */
|
||||
const char *drvname = geteuid() == 0 ? "qemu:///system" : "qemu://session";
|
||||
const char *drvname = geteuid() == 0 ? "qemu:///system" : "qemu:///session";
|
||||
xmlURIPtr uri = xmlParseURI(drvname);
|
||||
int ret = qemuOpenConnection(conn, uri, flags & VIR_DRV_OPEN_RO ? 1 : 0);
|
||||
xmlFreeURI(uri);
|
||||
@ -978,7 +978,7 @@ static int qemuNetworkOpen(virConnectPtr conn,
|
||||
netpriv->qemud_fd = ret;
|
||||
netpriv->shared = 0;
|
||||
conn->networkPrivateData = netpriv;
|
||||
return 0;
|
||||
return VIR_DRV_OPEN_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user