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:
Richard W.M. Jones 2007-05-02 17:40:00 +00:00
parent b15d511db4
commit 5b74f3c2cd
3 changed files with 13 additions and 5 deletions

View File

@ -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> Wed May 2 18:38:00 BST 2007 Richard Jones <rjones@redhat.com>
* src/proxy_internal.c, src/qemu_internal.c, src/test.c, * src/proxy_internal.c, src/qemu_internal.c, src/test.c,

View File

@ -295,8 +295,8 @@ do_open (const char *name, int flags)
for (i = 0; i < virNetworkDriverTabCount; i++) { for (i = 0; i < virNetworkDriverTabCount; i++) {
res = virNetworkDriverTab[i]->open (ret, name, flags); res = virNetworkDriverTab[i]->open (ret, name, flags);
if (res == -1) goto failed; if (res == VIR_DRV_OPEN_ERROR) goto failed;
else if (res == 0) { else if (res == VIR_DRV_OPEN_SUCCESS) {
ret->networkDriver = virNetworkDriverTab[i]; ret->networkDriver = virNetworkDriverTab[i];
break; break;
} }

View File

@ -963,10 +963,10 @@ static int qemuNetworkOpen(virConnectPtr conn,
netpriv->qemud_fd = priv->qemud_fd; netpriv->qemud_fd = priv->qemud_fd;
netpriv->shared = 1; netpriv->shared = 1;
conn->networkPrivateData = netpriv; conn->networkPrivateData = netpriv;
return 0; return VIR_DRV_OPEN_SUCCESS;
} else { } else {
/* Non-QEMU driver is active - open a new connection */ /* 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); xmlURIPtr uri = xmlParseURI(drvname);
int ret = qemuOpenConnection(conn, uri, flags & VIR_DRV_OPEN_RO ? 1 : 0); int ret = qemuOpenConnection(conn, uri, flags & VIR_DRV_OPEN_RO ? 1 : 0);
xmlFreeURI(uri); xmlFreeURI(uri);
@ -978,7 +978,7 @@ static int qemuNetworkOpen(virConnectPtr conn,
netpriv->qemud_fd = ret; netpriv->qemud_fd = ret;
netpriv->shared = 0; netpriv->shared = 0;
conn->networkPrivateData = netpriv; conn->networkPrivateData = netpriv;
return 0; return VIR_DRV_OPEN_SUCCESS;
} }
} }
} }