[libvirt] [PATCH 0/8] pending patch queue

All of these have been posted before (sometimes buried as replies in another thread), but I'm reposting to make it easier to get feedback in one place. My upcoming fd: migration v5 series was tested with all of these applied, and while I can probably rebase things to skip any or all of these patches, it would be nicer to get them in to 0.9.0. Eric Blake (8): remote: fix memory leak qemu: don't restore state label twice docs: document recent hook additions tests: don't alter state in $HOME virsh: optimize creation of default connection maint: use space, not tab, in remote_protocol-structs logging: always NUL-terminate circular buffer build: fix driver module build docs/hooks.html.in | 23 +- src/Makefile.am | 13 +- src/libvirt_private.syms | 20 + src/libvirt_xenxs.syms | 22 + src/qemu/qemu_driver.c | 1 + src/qemu/qemu_process.c | 4 +- src/remote/remote_driver.c | 120 ++-- src/remote_protocol-structs | 1489 ++++++++++++++++++++++--------------------- src/util/logging.c | 8 +- tests/Makefile.am | 30 +- tests/int-overflow | 4 +- tools/virsh.c | 423 +++++++----- 12 files changed, 1152 insertions(+), 1005 deletions(-) create mode 100644 src/libvirt_xenxs.syms -- 1.7.4

Detected in this valgrind run: https://bugzilla.redhat.com/show_bug.cgi?id=690734 ==13864== 10 bytes in 1 blocks are definitely lost in loss record 10 of 34 ==13864== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==13864== by 0x308587FD91: strdup (in /lib64/libc-2.12.so) ==13864== by 0x3BB68BA0A3: doRemoteOpen (remote_driver.c:451) ==13864== by 0x3BB68BCFCF: remoteOpen (remote_driver.c:1111) ==13864== by 0x3BB689A0FF: do_open (libvirt.c:1290) ==13864== by 0x3BB689ADD5: virConnectOpenAuth (libvirt.c:1545) ==13864== by 0x41F659: main (virsh.c:11613) * src/remote/remote_driver.c (doRemoteClose): Move up. (remoteOpenSecondaryDriver, remoteOpen): Avoid leak on failure. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01196.html src/remote/remote_driver.c | 120 +++++++++++++++++++++++--------------------- 1 files changed, 62 insertions(+), 58 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b05bbcb..4c7df17 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -998,6 +998,64 @@ retry: goto cleanup; } +static int +doRemoteClose (virConnectPtr conn, struct private_data *priv) +{ + if (priv->eventFlushTimer >= 0) { + /* Remove timeout */ + virEventRemoveTimeout(priv->eventFlushTimer); + /* Remove handle for remote events */ + virEventRemoveHandle(priv->watch); + priv->watch = -1; + } + + if (call (conn, priv, 0, REMOTE_PROC_CLOSE, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_void, (char *) NULL) == -1) + return -1; + + /* Close socket. */ + if (priv->uses_tls && priv->session) { + gnutls_bye (priv->session, GNUTLS_SHUT_RDWR); + gnutls_deinit (priv->session); + } +#if HAVE_SASL + if (priv->saslconn) + sasl_dispose (&priv->saslconn); +#endif + VIR_FORCE_CLOSE(priv->sock); + VIR_FORCE_CLOSE(priv->errfd); + +#ifndef WIN32 + if (priv->pid > 0) { + pid_t reap; + do { +retry: + reap = waitpid(priv->pid, NULL, 0); + if (reap == -1 && errno == EINTR) + goto retry; + } while (reap != -1 && reap != priv->pid); + } +#endif + VIR_FORCE_CLOSE(priv->wakeupReadFD); + VIR_FORCE_CLOSE(priv->wakeupSendFD); + + + /* Free hostname copy */ + VIR_FREE(priv->hostname); + + /* See comment for remoteType. */ + VIR_FREE(priv->type); + + /* Free callback list */ + virDomainEventCallbackListFree(priv->callbackList); + + /* Free queued events */ + virDomainEventQueueFree(priv->domainEvents); + + return 0; +} + static struct private_data * remoteAllocPrivateData(void) { @@ -1039,7 +1097,9 @@ remoteOpenSecondaryDriver(virConnectPtr conn, ret = doRemoteOpen(conn, *priv, auth, rflags); if (ret != VIR_DRV_OPEN_SUCCESS) { + doRemoteClose(conn, *priv); remoteDriverUnlock(*priv); + virMutexDestroy(&(*priv)->lock); VIR_FREE(*priv); } else { (*priv)->localUses = 1; @@ -1111,7 +1171,9 @@ remoteOpen (virConnectPtr conn, ret = doRemoteOpen(conn, priv, auth, rflags); if (ret != VIR_DRV_OPEN_SUCCESS) { conn->privateData = NULL; + doRemoteClose(conn, priv); remoteDriverUnlock(priv); + virMutexDestroy(&priv->lock); VIR_FREE(priv); } else { conn->privateData = priv; @@ -1538,64 +1600,6 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED, static int -doRemoteClose (virConnectPtr conn, struct private_data *priv) -{ - if (priv->eventFlushTimer >= 0) { - /* Remove timeout */ - virEventRemoveTimeout(priv->eventFlushTimer); - /* Remove handle for remote events */ - virEventRemoveHandle(priv->watch); - priv->watch = -1; - } - - if (call (conn, priv, 0, REMOTE_PROC_CLOSE, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_void, (char *) NULL) == -1) - return -1; - - /* Close socket. */ - if (priv->uses_tls && priv->session) { - gnutls_bye (priv->session, GNUTLS_SHUT_RDWR); - gnutls_deinit (priv->session); - } -#if HAVE_SASL - if (priv->saslconn) - sasl_dispose (&priv->saslconn); -#endif - VIR_FORCE_CLOSE(priv->sock); - VIR_FORCE_CLOSE(priv->errfd); - -#ifndef WIN32 - if (priv->pid > 0) { - pid_t reap; - do { -retry: - reap = waitpid(priv->pid, NULL, 0); - if (reap == -1 && errno == EINTR) - goto retry; - } while (reap != -1 && reap != priv->pid); - } -#endif - VIR_FORCE_CLOSE(priv->wakeupReadFD); - VIR_FORCE_CLOSE(priv->wakeupSendFD); - - - /* Free hostname copy */ - VIR_FREE(priv->hostname); - - /* See comment for remoteType. */ - VIR_FREE(priv->type); - - /* Free callback list */ - virDomainEventCallbackListFree(priv->callbackList); - - /* Free queued events */ - virDomainEventQueueFree(priv->domainEvents); - - return 0; -} - -static int remoteClose (virConnectPtr conn) { int ret = 0; -- 1.7.4

2011/3/26 Eric Blake <eblake@redhat.com>:
Detected in this valgrind run: https://bugzilla.redhat.com/show_bug.cgi?id=690734 ==13864== 10 bytes in 1 blocks are definitely lost in loss record 10 of 34 ==13864== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==13864== by 0x308587FD91: strdup (in /lib64/libc-2.12.so) ==13864== by 0x3BB68BA0A3: doRemoteOpen (remote_driver.c:451) ==13864== by 0x3BB68BCFCF: remoteOpen (remote_driver.c:1111) ==13864== by 0x3BB689A0FF: do_open (libvirt.c:1290) ==13864== by 0x3BB689ADD5: virConnectOpenAuth (libvirt.c:1545) ==13864== by 0x41F659: main (virsh.c:11613)
* src/remote/remote_driver.c (doRemoteClose): Move up. (remoteOpenSecondaryDriver, remoteOpen): Avoid leak on failure. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01196.html
src/remote/remote_driver.c | 120 +++++++++++++++++++++++--------------------- 1 files changed, 62 insertions(+), 58 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b05bbcb..4c7df17 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -998,6 +998,64 @@ retry: goto cleanup; }
+static int +doRemoteClose (virConnectPtr conn, struct private_data *priv) +{ + if (priv->eventFlushTimer >= 0) { + /* Remove timeout */ + virEventRemoveTimeout(priv->eventFlushTimer); + /* Remove handle for remote events */ + virEventRemoveHandle(priv->watch); + priv->watch = -1; + } + + if (call (conn, priv, 0, REMOTE_PROC_CLOSE, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_void, (char *) NULL) == -1) + return -1;
Preexisting problem, but when this remote call fails for some reason we leak the gnutls and sasl sessions, leave FDs open and leak other memory that would have been freed by the rest of the function.
+ /* Close socket. */ + if (priv->uses_tls && priv->session) { + gnutls_bye (priv->session, GNUTLS_SHUT_RDWR); + gnutls_deinit (priv->session); + } +#if HAVE_SASL + if (priv->saslconn) + sasl_dispose (&priv->saslconn); +#endif + VIR_FORCE_CLOSE(priv->sock); + VIR_FORCE_CLOSE(priv->errfd); + +#ifndef WIN32 + if (priv->pid > 0) { + pid_t reap; + do { +retry: + reap = waitpid(priv->pid, NULL, 0); + if (reap == -1 && errno == EINTR) + goto retry; + } while (reap != -1 && reap != priv->pid); + } +#endif + VIR_FORCE_CLOSE(priv->wakeupReadFD); + VIR_FORCE_CLOSE(priv->wakeupSendFD); + + + /* Free hostname copy */ + VIR_FREE(priv->hostname); + + /* See comment for remoteType. */ + VIR_FREE(priv->type); + + /* Free callback list */ + virDomainEventCallbackListFree(priv->callbackList); + + /* Free queued events */ + virDomainEventQueueFree(priv->domainEvents); + + return 0; +} + static struct private_data * remoteAllocPrivateData(void) { @@ -1039,7 +1097,9 @@ remoteOpenSecondaryDriver(virConnectPtr conn,
ret = doRemoteOpen(conn, *priv, auth, rflags); if (ret != VIR_DRV_OPEN_SUCCESS) { + doRemoteClose(conn, *priv);
I'm not sure that this is the right thing to do here. I think we need to make doRemoteOpen cleanup properly on a goto failure, as this is the actual problem here. doRemoteOpen can fail early before setting up the remote connection. If we call doRemoteClose in such a situation the call of the call function with REMOTE_PROC_CLOSE fail and we will leak more stuff. Actually the valgrind log in the bug reports says "error: server closed connection". In that case the call to the call function with REMOTE_PROC_CLOSE will fail and the free functions for priv->hostname, priv->callbackList and priv->domainEvents aren't called later in doRemoteClose. Therefore you patch doesn't help here. On the other hand I currently fail at reproducing the reported leaks. I also can't understand how priv->domainEvents can leak when doRemoteOpen returns != VIR_DRV_OPEN_SUCCESS, because when priv->domainEvents got allocated then doRemoteOpen is guaranteed to return VIR_DRV_OPEN_SUCCESS. That's another reason why I think adding a call to doRemoteClose here is not correct, because the problem seems to be somewhere else. Were you actually able to reproduce the leaks and verify that this patch fixes it?
remoteDriverUnlock(*priv); + virMutexDestroy(&(*priv)->lock);
ACK, to this single addition.
VIR_FREE(*priv); } else { (*priv)->localUses = 1; @@ -1111,7 +1171,9 @@ remoteOpen (virConnectPtr conn, ret = doRemoteOpen(conn, priv, auth, rflags); if (ret != VIR_DRV_OPEN_SUCCESS) { conn->privateData = NULL; + doRemoteClose(conn, priv);
Here the same remarks apply as in remoteOpenSecondaryDriver.
remoteDriverUnlock(priv); + virMutexDestroy(&priv->lock);
ACK, to this single addition too.
VIR_FREE(priv); } else { conn->privateData = priv;
Matthias

On 03/26/2011 07:31 AM, Matthias Bolte wrote:
2011/3/26 Eric Blake <eblake@redhat.com>:
Detected in this valgrind run: https://bugzilla.redhat.com/show_bug.cgi?id=690734 ==13864== 10 bytes in 1 blocks are definitely lost in loss record 10 of 34 ==13864== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==13864== by 0x308587FD91: strdup (in /lib64/libc-2.12.so) ==13864== by 0x3BB68BA0A3: doRemoteOpen (remote_driver.c:451) ==13864== by 0x3BB68BCFCF: remoteOpen (remote_driver.c:1111) ==13864== by 0x3BB689A0FF: do_open (libvirt.c:1290) ==13864== by 0x3BB689ADD5: virConnectOpenAuth (libvirt.c:1545) ==13864== by 0x41F659: main (virsh.c:11613)
* src/remote/remote_driver.c (doRemoteClose): Move up. (remoteOpenSecondaryDriver, remoteOpen): Avoid leak on failure.
+ if (call (conn, priv, 0, REMOTE_PROC_CLOSE, + (xdrproc_t) xdr_void, (char *) NULL, + (xdrproc_t) xdr_void, (char *) NULL) == -1) + return -1;
Preexisting problem, but when this remote call fails for some reason we leak the gnutls and sasl sessions, leave FDs open and leak other memory that would have been freed by the rest of the function.
Were you actually able to reproduce the leaks and verify that this patch fixes it?
Good catch. I agree that this needs a v2. I posted v1 by inspection only, going off of someone else's valgrind report; I'll try harder to actually reproduce the failure locally before v2.
@@ -1039,7 +1097,9 @@ remoteOpenSecondaryDriver(virConnectPtr conn,
ret = doRemoteOpen(conn, *priv, auth, rflags); if (ret != VIR_DRV_OPEN_SUCCESS) { + doRemoteClose(conn, *priv);
I'm not sure that this is the right thing to do here. I think we need to make doRemoteOpen cleanup properly on a goto failure, as this is the actual problem here.
That might work, too - but the point is that doRemoteOpen should probably be using doRemoteClose to do that cleanup on failure, so doRemoteClose still needs to be fixed to get all the contents cleaned up in all cases. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Otherwise, if something like doStopVcpus fails after the first restore, a second restore is attempted and throws a useless warning. * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Avoid second restore of state label. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01192.html src/qemu/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 016ad1d..e0e86d3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2044,6 +2044,7 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom, virSecurityManagerRestoreSavedStateLabel(driver->securityManager, vm, path) < 0) VIR_WARN("failed to restore save state label on %s", path); + bypassSecurityDriver = true; if (cgroup != NULL) { rc = virCgroupDenyDevicePath(cgroup, path, -- 1.7.4

On 03/26/2011 08:12 AM, Eric Blake wrote:
Otherwise, if something like doStopVcpus fails after the first restore, a second restore is attempted and throws a useless warning.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Avoid second restore of state label. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01192.html
src/qemu/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 016ad1d..e0e86d3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2044,6 +2044,7 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom, virSecurityManagerRestoreSavedStateLabel(driver->securityManager, vm, path)< 0) VIR_WARN("failed to restore save state label on %s", path); + bypassSecurityDriver = true;
if (cgroup != NULL) { rc = virCgroupDenyDevicePath(cgroup, path,
ACK

On 03/27/2011 02:31 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
Otherwise, if something like doStopVcpus fails after the first restore, a second restore is attempted and throws a useless warning.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Avoid second restore of state label. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01192.html
src/qemu/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 016ad1d..e0e86d3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2044,6 +2044,7 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,
virSecurityManagerRestoreSavedStateLabel(driver->securityManager, vm, path)< 0) VIR_WARN("failed to restore save state label on %s", path); + bypassSecurityDriver = true;
if (cgroup != NULL) { rc = virCgroupDenyDevicePath(cgroup, path,
ACK
Thanks; applied. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

* src/qemu/qemu_process.c (qemuProcessStart, qemuProcessStop): Fix typos. * docs/hooks.html.in: Document 'prepare' and 'release' hooks. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01112.html docs/hooks.html.in | 23 +++++++++++++++++++---- src/qemu/qemu_process.c | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/hooks.html.in b/docs/hooks.html.in index 3503f8c..eec7a6a 100644 --- a/docs/hooks.html.in +++ b/docs/hooks.html.in @@ -100,11 +100,26 @@ <h5><a name="qemu">/etc/libvirt/hooks/qemu</a></h5> <ul> - <li>When a QEMU guest is started, the qemu hook script is called as:<br/> - <pre>/etc/libvirt/hooks/qemu guest_name start begin -</pre></li> + <li>Before a QEMU guest is started, the qemu hook script is + called in two locations; if either location fails, the guest + is not started. The first location, <span class="since">since + 0.9.0</span>, is before libvirt performs any resource + labeling, and the hook can allocate resources not managed by + libvirt such as DRBD or missing bridges. This is called as:</br> + <pre>/etc/libvirt/hooks/qemu guest_name prepare begin -</pre> + The second location, available <span class="since">Since + 0.8.0</span>, occurs after libvirt has finished labeling + all resources, but has not yet started the guest, called as:</br> + <pre>/etc/libvirt/hooks/qemu guest_name start begin -</pre></li> <li>When a QEMU guest is stopped, the qemu hook script is called - as:<br/> - <pre>/etc/libvirt/hooks/qemu guest_name stopped end -</pre></li> + in two locations, to match the startup. + First, <span class="since">since 0.8.0</span>, the hook is + called before libvirt restores any labels:</br> + <pre>/etc/libvirt/hooks/qemu guest_name stopped end -</pre> + Then, after libvirt has released all resources, the hook is + called again, <span class="since">since 0.9.0</span>, to allow + any additional resource cleanup:<br/> + <pre>/etc/libvirt/hooks/qemu guest_name release end -</pre></li> </ul> <h5><a name="lxc">/etc/libvirt/hooks/lxc</a></h5> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 76ccead..209c8cf 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1928,7 +1928,7 @@ int qemuProcessStart(virConnectPtr conn, vm->def->id = driver->nextvmid++; - /* Run a early hook to set-up missing devices */ + /* Run an early hook to set-up missing devices */ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { char *xml = virDomainDefFormat(vm->def, 0); int hookret; @@ -2436,7 +2436,7 @@ retry: VIR_FREE(priv->vcpupids); priv->nvcpupids = 0; - /* The "release" hook cleans up additional ressources */ + /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { char *xml = virDomainDefFormat(vm->def, 0); -- 1.7.4

On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/qemu/qemu_process.c (qemuProcessStart, qemuProcessStop): Fix typos. * docs/hooks.html.in: Document 'prepare' and 'release' hooks. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01112.html
docs/hooks.html.in | 23 +++++++++++++++++++---- src/qemu/qemu_process.c | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-)
ACK

On 03/27/2011 02:35 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/qemu/qemu_process.c (qemuProcessStart, qemuProcessStop): Fix typos. * docs/hooks.html.in: Document 'prepare' and 'release' hooks. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01112.html
docs/hooks.html.in | 23 +++++++++++++++++++---- src/qemu/qemu_process.c | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Diego reported a bug where virsh tries to initialize a readline history directory during 'make check' run as root, but fails because /root was read-only. It turns out that I could reproduce this as non-root, by using: mv ~/.virsh{,.bak} chmod a-w ~ make check -C tests TESTS=int-overflow chmod u+w ~ mv ~/.virsh{.bak,} * tests/int-overflow: Don't trigger interactive mode. Reported by Diego Elio Pettenò. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01111.html tests/int-overflow | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/int-overflow b/tests/int-overflow index c9f5de9..baf2eef 100755 --- a/tests/int-overflow +++ b/tests/int-overflow @@ -14,9 +14,9 @@ fi . "$srcdir/test-lib.sh" echo "error: failed to get domain '4294967298'" > exp || fail=1 -echo domname 4294967298 | $abs_top_builddir/tools/virsh --quiet \ +$abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ - > /dev/null 2> err || fail=1 + 'domname 4294967298; quit' > /dev/null 2> err || fail=1 diff -u err exp || fail=1 exit $fail -- 1.7.4

On 03/26/2011 08:12 AM, Eric Blake wrote:
Diego reported a bug where virsh tries to initialize a readline history directory during 'make check' run as root, but fails because /root was read-only.
It turns out that I could reproduce this as non-root, by using:
mv ~/.virsh{,.bak} chmod a-w ~ make check -C tests TESTS=int-overflow chmod u+w ~ mv ~/.virsh{.bak,}
* tests/int-overflow: Don't trigger interactive mode. Reported by Diego Elio Pettenò. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01111.html
tests/int-overflow | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/int-overflow b/tests/int-overflow index c9f5de9..baf2eef 100755 --- a/tests/int-overflow +++ b/tests/int-overflow @@ -14,9 +14,9 @@ fi . "$srcdir/test-lib.sh"
echo "error: failed to get domain '4294967298'"> exp || fail=1 -echo domname 4294967298 | $abs_top_builddir/tools/virsh --quiet \ +$abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ -> /dev/null 2> err || fail=1 + 'domname 4294967298; quit'> /dev/null 2> err || fail=1 diff -u err exp || fail=1
Why the "; quit" in the command? a quit is implicit anyway. ACK, with or without the quit - it works either way.

On 03/27/2011 02:59 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
Diego reported a bug where virsh tries to initialize a readline history directory during 'make check' run as root, but fails because /root was read-only.
It turns out that I could reproduce this as non-root, by using:
mv ~/.virsh{,.bak} chmod a-w ~ make check -C tests TESTS=int-overflow chmod u+w ~ mv ~/.virsh{.bak,}
* tests/int-overflow: Don't trigger interactive mode. Reported by Diego Elio Pettenò. ---
echo "error: failed to get domain '4294967298'"> exp || fail=1 -echo domname 4294967298 | $abs_top_builddir/tools/virsh --quiet \ +$abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ -> /dev/null 2> err || fail=1 + 'domname 4294967298; quit'> /dev/null 2> err || fail=1 diff -u err exp || fail=1
Why the "; quit" in the command? a quit is implicit anyway.
A quit may be implicit, but the problem at hand is what $? gets set to in the shell after virsh is done. In batch mode, virsh exits with the status of the last command executed, and we expect the domname command to fail (invalid argument), whereas quit (trivially) succeeds. That is, since the shell script expects $? to be zero, the quit command is necessary to avoid polluting the exit status with the failure from domname while still proving that virsh didn't abort command processing merely because one command failed. We didn't need the quit in interactive mode, because EOF is treated the same as an implicit quit command.
ACK, with or without the quit - it works either way.
Pushed with the quit. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 03/28/2011 06:02 PM, Eric Blake wrote:
On 03/27/2011 02:59 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
Diego reported a bug where virsh tries to initialize a readline history directory during 'make check' run as root, but fails because /root was read-only.
It turns out that I could reproduce this as non-root, by using:
mv ~/.virsh{,.bak} chmod a-w ~ make check -C tests TESTS=int-overflow chmod u+w ~ mv ~/.virsh{.bak,}
* tests/int-overflow: Don't trigger interactive mode. Reported by Diego Elio Pettenò. ---
echo "error: failed to get domain '4294967298'"> exp || fail=1 -echo domname 4294967298 | $abs_top_builddir/tools/virsh --quiet \ +$abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ -> /dev/null 2> err || fail=1 + 'domname 4294967298; quit'> /dev/null 2> err || fail=1 diff -u err exp || fail=1
Why the "; quit" in the command? a quit is implicit anyway.
A quit may be implicit, but the problem at hand is what $? gets set to in the shell after virsh is done. In batch mode, virsh exits with the status of the last command executed, and we expect the domname command to fail (invalid argument), whereas quit (trivially) succeeds. That is, since the shell script expects $? to be zero, the quit command is necessary to avoid polluting the exit status with the failure from domname while still proving that virsh didn't abort command processing merely because one command failed. We didn't need the quit in interactive mode, because EOF is treated the same as an implicit quit command.
ACK, with or without the quit - it works either way.
Pushed with the quit.
What about, on top of this, something like the attached (untested, uncompiled :)) patch? It enables readline only when stdin is a TTY, and MinGW already has isatty. Paolo

Ramon de Carvalho Valle reported a problem with: virsh connect qemu:///system as a non-root user. The real root problem appears to be a regression in libvirtd being auto-started on the default qemu:///session URI; however, the symptom points to an independent flaw in virsh - we shouldn't be wasting efforts on making a connection if we aren't going to be using that connection. Fixing virsh avoids Ramon's issue, while I work in the meantime to fix the real libvirtd regression. This patch looks big, but that's because 'gcc -Wmissing-field-initializers' gets triggered by './autobuild.sh --enable-compile-warnings=error', so I had to add 0 initialization to everyone (rather than my preference of just adding the non-zero flags to virshCmds and to cmdConnect). Meanwhile, if you use 'virsh -c URI', the connection must succeed; this patch _only_ optimizes the default connection to be deferred to a later point where we know if a particular command to be run needs a connection. * tools/virsh.c (VSH_CMD_FLAG_NOCONNECT): New flag. (vshCmdDef): Add new flags field. (vshCommandRun): Honor new flag. (domManagementCmds, domMonitoringCmds, storagePoolCmds) (storageVolCmds, networkCmds, nodedevCmds, ifaceCmds) (nwfilterCmds, secretCmds, virshCmds, snapshotCmds) (hostAndHypervisorCmds): Populate new field. (vshReconnect): Don't warn on initial connection. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg00633.html tools/virsh.c | 423 +++++++++++++++++++++++++++++++++------------------------ 1 files changed, 247 insertions(+), 176 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 50ca50f..1e22325 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -190,6 +190,13 @@ typedef struct vshCmdOpt { } vshCmdOpt; /* + * Command Usage Flags + */ +enum { + VSH_CMD_FLAG_NOCONNECT = (1 << 0), /* no prior connection needed */ +}; + +/* * vshCmdDef - command definition */ typedef struct { @@ -197,6 +204,7 @@ typedef struct { int (*handler) (vshControl *, const vshCmd *); /* command handler */ const vshCmdOptDef *opts; /* definition of command options */ const vshCmdInfo *info; /* details about command */ + int flags; /* bitwise OR of VSH_CMD_FLAG */ } vshCmdDef; /* @@ -558,16 +566,21 @@ vshSetupSignals(void) { * */ static void -vshReconnect(vshControl *ctl) { - if (ctl->conn != NULL) +vshReconnect(vshControl *ctl) +{ + bool connected = false; + + if (ctl->conn != NULL) { + connected = true; virConnectClose(ctl->conn); + } ctl->conn = virConnectOpenAuth(ctl->name, virConnectAuthPtrDefault, ctl->readonly ? VIR_CONNECT_RO : 0); if (!ctl->conn) vshError(ctl, "%s", _("Failed to reconnect to the hypervisor")); - else + else if (connected) vshError(ctl, "%s", _("Reconnected to the hypervisor")); disconnected = 0; } @@ -9659,7 +9672,7 @@ static const vshCmdOptDef opts_cd[] = { }; static int -cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) +cmdCd(vshControl *ctl, const vshCmd *cmd) { const char *dir = NULL; char *dir_malloced = NULL; @@ -10442,206 +10455,260 @@ cleanup: } static const vshCmdDef domManagementCmds[] = { - {"attach-device", cmdAttachDevice, opts_attach_device, info_attach_device}, - {"attach-disk", cmdAttachDisk, opts_attach_disk, info_attach_disk}, - {"attach-interface", cmdAttachInterface, opts_attach_interface, info_attach_interface}, - {"autostart", cmdAutostart, opts_autostart, info_autostart}, - {"blkiotune", cmdBlkiotune, opts_blkiotune, info_blkiotune}, + {"attach-device", cmdAttachDevice, opts_attach_device, + info_attach_device, 0}, + {"attach-disk", cmdAttachDisk, opts_attach_disk, + info_attach_disk, 0}, + {"attach-interface", cmdAttachInterface, opts_attach_interface, + info_attach_interface, 0}, + {"autostart", cmdAutostart, opts_autostart, info_autostart, 0}, + {"blkiotune", cmdBlkiotune, opts_blkiotune, info_blkiotune, 0}, #ifndef WIN32 - {"console", cmdConsole, opts_console, info_console}, + {"console", cmdConsole, opts_console, info_console, 0}, #endif - {"cpu-baseline", cmdCPUBaseline, opts_cpu_baseline, info_cpu_baseline}, - {"cpu-compare", cmdCPUCompare, opts_cpu_compare, info_cpu_compare}, - {"create", cmdCreate, opts_create, info_create}, - {"define", cmdDefine, opts_define, info_define}, - {"destroy", cmdDestroy, opts_destroy, info_destroy}, - {"detach-device", cmdDetachDevice, opts_detach_device, info_detach_device}, - {"detach-disk", cmdDetachDisk, opts_detach_disk, info_detach_disk}, - {"detach-interface", cmdDetachInterface, opts_detach_interface, info_detach_interface}, - {"domid", cmdDomid, opts_domid, info_domid}, - {"domjobabort", cmdDomjobabort, opts_domjobabort, info_domjobabort}, - {"domjobinfo", cmdDomjobinfo, opts_domjobinfo, info_domjobinfo}, - {"domname", cmdDomname, opts_domname, info_domname}, - {"domuuid", cmdDomuuid, opts_domuuid, info_domuuid}, - {"domxml-from-native", cmdDomXMLFromNative, opts_domxmlfromnative, info_domxmlfromnative}, - {"domxml-to-native", cmdDomXMLToNative, opts_domxmltonative, info_domxmltonative}, - {"dump", cmdDump, opts_dump, info_dump}, - {"dumpxml", cmdDumpXML, opts_dumpxml, info_dumpxml}, - {"edit", cmdEdit, opts_edit, info_edit}, - {"managedsave", cmdManagedSave, opts_managedsave, info_managedsave}, - {"managedsave-remove", cmdManagedSaveRemove, opts_managedsaveremove, info_managedsaveremove}, - {"maxvcpus", cmdMaxvcpus, opts_maxvcpus, info_maxvcpus}, - {"memtune", cmdMemtune, opts_memtune, info_memtune}, - {"migrate", cmdMigrate, opts_migrate, info_migrate}, - {"migrate-setmaxdowntime", cmdMigrateSetMaxDowntime, opts_migrate_setmaxdowntime, info_migrate_setmaxdowntime}, - {"reboot", cmdReboot, opts_reboot, info_reboot}, - {"restore", cmdRestore, opts_restore, info_restore}, - {"resume", cmdResume, opts_resume, info_resume}, - {"save", cmdSave, opts_save, info_save}, - {"schedinfo", cmdSchedinfo, opts_schedinfo, info_schedinfo}, - {"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem}, - {"setmem", cmdSetmem, opts_setmem, info_setmem}, - {"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus}, - {"shutdown", cmdShutdown, opts_shutdown, info_shutdown}, - {"start", cmdStart, opts_start, info_start}, - {"suspend", cmdSuspend, opts_suspend, info_suspend}, - {"ttyconsole", cmdTTYConsole, opts_ttyconsole, info_ttyconsole}, - {"undefine", cmdUndefine, opts_undefine, info_undefine}, - {"update-device", cmdUpdateDevice, opts_update_device, info_update_device}, - {"vcpucount", cmdVcpucount, opts_vcpucount, info_vcpucount}, - {"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo}, - {"vcpupin", cmdVcpupin, opts_vcpupin, info_vcpupin}, - {"version", cmdVersion, NULL, info_version}, - {"vncdisplay", cmdVNCDisplay, opts_vncdisplay, info_vncdisplay}, - {NULL, NULL, NULL, NULL} + {"cpu-baseline", cmdCPUBaseline, opts_cpu_baseline, info_cpu_baseline, 0}, + {"cpu-compare", cmdCPUCompare, opts_cpu_compare, info_cpu_compare, 0}, + {"create", cmdCreate, opts_create, info_create, 0}, + {"define", cmdDefine, opts_define, info_define, 0}, + {"destroy", cmdDestroy, opts_destroy, info_destroy, 0}, + {"detach-device", cmdDetachDevice, opts_detach_device, + info_detach_device, 0}, + {"detach-disk", cmdDetachDisk, opts_detach_disk, info_detach_disk, 0}, + {"detach-interface", cmdDetachInterface, opts_detach_interface, + info_detach_interface, 0}, + {"domid", cmdDomid, opts_domid, info_domid, 0}, + {"domjobabort", cmdDomjobabort, opts_domjobabort, info_domjobabort, 0}, + {"domjobinfo", cmdDomjobinfo, opts_domjobinfo, info_domjobinfo, 0}, + {"domname", cmdDomname, opts_domname, info_domname, 0}, + {"domuuid", cmdDomuuid, opts_domuuid, info_domuuid, 0}, + {"domxml-from-native", cmdDomXMLFromNative, opts_domxmlfromnative, + info_domxmlfromnative, 0}, + {"domxml-to-native", cmdDomXMLToNative, opts_domxmltonative, + info_domxmltonative, 0}, + {"dump", cmdDump, opts_dump, info_dump, 0}, + {"dumpxml", cmdDumpXML, opts_dumpxml, info_dumpxml, 0}, + {"edit", cmdEdit, opts_edit, info_edit, 0}, + {"managedsave", cmdManagedSave, opts_managedsave, info_managedsave, 0}, + {"managedsave-remove", cmdManagedSaveRemove, opts_managedsaveremove, + info_managedsaveremove, 0}, + {"maxvcpus", cmdMaxvcpus, opts_maxvcpus, info_maxvcpus, 0}, + {"memtune", cmdMemtune, opts_memtune, info_memtune, 0}, + {"migrate", cmdMigrate, opts_migrate, info_migrate, 0}, + {"migrate-setmaxdowntime", cmdMigrateSetMaxDowntime, + opts_migrate_setmaxdowntime, info_migrate_setmaxdowntime, 0}, + {"reboot", cmdReboot, opts_reboot, info_reboot, 0}, + {"restore", cmdRestore, opts_restore, info_restore, 0}, + {"resume", cmdResume, opts_resume, info_resume, 0}, + {"save", cmdSave, opts_save, info_save, 0}, + {"schedinfo", cmdSchedinfo, opts_schedinfo, info_schedinfo, 0}, + {"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem, 0}, + {"setmem", cmdSetmem, opts_setmem, info_setmem, 0}, + {"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus, 0}, + {"shutdown", cmdShutdown, opts_shutdown, info_shutdown, 0}, + {"start", cmdStart, opts_start, info_start, 0}, + {"suspend", cmdSuspend, opts_suspend, info_suspend, 0}, + {"ttyconsole", cmdTTYConsole, opts_ttyconsole, info_ttyconsole, 0}, + {"undefine", cmdUndefine, opts_undefine, info_undefine, 0}, + {"update-device", cmdUpdateDevice, opts_update_device, + info_update_device, 0}, + {"vcpucount", cmdVcpucount, opts_vcpucount, info_vcpucount, 0}, + {"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo, 0}, + {"vcpupin", cmdVcpupin, opts_vcpupin, info_vcpupin, 0}, + {"version", cmdVersion, NULL, info_version, 0}, + {"vncdisplay", cmdVNCDisplay, opts_vncdisplay, info_vncdisplay, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef domMonitoringCmds[] = { - {"domblkinfo", cmdDomblkinfo, opts_domblkinfo, info_domblkinfo}, - {"domblkstat", cmdDomblkstat, opts_domblkstat, info_domblkstat}, - {"domifstat", cmdDomIfstat, opts_domifstat, info_domifstat}, - {"dominfo", cmdDominfo, opts_dominfo, info_dominfo}, - {"dommemstat", cmdDomMemStat, opts_dommemstat, info_dommemstat}, - {"domstate", cmdDomstate, opts_domstate, info_domstate}, - {"list", cmdList, opts_list, info_list}, - {NULL, NULL, NULL, NULL} + {"domblkinfo", cmdDomblkinfo, opts_domblkinfo, info_domblkinfo, 0}, + {"domblkstat", cmdDomblkstat, opts_domblkstat, info_domblkstat, 0}, + {"domifstat", cmdDomIfstat, opts_domifstat, info_domifstat, 0}, + {"dominfo", cmdDominfo, opts_dominfo, info_dominfo, 0}, + {"dommemstat", cmdDomMemStat, opts_dommemstat, info_dommemstat, 0}, + {"domstate", cmdDomstate, opts_domstate, info_domstate, 0}, + {"list", cmdList, opts_list, info_list, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef storagePoolCmds[] = { {"find-storage-pool-sources-as", cmdPoolDiscoverSourcesAs, - opts_find_storage_pool_sources_as, info_find_storage_pool_sources_as}, + opts_find_storage_pool_sources_as, info_find_storage_pool_sources_as, 0}, {"find-storage-pool-sources", cmdPoolDiscoverSources, - opts_find_storage_pool_sources, info_find_storage_pool_sources}, - {"pool-autostart", cmdPoolAutostart, opts_pool_autostart, info_pool_autostart}, - {"pool-build", cmdPoolBuild, opts_pool_build, info_pool_build}, - {"pool-create-as", cmdPoolCreateAs, opts_pool_X_as, info_pool_create_as}, - {"pool-create", cmdPoolCreate, opts_pool_create, info_pool_create}, - {"pool-define-as", cmdPoolDefineAs, opts_pool_X_as, info_pool_define_as}, - {"pool-define", cmdPoolDefine, opts_pool_define, info_pool_define}, - {"pool-delete", cmdPoolDelete, opts_pool_delete, info_pool_delete}, - {"pool-destroy", cmdPoolDestroy, opts_pool_destroy, info_pool_destroy}, - {"pool-dumpxml", cmdPoolDumpXML, opts_pool_dumpxml, info_pool_dumpxml}, - {"pool-edit", cmdPoolEdit, opts_pool_edit, info_pool_edit}, - {"pool-info", cmdPoolInfo, opts_pool_info, info_pool_info}, - {"pool-list", cmdPoolList, opts_pool_list, info_pool_list}, - {"pool-name", cmdPoolName, opts_pool_name, info_pool_name}, - {"pool-refresh", cmdPoolRefresh, opts_pool_refresh, info_pool_refresh}, - {"pool-start", cmdPoolStart, opts_pool_start, info_pool_start}, - {"pool-undefine", cmdPoolUndefine, opts_pool_undefine, info_pool_undefine}, - {"pool-uuid", cmdPoolUuid, opts_pool_uuid, info_pool_uuid}, - {NULL, NULL, NULL, NULL} + opts_find_storage_pool_sources, info_find_storage_pool_sources, 0}, + {"pool-autostart", cmdPoolAutostart, opts_pool_autostart, + info_pool_autostart, 0}, + {"pool-build", cmdPoolBuild, opts_pool_build, info_pool_build, 0}, + {"pool-create-as", cmdPoolCreateAs, opts_pool_X_as, info_pool_create_as, 0}, + {"pool-create", cmdPoolCreate, opts_pool_create, info_pool_create, 0}, + {"pool-define-as", cmdPoolDefineAs, opts_pool_X_as, info_pool_define_as, 0}, + {"pool-define", cmdPoolDefine, opts_pool_define, info_pool_define, 0}, + {"pool-delete", cmdPoolDelete, opts_pool_delete, info_pool_delete, 0}, + {"pool-destroy", cmdPoolDestroy, opts_pool_destroy, info_pool_destroy, 0}, + {"pool-dumpxml", cmdPoolDumpXML, opts_pool_dumpxml, info_pool_dumpxml, 0}, + {"pool-edit", cmdPoolEdit, opts_pool_edit, info_pool_edit, 0}, + {"pool-info", cmdPoolInfo, opts_pool_info, info_pool_info, 0}, + {"pool-list", cmdPoolList, opts_pool_list, info_pool_list, 0}, + {"pool-name", cmdPoolName, opts_pool_name, info_pool_name, 0}, + {"pool-refresh", cmdPoolRefresh, opts_pool_refresh, info_pool_refresh, 0}, + {"pool-start", cmdPoolStart, opts_pool_start, info_pool_start, 0}, + {"pool-undefine", cmdPoolUndefine, opts_pool_undefine, + info_pool_undefine, 0}, + {"pool-uuid", cmdPoolUuid, opts_pool_uuid, info_pool_uuid, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef storageVolCmds[] = { - {"vol-clone", cmdVolClone, opts_vol_clone, info_vol_clone}, - {"vol-create-as", cmdVolCreateAs, opts_vol_create_as, info_vol_create_as}, - {"vol-create", cmdVolCreate, opts_vol_create, info_vol_create}, - {"vol-create-from", cmdVolCreateFrom, opts_vol_create_from, info_vol_create_from}, - {"vol-delete", cmdVolDelete, opts_vol_delete, info_vol_delete}, - {"vol-dumpxml", cmdVolDumpXML, opts_vol_dumpxml, info_vol_dumpxml}, - {"vol-info", cmdVolInfo, opts_vol_info, info_vol_info}, - {"vol-key", cmdVolKey, opts_vol_key, info_vol_key}, - {"vol-list", cmdVolList, opts_vol_list, info_vol_list}, - {"vol-name", cmdVolName, opts_vol_name, info_vol_name}, - {"vol-path", cmdVolPath, opts_vol_path, info_vol_path}, - {"vol-pool", cmdVolPool, opts_vol_pool, info_vol_pool}, - {"vol-wipe", cmdVolWipe, opts_vol_wipe, info_vol_wipe}, - {NULL, NULL, NULL, NULL} + {"vol-clone", cmdVolClone, opts_vol_clone, info_vol_clone, 0}, + {"vol-create-as", cmdVolCreateAs, opts_vol_create_as, + info_vol_create_as, 0}, + {"vol-create", cmdVolCreate, opts_vol_create, info_vol_create, 0}, + {"vol-create-from", cmdVolCreateFrom, opts_vol_create_from, + info_vol_create_from, 0}, + {"vol-delete", cmdVolDelete, opts_vol_delete, info_vol_delete, 0}, + {"vol-dumpxml", cmdVolDumpXML, opts_vol_dumpxml, info_vol_dumpxml, 0}, + {"vol-info", cmdVolInfo, opts_vol_info, info_vol_info, 0}, + {"vol-key", cmdVolKey, opts_vol_key, info_vol_key, 0}, + {"vol-list", cmdVolList, opts_vol_list, info_vol_list, 0}, + {"vol-name", cmdVolName, opts_vol_name, info_vol_name, 0}, + {"vol-path", cmdVolPath, opts_vol_path, info_vol_path, 0}, + {"vol-pool", cmdVolPool, opts_vol_pool, info_vol_pool, 0}, + {"vol-wipe", cmdVolWipe, opts_vol_wipe, info_vol_wipe, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef networkCmds[] = { - {"net-autostart", cmdNetworkAutostart, opts_network_autostart, info_network_autostart}, - {"net-create", cmdNetworkCreate, opts_network_create, info_network_create}, - {"net-define", cmdNetworkDefine, opts_network_define, info_network_define}, - {"net-destroy", cmdNetworkDestroy, opts_network_destroy, info_network_destroy}, - {"net-dumpxml", cmdNetworkDumpXML, opts_network_dumpxml, info_network_dumpxml}, - {"net-edit", cmdNetworkEdit, opts_network_edit, info_network_edit}, - {"net-info", cmdNetworkInfo, opts_network_info, info_network_info}, - {"net-list", cmdNetworkList, opts_network_list, info_network_list}, - {"net-name", cmdNetworkName, opts_network_name, info_network_name}, - {"net-start", cmdNetworkStart, opts_network_start, info_network_start}, - {"net-undefine", cmdNetworkUndefine, opts_network_undefine, info_network_undefine}, - {"net-uuid", cmdNetworkUuid, opts_network_uuid, info_network_uuid}, - {NULL, NULL, NULL, NULL} + {"net-autostart", cmdNetworkAutostart, opts_network_autostart, + info_network_autostart, 0}, + {"net-create", cmdNetworkCreate, opts_network_create, + info_network_create, 0}, + {"net-define", cmdNetworkDefine, opts_network_define, + info_network_define, 0}, + {"net-destroy", cmdNetworkDestroy, opts_network_destroy, + info_network_destroy, 0}, + {"net-dumpxml", cmdNetworkDumpXML, opts_network_dumpxml, + info_network_dumpxml, 0}, + {"net-edit", cmdNetworkEdit, opts_network_edit, info_network_edit, 0}, + {"net-info", cmdNetworkInfo, opts_network_info, info_network_info, 0}, + {"net-list", cmdNetworkList, opts_network_list, info_network_list, 0}, + {"net-name", cmdNetworkName, opts_network_name, info_network_name, 0}, + {"net-start", cmdNetworkStart, opts_network_start, info_network_start, 0}, + {"net-undefine", cmdNetworkUndefine, opts_network_undefine, + info_network_undefine, 0}, + {"net-uuid", cmdNetworkUuid, opts_network_uuid, info_network_uuid, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef nodedevCmds[] = { - {"nodedev-create", cmdNodeDeviceCreate, opts_node_device_create, info_node_device_create}, - {"nodedev-destroy", cmdNodeDeviceDestroy, opts_node_device_destroy, info_node_device_destroy}, - {"nodedev-dettach", cmdNodeDeviceDettach, opts_node_device_dettach, info_node_device_dettach}, - {"nodedev-dumpxml", cmdNodeDeviceDumpXML, opts_node_device_dumpxml, info_node_device_dumpxml}, - {"nodedev-list", cmdNodeListDevices, opts_node_list_devices, info_node_list_devices}, - {"nodedev-reattach", cmdNodeDeviceReAttach, opts_node_device_reattach, info_node_device_reattach}, - {"nodedev-reset", cmdNodeDeviceReset, opts_node_device_reset, info_node_device_reset}, - {NULL, NULL, NULL, NULL} + {"nodedev-create", cmdNodeDeviceCreate, opts_node_device_create, + info_node_device_create, 0}, + {"nodedev-destroy", cmdNodeDeviceDestroy, opts_node_device_destroy, + info_node_device_destroy, 0}, + {"nodedev-dettach", cmdNodeDeviceDettach, opts_node_device_dettach, + info_node_device_dettach, 0}, + {"nodedev-dumpxml", cmdNodeDeviceDumpXML, opts_node_device_dumpxml, + info_node_device_dumpxml, 0}, + {"nodedev-list", cmdNodeListDevices, opts_node_list_devices, + info_node_list_devices, 0}, + {"nodedev-reattach", cmdNodeDeviceReAttach, opts_node_device_reattach, + info_node_device_reattach, 0}, + {"nodedev-reset", cmdNodeDeviceReset, opts_node_device_reset, + info_node_device_reset, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef ifaceCmds[] = { - {"iface-define", cmdInterfaceDefine, opts_interface_define, info_interface_define}, - {"iface-destroy", cmdInterfaceDestroy, opts_interface_destroy, info_interface_destroy}, - {"iface-dumpxml", cmdInterfaceDumpXML, opts_interface_dumpxml, info_interface_dumpxml}, - {"iface-edit", cmdInterfaceEdit, opts_interface_edit, info_interface_edit}, - {"iface-list", cmdInterfaceList, opts_interface_list, info_interface_list}, - {"iface-mac", cmdInterfaceMAC, opts_interface_mac, info_interface_mac}, - {"iface-name", cmdInterfaceName, opts_interface_name, info_interface_name}, - {"iface-start", cmdInterfaceStart, opts_interface_start, info_interface_start}, - {"iface-undefine", cmdInterfaceUndefine, opts_interface_undefine, info_interface_undefine}, - {NULL, NULL, NULL, NULL} + {"iface-define", cmdInterfaceDefine, opts_interface_define, + info_interface_define, 0}, + {"iface-destroy", cmdInterfaceDestroy, opts_interface_destroy, + info_interface_destroy, 0}, + {"iface-dumpxml", cmdInterfaceDumpXML, opts_interface_dumpxml, + info_interface_dumpxml, 0}, + {"iface-edit", cmdInterfaceEdit, opts_interface_edit, + info_interface_edit, 0}, + {"iface-list", cmdInterfaceList, opts_interface_list, + info_interface_list, 0}, + {"iface-mac", cmdInterfaceMAC, opts_interface_mac, + info_interface_mac, 0}, + {"iface-name", cmdInterfaceName, opts_interface_name, + info_interface_name, 0}, + {"iface-start", cmdInterfaceStart, opts_interface_start, + info_interface_start, 0}, + {"iface-undefine", cmdInterfaceUndefine, opts_interface_undefine, + info_interface_undefine, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef nwfilterCmds[] = { - {"nwfilter-define", cmdNWFilterDefine, opts_nwfilter_define, info_nwfilter_define}, - {"nwfilter-dumpxml", cmdNWFilterDumpXML, opts_nwfilter_dumpxml, info_nwfilter_dumpxml}, - {"nwfilter-edit", cmdNWFilterEdit, opts_nwfilter_edit, info_nwfilter_edit}, - {"nwfilter-list", cmdNWFilterList, opts_nwfilter_list, info_nwfilter_list}, - {"nwfilter-undefine", cmdNWFilterUndefine, opts_nwfilter_undefine, info_nwfilter_undefine}, - {NULL, NULL, NULL, NULL} + {"nwfilter-define", cmdNWFilterDefine, opts_nwfilter_define, + info_nwfilter_define, 0}, + {"nwfilter-dumpxml", cmdNWFilterDumpXML, opts_nwfilter_dumpxml, + info_nwfilter_dumpxml, 0}, + {"nwfilter-edit", cmdNWFilterEdit, opts_nwfilter_edit, + info_nwfilter_edit, 0}, + {"nwfilter-list", cmdNWFilterList, opts_nwfilter_list, + info_nwfilter_list, 0}, + {"nwfilter-undefine", cmdNWFilterUndefine, opts_nwfilter_undefine, + info_nwfilter_undefine, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef secretCmds[] = { - {"secret-define", cmdSecretDefine, opts_secret_define, info_secret_define}, - {"secret-dumpxml", cmdSecretDumpXML, opts_secret_dumpxml, info_secret_dumpxml}, - {"secret-get-value", cmdSecretGetValue, opts_secret_get_value, info_secret_get_value}, - {"secret-list", cmdSecretList, NULL, info_secret_list}, - {"secret-set-value", cmdSecretSetValue, opts_secret_set_value, info_secret_set_value}, - {"secret-undefine", cmdSecretUndefine, opts_secret_undefine, info_secret_undefine}, - {NULL, NULL, NULL, NULL} + {"secret-define", cmdSecretDefine, opts_secret_define, + info_secret_define, 0}, + {"secret-dumpxml", cmdSecretDumpXML, opts_secret_dumpxml, + info_secret_dumpxml, 0}, + {"secret-get-value", cmdSecretGetValue, opts_secret_get_value, + info_secret_get_value, 0}, + {"secret-list", cmdSecretList, NULL, info_secret_list, 0}, + {"secret-set-value", cmdSecretSetValue, opts_secret_set_value, + info_secret_set_value, 0}, + {"secret-undefine", cmdSecretUndefine, opts_secret_undefine, + info_secret_undefine, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef virshCmds[] = { #ifndef WIN32 - {"cd", cmdCd, opts_cd, info_cd}, + {"cd", cmdCd, opts_cd, info_cd, VSH_CMD_FLAG_NOCONNECT}, #endif - {"echo", cmdEcho, opts_echo, info_echo}, - {"exit", cmdQuit, NULL, info_quit}, - {"help", cmdHelp, opts_help, info_help}, + {"echo", cmdEcho, opts_echo, info_echo, VSH_CMD_FLAG_NOCONNECT}, + {"exit", cmdQuit, NULL, info_quit, VSH_CMD_FLAG_NOCONNECT}, + {"help", cmdHelp, opts_help, info_help, VSH_CMD_FLAG_NOCONNECT}, #ifndef WIN32 - {"pwd", cmdPwd, NULL, info_pwd}, + {"pwd", cmdPwd, NULL, info_pwd, VSH_CMD_FLAG_NOCONNECT}, #endif - {"quit", cmdQuit, NULL, info_quit}, - {NULL, NULL, NULL, NULL} + {"quit", cmdQuit, NULL, info_quit, VSH_CMD_FLAG_NOCONNECT}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef snapshotCmds[] = { - {"snapshot-create", cmdSnapshotCreate, opts_snapshot_create, info_snapshot_create}, - {"snapshot-current", cmdSnapshotCurrent, opts_snapshot_current, info_snapshot_current}, - {"snapshot-delete", cmdSnapshotDelete, opts_snapshot_delete, info_snapshot_delete}, - {"snapshot-dumpxml", cmdSnapshotDumpXML, opts_snapshot_dumpxml, info_snapshot_dumpxml}, - {"snapshot-list", cmdSnapshotList, opts_snapshot_list, info_snapshot_list}, - {"snapshot-revert", cmdDomainSnapshotRevert, opts_snapshot_revert, info_snapshot_revert}, - {NULL, NULL, NULL, NULL} + {"snapshot-create", cmdSnapshotCreate, opts_snapshot_create, + info_snapshot_create, 0}, + {"snapshot-current", cmdSnapshotCurrent, opts_snapshot_current, + info_snapshot_current, 0}, + {"snapshot-delete", cmdSnapshotDelete, opts_snapshot_delete, + info_snapshot_delete, 0}, + {"snapshot-dumpxml", cmdSnapshotDumpXML, opts_snapshot_dumpxml, + info_snapshot_dumpxml, 0}, + {"snapshot-list", cmdSnapshotList, opts_snapshot_list, + info_snapshot_list, 0}, + {"snapshot-revert", cmdDomainSnapshotRevert, opts_snapshot_revert, + info_snapshot_revert, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdDef hostAndHypervisorCmds[] = { - {"capabilities", cmdCapabilities, NULL, info_capabilities}, - {"connect", cmdConnect, opts_connect, info_connect}, - {"freecell", cmdFreecell, opts_freecell, info_freecell}, - {"hostname", cmdHostname, NULL, info_hostname}, - {"nodeinfo", cmdNodeinfo, NULL, info_nodeinfo}, - {"qemu-monitor-command", cmdQemuMonitorCommand, opts_qemu_monitor_command, info_qemu_monitor_command}, - {"sysinfo", cmdSysinfo, NULL, info_sysinfo}, - {"uri", cmdURI, NULL, info_uri}, - {NULL, NULL, NULL, NULL} + {"capabilities", cmdCapabilities, NULL, info_capabilities, 0}, + {"connect", cmdConnect, opts_connect, info_connect, + VSH_CMD_FLAG_NOCONNECT}, + {"freecell", cmdFreecell, opts_freecell, info_freecell, 0}, + {"hostname", cmdHostname, NULL, info_hostname, 0}, + {"nodeinfo", cmdNodeinfo, NULL, info_nodeinfo, 0}, + {"qemu-monitor-command", cmdQemuMonitorCommand, opts_qemu_monitor_command, + info_qemu_monitor_command, 0}, + {"sysinfo", cmdSysinfo, NULL, info_sysinfo, 0}, + {"uri", cmdURI, NULL, info_uri, 0}, + {NULL, NULL, NULL, NULL, 0} }; static const vshCmdGrp cmdGroups[] = { @@ -11380,7 +11447,8 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd) struct timeval before, after; bool enable_timing = ctl->timing; - if ((ctl->conn == NULL) || (disconnected != 0)) + if ((ctl->conn == NULL || disconnected) && + !(cmd->def->flags & VSH_CMD_FLAG_NOCONNECT)) vshReconnect(ctl); if (enable_timing) @@ -11840,19 +11908,22 @@ vshInit(vshControl *ctl) if (virEventRegisterDefaultImpl() < 0) return FALSE; - ctl->conn = virConnectOpenAuth(ctl->name, - virConnectAuthPtrDefault, - ctl->readonly ? VIR_CONNECT_RO : 0); - + if (ctl->name) { + ctl->conn = virConnectOpenAuth(ctl->name, + virConnectAuthPtrDefault, + ctl->readonly ? VIR_CONNECT_RO : 0); - /* This is not necessarily fatal. All the individual commands check - * vshConnectionUsability, except ones which don't need a connection - * such as "help". - */ - if (!ctl->conn) { - virshReportError(ctl); - vshError(ctl, "%s", _("failed to connect to the hypervisor")); - return FALSE; + /* Connecting to a named connection must succeed, but we delay + * connecting to the default connection until we need it + * (since the first command might be 'connect' which allows a + * non-default connection, or might be 'help' which needs no + * connection). + */ + if (!ctl->conn) { + virshReportError(ctl); + vshError(ctl, "%s", _("failed to connect to the hypervisor")); + return FALSE; + } } return TRUE; -- 1.7.4

* src/Makefile.am (remote_protocol-structs): Flatten tabs. * src/remote_protocol-structs: Likewise. Also add a hint to emacs to make it easier to keep spaces in the file. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg00519.html src/Makefile.am | 4 + src/remote_protocol-structs | 1489 ++++++++++++++++++++++--------------------- 2 files changed, 749 insertions(+), 744 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c3729a6..4f2f08f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -195,10 +195,14 @@ remote_protocol-structs: -e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \ -e ' $$p =~ s!\s+\n!\n!sg;' \ -e ' $$p =~ s!\s+$$!!;' \ + -e ' $$p =~ s!\t! !g;' \ -e ' print "$$p\n";' \ -e ' $$n++;' \ -e ' }' \ -e '}' \ + -e 'BEGIN {' \ + -e ' print "/* -*- c -*- */\n";' \ + -e '}' \ -e 'END {' \ -e ' if ($$n < 300) {' \ -e ' warn "WARNING: your pdwtags program is too old\n";' \ diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 81889c3..8e63992 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -1,1424 +1,1425 @@ +/* -*- c -*- */ struct remote_nonnull_domain { - remote_nonnull_string name; - remote_uuid uuid; - int id; + remote_nonnull_string name; + remote_uuid uuid; + int id; }; struct remote_nonnull_network { - remote_nonnull_string name; - remote_uuid uuid; + remote_nonnull_string name; + remote_uuid uuid; }; struct remote_nonnull_nwfilter { - remote_nonnull_string name; - remote_uuid uuid; + remote_nonnull_string name; + remote_uuid uuid; }; struct remote_nonnull_interface { - remote_nonnull_string name; - remote_nonnull_string mac; + remote_nonnull_string name; + remote_nonnull_string mac; }; struct remote_nonnull_storage_pool { - remote_nonnull_string name; - remote_uuid uuid; + remote_nonnull_string name; + remote_uuid uuid; }; struct remote_nonnull_storage_vol { - remote_nonnull_string pool; - remote_nonnull_string name; - remote_nonnull_string key; + remote_nonnull_string pool; + remote_nonnull_string name; + remote_nonnull_string key; }; struct remote_nonnull_node_device { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_nonnull_secret { - remote_uuid uuid; - int usageType; - remote_nonnull_string usageID; + remote_uuid uuid; + int usageType; + remote_nonnull_string usageID; }; struct remote_nonnull_domain_snapshot { - remote_nonnull_string name; - remote_nonnull_domain domain; + remote_nonnull_string name; + remote_nonnull_domain domain; }; struct remote_error { - int code; - int domain; - remote_string message; - int level; - remote_domain dom; - remote_string str1; - remote_string str2; - remote_string str3; - int int1; - int int2; - remote_network net; + int code; + int domain; + remote_string message; + int level; + remote_domain dom; + remote_string str1; + remote_string str2; + remote_string str3; + int int1; + int int2; + remote_network net; }; struct remote_vcpu_info { - u_int number; - int state; - uint64_t cpu_time; - int cpu; + u_int number; + int state; + uint64_t cpu_time; + int cpu; }; struct remote_sched_param_value { - int type; - union { - int i; - u_int ui; - int64_t l; - uint64_t ul; - double d; - int b; - } remote_sched_param_value_u; + int type; + union { + int i; + u_int ui; + int64_t l; + uint64_t ul; + double d; + int b; + } remote_sched_param_value_u; }; struct remote_sched_param { - remote_nonnull_string field; - remote_sched_param_value value; + remote_nonnull_string field; + remote_sched_param_value value; }; struct remote_blkio_param_value { - int type; - union { - int i; - u_int ui; - int64_t l; - uint64_t ul; - double d; - int b; - } remote_blkio_param_value_u; + int type; + union { + int i; + u_int ui; + int64_t l; + uint64_t ul; + double d; + int b; + } remote_blkio_param_value_u; }; struct remote_blkio_param { - remote_nonnull_string field; - remote_blkio_param_value value; + remote_nonnull_string field; + remote_blkio_param_value value; }; struct remote_memory_param_value { - int type; - union { - int i; - u_int ui; - int64_t l; - uint64_t ul; - double d; - int b; - } remote_memory_param_value_u; + int type; + union { + int i; + u_int ui; + int64_t l; + uint64_t ul; + double d; + int b; + } remote_memory_param_value_u; }; struct remote_memory_param { - remote_nonnull_string field; - remote_memory_param_value value; + remote_nonnull_string field; + remote_memory_param_value value; }; struct remote_open_args { - remote_string name; - int flags; + remote_string name; + int flags; }; struct remote_supports_feature_args { - int feature; + int feature; }; struct remote_supports_feature_ret { - int supported; + int supported; }; struct remote_get_type_ret { - remote_nonnull_string type; + remote_nonnull_string type; }; struct remote_get_version_ret { - int64_t hv_ver; + int64_t hv_ver; }; struct remote_get_lib_version_ret { - int64_t lib_ver; + int64_t lib_ver; }; struct remote_get_hostname_ret { - remote_nonnull_string hostname; + remote_nonnull_string hostname; }; struct remote_get_sysinfo_args { - u_int flags; + u_int flags; }; struct remote_get_sysinfo_ret { - remote_nonnull_string sysinfo; + remote_nonnull_string sysinfo; }; struct remote_get_uri_ret { - remote_nonnull_string uri; + remote_nonnull_string uri; }; struct remote_get_max_vcpus_args { - remote_string type; + remote_string type; }; struct remote_get_max_vcpus_ret { - int max_vcpus; + int max_vcpus; }; struct remote_node_get_info_ret { - char model[32]; - int64_t memory; - int cpus; - int mhz; - int nodes; - int sockets; - int cores; - int threads; + char model[32]; + int64_t memory; + int cpus; + int mhz; + int nodes; + int sockets; + int cores; + int threads; }; struct remote_get_capabilities_ret { - remote_nonnull_string capabilities; + remote_nonnull_string capabilities; }; struct remote_node_get_cells_free_memory_args { - int startCell; - int maxCells; + int startCell; + int maxCells; }; struct remote_node_get_cells_free_memory_ret { - struct { - u_int freeMems_len; - int64_t * freeMems_val; - } freeMems; + struct { + u_int freeMems_len; + int64_t * freeMems_val; + } freeMems; }; struct remote_node_get_free_memory_ret { - int64_t freeMem; + int64_t freeMem; }; struct remote_domain_get_scheduler_type_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_scheduler_type_ret { - remote_nonnull_string type; - int nparams; + remote_nonnull_string type; + int nparams; }; struct remote_domain_get_scheduler_parameters_args { - remote_nonnull_domain dom; - int nparams; + remote_nonnull_domain dom; + int nparams; }; struct remote_domain_get_scheduler_parameters_ret { - struct { - u_int params_len; - remote_sched_param * params_val; - } params; + struct { + u_int params_len; + remote_sched_param * params_val; + } params; }; struct remote_domain_set_scheduler_parameters_args { - remote_nonnull_domain dom; - struct { - u_int params_len; - remote_sched_param * params_val; - } params; + remote_nonnull_domain dom; + struct { + u_int params_len; + remote_sched_param * params_val; + } params; }; struct remote_domain_set_blkio_parameters_args { - remote_nonnull_domain dom; - struct { - u_int params_len; - remote_blkio_param * params_val; - } params; - u_int flags; + remote_nonnull_domain dom; + struct { + u_int params_len; + remote_blkio_param * params_val; + } params; + u_int flags; }; struct remote_domain_get_blkio_parameters_args { - remote_nonnull_domain dom; - int nparams; - u_int flags; + remote_nonnull_domain dom; + int nparams; + u_int flags; }; struct remote_domain_get_blkio_parameters_ret { - struct { - u_int params_len; - remote_blkio_param * params_val; - } params; - int nparams; + struct { + u_int params_len; + remote_blkio_param * params_val; + } params; + int nparams; }; struct remote_domain_set_memory_parameters_args { - remote_nonnull_domain dom; - struct { - u_int params_len; - remote_memory_param * params_val; - } params; - u_int flags; + remote_nonnull_domain dom; + struct { + u_int params_len; + remote_memory_param * params_val; + } params; + u_int flags; }; struct remote_domain_get_memory_parameters_args { - remote_nonnull_domain dom; - int nparams; - u_int flags; + remote_nonnull_domain dom; + int nparams; + u_int flags; }; struct remote_domain_get_memory_parameters_ret { - struct { - u_int params_len; - remote_memory_param * params_val; - } params; - int nparams; + struct { + u_int params_len; + remote_memory_param * params_val; + } params; + int nparams; }; struct remote_domain_block_stats_args { - remote_nonnull_domain dom; - remote_nonnull_string path; + remote_nonnull_domain dom; + remote_nonnull_string path; }; struct remote_domain_block_stats_ret { - int64_t rd_req; - int64_t rd_bytes; - int64_t wr_req; - int64_t wr_bytes; - int64_t errs; + int64_t rd_req; + int64_t rd_bytes; + int64_t wr_req; + int64_t wr_bytes; + int64_t errs; }; struct remote_domain_interface_stats_args { - remote_nonnull_domain dom; - remote_nonnull_string path; + remote_nonnull_domain dom; + remote_nonnull_string path; }; struct remote_domain_interface_stats_ret { - int64_t rx_bytes; - int64_t rx_packets; - int64_t rx_errs; - int64_t rx_drop; - int64_t tx_bytes; - int64_t tx_packets; - int64_t tx_errs; - int64_t tx_drop; + int64_t rx_bytes; + int64_t rx_packets; + int64_t rx_errs; + int64_t rx_drop; + int64_t tx_bytes; + int64_t tx_packets; + int64_t tx_errs; + int64_t tx_drop; }; struct remote_domain_memory_stats_args { - remote_nonnull_domain dom; - u_int maxStats; - u_int flags; + remote_nonnull_domain dom; + u_int maxStats; + u_int flags; }; struct remote_domain_memory_stat { - int tag; - uint64_t val; + int tag; + uint64_t val; }; struct remote_domain_memory_stats_ret { - struct { - u_int stats_len; - remote_domain_memory_stat * stats_val; - } stats; + struct { + u_int stats_len; + remote_domain_memory_stat * stats_val; + } stats; }; struct remote_domain_block_peek_args { - remote_nonnull_domain dom; - remote_nonnull_string path; - uint64_t offset; - u_int size; - u_int flags; + remote_nonnull_domain dom; + remote_nonnull_string path; + uint64_t offset; + u_int size; + u_int flags; }; struct remote_domain_block_peek_ret { - struct { - u_int buffer_len; - char * buffer_val; - } buffer; + struct { + u_int buffer_len; + char * buffer_val; + } buffer; }; struct remote_domain_memory_peek_args { - remote_nonnull_domain dom; - uint64_t offset; - u_int size; - u_int flags; + remote_nonnull_domain dom; + uint64_t offset; + u_int size; + u_int flags; }; struct remote_domain_memory_peek_ret { - struct { - u_int buffer_len; - char * buffer_val; - } buffer; + struct { + u_int buffer_len; + char * buffer_val; + } buffer; }; struct remote_domain_get_block_info_args { - remote_nonnull_domain dom; - remote_nonnull_string path; - u_int flags; + remote_nonnull_domain dom; + remote_nonnull_string path; + u_int flags; }; struct remote_domain_get_block_info_ret { - uint64_t allocation; - uint64_t capacity; - uint64_t physical; + uint64_t allocation; + uint64_t capacity; + uint64_t physical; }; struct remote_list_domains_args { - int maxids; + int maxids; }; struct remote_list_domains_ret { - struct { - u_int ids_len; - int * ids_val; - } ids; + struct { + u_int ids_len; + int * ids_val; + } ids; }; struct remote_num_of_domains_ret { - int num; + int num; }; struct remote_domain_create_xml_args { - remote_nonnull_string xml_desc; - int flags; + remote_nonnull_string xml_desc; + int flags; }; struct remote_domain_create_xml_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_lookup_by_id_args { - int id; + int id; }; struct remote_domain_lookup_by_id_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; struct remote_domain_lookup_by_uuid_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_domain_lookup_by_name_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_suspend_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_resume_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_shutdown_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_reboot_args { - remote_nonnull_domain dom; - int flags; + remote_nonnull_domain dom; + int flags; }; struct remote_domain_destroy_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_os_type_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_os_type_ret { - remote_nonnull_string type; + remote_nonnull_string type; }; struct remote_domain_get_max_memory_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_max_memory_ret { - uint64_t memory; + uint64_t memory; }; struct remote_domain_set_max_memory_args { - remote_nonnull_domain dom; - uint64_t memory; + remote_nonnull_domain dom; + uint64_t memory; }; struct remote_domain_set_memory_args { - remote_nonnull_domain dom; - uint64_t memory; + remote_nonnull_domain dom; + uint64_t memory; }; struct remote_domain_set_memory_flags_args { - remote_nonnull_domain dom; - uint64_t memory; - u_int flags; + remote_nonnull_domain dom; + uint64_t memory; + u_int flags; }; struct remote_domain_get_info_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_info_ret { - u_char state; - uint64_t max_mem; - uint64_t memory; - u_short nr_virt_cpu; - uint64_t cpu_time; + u_char state; + uint64_t max_mem; + uint64_t memory; + u_short nr_virt_cpu; + uint64_t cpu_time; }; struct remote_domain_save_args { - remote_nonnull_domain dom; - remote_nonnull_string to; + remote_nonnull_domain dom; + remote_nonnull_string to; }; struct remote_domain_restore_args { - remote_nonnull_string from; + remote_nonnull_string from; }; struct remote_domain_core_dump_args { - remote_nonnull_domain dom; - remote_nonnull_string to; - int flags; + remote_nonnull_domain dom; + remote_nonnull_string to; + int flags; }; struct remote_domain_dump_xml_args { - remote_nonnull_domain dom; - int flags; + remote_nonnull_domain dom; + int flags; }; struct remote_domain_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_domain_migrate_prepare_args { - remote_string uri_in; - uint64_t flags; - remote_string dname; - uint64_t resource; + remote_string uri_in; + uint64_t flags; + remote_string dname; + uint64_t resource; }; struct remote_domain_migrate_prepare_ret { - struct { - u_int cookie_len; - char * cookie_val; - } cookie; - remote_string uri_out; + struct { + u_int cookie_len; + char * cookie_val; + } cookie; + remote_string uri_out; }; struct remote_domain_migrate_perform_args { - remote_nonnull_domain dom; - struct { - u_int cookie_len; - char * cookie_val; - } cookie; - remote_nonnull_string uri; - uint64_t flags; - remote_string dname; - uint64_t resource; + remote_nonnull_domain dom; + struct { + u_int cookie_len; + char * cookie_val; + } cookie; + remote_nonnull_string uri; + uint64_t flags; + remote_string dname; + uint64_t resource; }; struct remote_domain_migrate_finish_args { - remote_nonnull_string dname; - struct { - u_int cookie_len; - char * cookie_val; - } cookie; - remote_nonnull_string uri; - uint64_t flags; + remote_nonnull_string dname; + struct { + u_int cookie_len; + char * cookie_val; + } cookie; + remote_nonnull_string uri; + uint64_t flags; }; struct remote_domain_migrate_finish_ret { - remote_nonnull_domain ddom; + remote_nonnull_domain ddom; }; struct remote_domain_migrate_prepare2_args { - remote_string uri_in; - uint64_t flags; - remote_string dname; - uint64_t resource; - remote_nonnull_string dom_xml; + remote_string uri_in; + uint64_t flags; + remote_string dname; + uint64_t resource; + remote_nonnull_string dom_xml; }; struct remote_domain_migrate_prepare2_ret { - struct { - u_int cookie_len; - char * cookie_val; - } cookie; - remote_string uri_out; + struct { + u_int cookie_len; + char * cookie_val; + } cookie; + remote_string uri_out; }; struct remote_domain_migrate_finish2_args { - remote_nonnull_string dname; - struct { - u_int cookie_len; - char * cookie_val; - } cookie; - remote_nonnull_string uri; - uint64_t flags; - int retcode; + remote_nonnull_string dname; + struct { + u_int cookie_len; + char * cookie_val; + } cookie; + remote_nonnull_string uri; + uint64_t flags; + int retcode; }; struct remote_domain_migrate_finish2_ret { - remote_nonnull_domain ddom; + remote_nonnull_domain ddom; }; struct remote_list_defined_domains_args { - int maxnames; + int maxnames; }; struct remote_list_defined_domains_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_num_of_defined_domains_ret { - int num; + int num; }; struct remote_domain_create_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_create_with_flags_args { - remote_nonnull_domain dom; - u_int flags; + remote_nonnull_domain dom; + u_int flags; }; struct remote_domain_create_with_flags_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_define_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_domain_define_xml_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_undefine_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_set_vcpus_args { - remote_nonnull_domain dom; - int nvcpus; + remote_nonnull_domain dom; + int nvcpus; }; struct remote_domain_set_vcpus_flags_args { - remote_nonnull_domain dom; - u_int nvcpus; - u_int flags; + remote_nonnull_domain dom; + u_int nvcpus; + u_int flags; }; struct remote_domain_get_vcpus_flags_args { - remote_nonnull_domain dom; - u_int flags; + remote_nonnull_domain dom; + u_int flags; }; struct remote_domain_get_vcpus_flags_ret { - int num; + int num; }; struct remote_domain_pin_vcpu_args { - remote_nonnull_domain dom; - int vcpu; - struct { - u_int cpumap_len; - char * cpumap_val; - } cpumap; + remote_nonnull_domain dom; + int vcpu; + struct { + u_int cpumap_len; + char * cpumap_val; + } cpumap; }; struct remote_domain_get_vcpus_args { - remote_nonnull_domain dom; - int maxinfo; - int maplen; + remote_nonnull_domain dom; + int maxinfo; + int maplen; }; struct remote_domain_get_vcpus_ret { - struct { - u_int info_len; - remote_vcpu_info * info_val; - } info; - struct { - u_int cpumaps_len; - char * cpumaps_val; - } cpumaps; + struct { + u_int info_len; + remote_vcpu_info * info_val; + } info; + struct { + u_int cpumaps_len; + char * cpumaps_val; + } cpumaps; }; struct remote_domain_get_max_vcpus_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_max_vcpus_ret { - int num; + int num; }; struct remote_domain_get_security_label_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_security_label_ret { - struct { - u_int label_len; - char * label_val; - } label; - int enforcing; + struct { + u_int label_len; + char * label_val; + } label; + int enforcing; }; struct remote_node_get_security_model_ret { - struct { - u_int model_len; - char * model_val; - } model; - struct { - u_int doi_len; - char * doi_val; - } doi; + struct { + u_int model_len; + char * model_val; + } model; + struct { + u_int doi_len; + char * doi_val; + } doi; }; struct remote_domain_attach_device_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; + remote_nonnull_domain dom; + remote_nonnull_string xml; }; struct remote_domain_attach_device_flags_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; - u_int flags; + remote_nonnull_domain dom; + remote_nonnull_string xml; + u_int flags; }; struct remote_domain_detach_device_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; + remote_nonnull_domain dom; + remote_nonnull_string xml; }; struct remote_domain_detach_device_flags_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; - u_int flags; + remote_nonnull_domain dom; + remote_nonnull_string xml; + u_int flags; }; struct remote_domain_update_device_flags_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; - u_int flags; + remote_nonnull_domain dom; + remote_nonnull_string xml; + u_int flags; }; struct remote_domain_get_autostart_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_autostart_ret { - int autostart; + int autostart; }; struct remote_domain_set_autostart_args { - remote_nonnull_domain dom; - int autostart; + remote_nonnull_domain dom; + int autostart; }; struct remote_num_of_networks_ret { - int num; + int num; }; struct remote_list_networks_args { - int maxnames; + int maxnames; }; struct remote_list_networks_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_num_of_defined_networks_ret { - int num; + int num; }; struct remote_list_defined_networks_args { - int maxnames; + int maxnames; }; struct remote_list_defined_networks_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_network_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; struct remote_network_lookup_by_uuid_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_network_lookup_by_name_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_create_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_network_create_xml_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_define_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_network_define_xml_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_undefine_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_create_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_destroy_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_dump_xml_args { - remote_nonnull_network net; - int flags; + remote_nonnull_network net; + int flags; }; struct remote_network_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_network_get_bridge_name_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_get_bridge_name_ret { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_network_get_autostart_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_get_autostart_ret { - int autostart; + int autostart; }; struct remote_network_set_autostart_args { - remote_nonnull_network net; - int autostart; + remote_nonnull_network net; + int autostart; }; struct remote_num_of_nwfilters_ret { - int num; + int num; }; struct remote_list_nwfilters_args { - int maxnames; + int maxnames; }; struct remote_list_nwfilters_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_nwfilter_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; struct remote_nwfilter_lookup_by_uuid_ret { - remote_nonnull_nwfilter nwfilter; + remote_nonnull_nwfilter nwfilter; }; struct remote_nwfilter_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_nwfilter_lookup_by_name_ret { - remote_nonnull_nwfilter nwfilter; + remote_nonnull_nwfilter nwfilter; }; struct remote_nwfilter_define_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_nwfilter_define_xml_ret { - remote_nonnull_nwfilter nwfilter; + remote_nonnull_nwfilter nwfilter; }; struct remote_nwfilter_undefine_args { - remote_nonnull_nwfilter nwfilter; + remote_nonnull_nwfilter nwfilter; }; struct remote_nwfilter_get_xml_desc_args { - remote_nonnull_nwfilter nwfilter; - int flags; + remote_nonnull_nwfilter nwfilter; + int flags; }; struct remote_nwfilter_get_xml_desc_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_num_of_interfaces_ret { - int num; + int num; }; struct remote_list_interfaces_args { - int maxnames; + int maxnames; }; struct remote_list_interfaces_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_num_of_defined_interfaces_ret { - int num; + int num; }; struct remote_list_defined_interfaces_args { - int maxnames; + int maxnames; }; struct remote_list_defined_interfaces_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_interface_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_interface_lookup_by_name_ret { - remote_nonnull_interface iface; + remote_nonnull_interface iface; }; struct remote_interface_lookup_by_mac_string_args { - remote_nonnull_string mac; + remote_nonnull_string mac; }; struct remote_interface_lookup_by_mac_string_ret { - remote_nonnull_interface iface; + remote_nonnull_interface iface; }; struct remote_interface_get_xml_desc_args { - remote_nonnull_interface iface; - u_int flags; + remote_nonnull_interface iface; + u_int flags; }; struct remote_interface_get_xml_desc_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_interface_define_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; struct remote_interface_define_xml_ret { - remote_nonnull_interface iface; + remote_nonnull_interface iface; }; struct remote_interface_undefine_args { - remote_nonnull_interface iface; + remote_nonnull_interface iface; }; struct remote_interface_create_args { - remote_nonnull_interface iface; - u_int flags; + remote_nonnull_interface iface; + u_int flags; }; struct remote_interface_destroy_args { - remote_nonnull_interface iface; - u_int flags; + remote_nonnull_interface iface; + u_int flags; }; struct remote_auth_list_ret { - struct { - u_int types_len; - remote_auth_type * types_val; - } types; + struct { + u_int types_len; + remote_auth_type * types_val; + } types; }; struct remote_auth_sasl_init_ret { - remote_nonnull_string mechlist; + remote_nonnull_string mechlist; }; struct remote_auth_sasl_start_args { - remote_nonnull_string mech; - int nil; - struct { - u_int data_len; - char * data_val; - } data; + remote_nonnull_string mech; + int nil; + struct { + u_int data_len; + char * data_val; + } data; }; struct remote_auth_sasl_start_ret { - int complete; - int nil; - struct { - u_int data_len; - char * data_val; - } data; + int complete; + int nil; + struct { + u_int data_len; + char * data_val; + } data; }; struct remote_auth_sasl_step_args { - int nil; - struct { - u_int data_len; - char * data_val; - } data; + int nil; + struct { + u_int data_len; + char * data_val; + } data; }; struct remote_auth_sasl_step_ret { - int complete; - int nil; - struct { - u_int data_len; - char * data_val; - } data; + int complete; + int nil; + struct { + u_int data_len; + char * data_val; + } data; }; struct remote_auth_polkit_ret { - int complete; + int complete; }; struct remote_num_of_storage_pools_ret { - int num; + int num; }; struct remote_list_storage_pools_args { - int maxnames; + int maxnames; }; struct remote_list_storage_pools_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_num_of_defined_storage_pools_ret { - int num; + int num; }; struct remote_list_defined_storage_pools_args { - int maxnames; + int maxnames; }; struct remote_list_defined_storage_pools_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_find_storage_pool_sources_args { - remote_nonnull_string type; - remote_string srcSpec; - u_int flags; + remote_nonnull_string type; + remote_string srcSpec; + u_int flags; }; struct remote_find_storage_pool_sources_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_storage_pool_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; struct remote_storage_pool_lookup_by_uuid_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_storage_pool_lookup_by_name_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_lookup_by_volume_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_pool_lookup_by_volume_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_create_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; struct remote_storage_pool_create_xml_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_define_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; struct remote_storage_pool_define_xml_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_build_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; struct remote_storage_pool_undefine_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_create_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; struct remote_storage_pool_destroy_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_delete_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; struct remote_storage_pool_refresh_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; struct remote_storage_pool_dump_xml_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; struct remote_storage_pool_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_storage_pool_get_info_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_get_info_ret { - u_char state; - uint64_t capacity; - uint64_t allocation; - uint64_t available; + u_char state; + uint64_t capacity; + uint64_t allocation; + uint64_t available; }; struct remote_storage_pool_get_autostart_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_get_autostart_ret { - int autostart; + int autostart; }; struct remote_storage_pool_set_autostart_args { - remote_nonnull_storage_pool pool; - int autostart; + remote_nonnull_storage_pool pool; + int autostart; }; struct remote_storage_pool_num_of_volumes_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_num_of_volumes_ret { - int num; + int num; }; struct remote_storage_pool_list_volumes_args { - remote_nonnull_storage_pool pool; - int maxnames; + remote_nonnull_storage_pool pool; + int maxnames; }; struct remote_storage_pool_list_volumes_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_storage_vol_lookup_by_name_args { - remote_nonnull_storage_pool pool; - remote_nonnull_string name; + remote_nonnull_storage_pool pool; + remote_nonnull_string name; }; struct remote_storage_vol_lookup_by_name_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_lookup_by_key_args { - remote_nonnull_string key; + remote_nonnull_string key; }; struct remote_storage_vol_lookup_by_key_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_lookup_by_path_args { - remote_nonnull_string path; + remote_nonnull_string path; }; struct remote_storage_vol_lookup_by_path_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_create_xml_args { - remote_nonnull_storage_pool pool; - remote_nonnull_string xml; - u_int flags; + remote_nonnull_storage_pool pool; + remote_nonnull_string xml; + u_int flags; }; struct remote_storage_vol_create_xml_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_create_xml_from_args { - remote_nonnull_storage_pool pool; - remote_nonnull_string xml; - remote_nonnull_storage_vol clonevol; - u_int flags; + remote_nonnull_storage_pool pool; + remote_nonnull_string xml; + remote_nonnull_storage_vol clonevol; + u_int flags; }; struct remote_storage_vol_create_xml_from_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_delete_args { - remote_nonnull_storage_vol vol; - u_int flags; + remote_nonnull_storage_vol vol; + u_int flags; }; struct remote_storage_vol_wipe_args { - remote_nonnull_storage_vol vol; - u_int flags; + remote_nonnull_storage_vol vol; + u_int flags; }; struct remote_storage_vol_dump_xml_args { - remote_nonnull_storage_vol vol; - u_int flags; + remote_nonnull_storage_vol vol; + u_int flags; }; struct remote_storage_vol_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_storage_vol_get_info_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_get_info_ret { - char type; - uint64_t capacity; - uint64_t allocation; + char type; + uint64_t capacity; + uint64_t allocation; }; struct remote_storage_vol_get_path_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; struct remote_storage_vol_get_path_ret { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_num_of_devices_args { - remote_string cap; - u_int flags; + remote_string cap; + u_int flags; }; struct remote_node_num_of_devices_ret { - int num; + int num; }; struct remote_node_list_devices_args { - remote_string cap; - int maxnames; - u_int flags; + remote_string cap; + int maxnames; + u_int flags; }; struct remote_node_list_devices_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_node_device_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_lookup_by_name_ret { - remote_nonnull_node_device dev; + remote_nonnull_node_device dev; }; struct remote_node_device_dump_xml_args { - remote_nonnull_string name; - u_int flags; + remote_nonnull_string name; + u_int flags; }; struct remote_node_device_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_node_device_get_parent_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_get_parent_ret { - remote_string parent; + remote_string parent; }; struct remote_node_device_num_of_caps_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_num_of_caps_ret { - int num; + int num; }; struct remote_node_device_list_caps_args { - remote_nonnull_string name; - int maxnames; + remote_nonnull_string name; + int maxnames; }; struct remote_node_device_list_caps_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_node_device_dettach_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_re_attach_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_reset_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_node_device_create_xml_args { - remote_nonnull_string xml_desc; - int flags; + remote_nonnull_string xml_desc; + int flags; }; struct remote_node_device_create_xml_ret { - remote_nonnull_node_device dev; + remote_nonnull_node_device dev; }; struct remote_node_device_destroy_args { - remote_nonnull_string name; + remote_nonnull_string name; }; struct remote_domain_events_register_ret { - int cb_registered; + int cb_registered; }; struct remote_domain_events_deregister_ret { - int cb_registered; + int cb_registered; }; struct remote_domain_event_lifecycle_msg { - remote_nonnull_domain dom; - int event; - int detail; + remote_nonnull_domain dom; + int event; + int detail; }; struct remote_domain_xml_from_native_args { - remote_nonnull_string nativeFormat; - remote_nonnull_string nativeConfig; - u_int flags; + remote_nonnull_string nativeFormat; + remote_nonnull_string nativeConfig; + u_int flags; }; struct remote_domain_xml_from_native_ret { - remote_nonnull_string domainXml; + remote_nonnull_string domainXml; }; struct remote_domain_xml_to_native_args { - remote_nonnull_string nativeFormat; - remote_nonnull_string domainXml; - u_int flags; + remote_nonnull_string nativeFormat; + remote_nonnull_string domainXml; + u_int flags; }; struct remote_domain_xml_to_native_ret { - remote_nonnull_string nativeConfig; + remote_nonnull_string nativeConfig; }; struct remote_num_of_secrets_ret { - int num; + int num; }; struct remote_list_secrets_args { - int maxuuids; + int maxuuids; }; struct remote_list_secrets_ret { - struct { - u_int uuids_len; - remote_nonnull_string * uuids_val; - } uuids; + struct { + u_int uuids_len; + remote_nonnull_string * uuids_val; + } uuids; }; struct remote_secret_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; struct remote_secret_lookup_by_uuid_ret { - remote_nonnull_secret secret; + remote_nonnull_secret secret; }; struct remote_secret_define_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; struct remote_secret_define_xml_ret { - remote_nonnull_secret secret; + remote_nonnull_secret secret; }; struct remote_secret_get_xml_desc_args { - remote_nonnull_secret secret; - u_int flags; + remote_nonnull_secret secret; + u_int flags; }; struct remote_secret_get_xml_desc_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_secret_set_value_args { - remote_nonnull_secret secret; - struct { - u_int value_len; - char * value_val; - } value; - u_int flags; + remote_nonnull_secret secret; + struct { + u_int value_len; + char * value_val; + } value; + u_int flags; }; struct remote_secret_get_value_args { - remote_nonnull_secret secret; - u_int flags; + remote_nonnull_secret secret; + u_int flags; }; struct remote_secret_get_value_ret { - struct { - u_int value_len; - char * value_val; - } value; + struct { + u_int value_len; + char * value_val; + } value; }; struct remote_secret_undefine_args { - remote_nonnull_secret secret; + remote_nonnull_secret secret; }; struct remote_secret_lookup_by_usage_args { - int usageType; - remote_nonnull_string usageID; + int usageType; + remote_nonnull_string usageID; }; struct remote_secret_lookup_by_usage_ret { - remote_nonnull_secret secret; + remote_nonnull_secret secret; }; struct remote_domain_migrate_prepare_tunnel_args { - uint64_t flags; - remote_string dname; - uint64_t resource; - remote_nonnull_string dom_xml; + uint64_t flags; + remote_string dname; + uint64_t resource; + remote_nonnull_string dom_xml; }; struct remote_is_secure_ret { - int secure; + int secure; }; struct remote_domain_is_active_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_is_active_ret { - int active; + int active; }; struct remote_domain_is_persistent_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_is_persistent_ret { - int persistent; + int persistent; }; struct remote_domain_is_updated_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_is_updated_ret { - int updated; + int updated; }; struct remote_network_is_active_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_is_active_ret { - int active; + int active; }; struct remote_network_is_persistent_args { - remote_nonnull_network net; + remote_nonnull_network net; }; struct remote_network_is_persistent_ret { - int persistent; + int persistent; }; struct remote_storage_pool_is_active_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_is_active_ret { - int active; + int active; }; struct remote_storage_pool_is_persistent_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; struct remote_storage_pool_is_persistent_ret { - int persistent; + int persistent; }; struct remote_interface_is_active_args { - remote_nonnull_interface iface; + remote_nonnull_interface iface; }; struct remote_interface_is_active_ret { - int active; + int active; }; struct remote_cpu_compare_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; struct remote_cpu_compare_ret { - int result; + int result; }; struct remote_cpu_baseline_args { - struct { - u_int xmlCPUs_len; - remote_nonnull_string * xmlCPUs_val; - } xmlCPUs; - u_int flags; + struct { + u_int xmlCPUs_len; + remote_nonnull_string * xmlCPUs_val; + } xmlCPUs; + u_int flags; }; struct remote_cpu_baseline_ret { - remote_nonnull_string cpu; + remote_nonnull_string cpu; }; struct remote_domain_get_job_info_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_get_job_info_ret { - int type; - uint64_t timeElapsed; - uint64_t timeRemaining; - uint64_t dataTotal; - uint64_t dataProcessed; - uint64_t dataRemaining; - uint64_t memTotal; - uint64_t memProcessed; - uint64_t memRemaining; - uint64_t fileTotal; - uint64_t fileProcessed; - uint64_t fileRemaining; + int type; + uint64_t timeElapsed; + uint64_t timeRemaining; + uint64_t dataTotal; + uint64_t dataProcessed; + uint64_t dataRemaining; + uint64_t memTotal; + uint64_t memProcessed; + uint64_t memRemaining; + uint64_t fileTotal; + uint64_t fileProcessed; + uint64_t fileRemaining; }; struct remote_domain_abort_job_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_migrate_set_max_downtime_args { - remote_nonnull_domain dom; - uint64_t downtime; - u_int flags; + remote_nonnull_domain dom; + uint64_t downtime; + u_int flags; }; struct remote_domain_migrate_set_max_speed_args { - remote_nonnull_domain dom; - uint64_t bandwidth; - u_int flags; + remote_nonnull_domain dom; + uint64_t bandwidth; + u_int flags; }; struct remote_domain_events_register_any_args { - int eventID; + int eventID; }; struct remote_domain_events_deregister_any_args { - int eventID; + int eventID; }; struct remote_domain_event_reboot_msg { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; struct remote_domain_event_rtc_change_msg { - remote_nonnull_domain dom; - int64_t offset; + remote_nonnull_domain dom; + int64_t offset; }; struct remote_domain_event_watchdog_msg { - remote_nonnull_domain dom; - int action; + remote_nonnull_domain dom; + int action; }; struct remote_domain_event_io_error_msg { - remote_nonnull_domain dom; - remote_nonnull_string srcPath; - remote_nonnull_string devAlias; - int action; + remote_nonnull_domain dom; + remote_nonnull_string srcPath; + remote_nonnull_string devAlias; + int action; }; struct remote_domain_event_io_error_reason_msg { - remote_nonnull_domain dom; - remote_nonnull_string srcPath; - remote_nonnull_string devAlias; - int action; - remote_nonnull_string reason; + remote_nonnull_domain dom; + remote_nonnull_string srcPath; + remote_nonnull_string devAlias; + int action; + remote_nonnull_string reason; }; struct remote_domain_event_graphics_address { - int family; - remote_nonnull_string node; - remote_nonnull_string service; + int family; + remote_nonnull_string node; + remote_nonnull_string service; }; struct remote_domain_event_graphics_identity { - remote_nonnull_string type; - remote_nonnull_string name; + remote_nonnull_string type; + remote_nonnull_string name; }; struct remote_domain_event_graphics_msg { - remote_nonnull_domain dom; - int phase; - remote_domain_event_graphics_address local; - remote_domain_event_graphics_address remote; - remote_nonnull_string authScheme; - struct { - u_int subject_len; - remote_domain_event_graphics_identity * subject_val; - } subject; + remote_nonnull_domain dom; + int phase; + remote_domain_event_graphics_address local; + remote_domain_event_graphics_address remote; + remote_nonnull_string authScheme; + struct { + u_int subject_len; + remote_domain_event_graphics_identity * subject_val; + } subject; }; struct remote_domain_managed_save_args { - remote_nonnull_domain dom; - u_int flags; + remote_nonnull_domain dom; + u_int flags; }; struct remote_domain_has_managed_save_image_args { - remote_nonnull_domain dom; - u_int flags; + remote_nonnull_domain dom; + u_int flags; }; struct remote_domain_has_managed_save_image_ret { - int ret; + int ret; }; struct remote_domain_managed_save_remove_args { - remote_nonnull_domain dom; - u_int flags; + remote_nonnull_domain dom; + u_int flags; }; struct remote_domain_snapshot_create_xml_args { - remote_nonnull_domain domain; - remote_nonnull_string xml_desc; - int flags; + remote_nonnull_domain domain; + remote_nonnull_string xml_desc; + int flags; }; struct remote_domain_snapshot_create_xml_ret { - remote_nonnull_domain_snapshot snap; + remote_nonnull_domain_snapshot snap; }; struct remote_domain_snapshot_dump_xml_args { - remote_nonnull_domain_snapshot snap; - int flags; + remote_nonnull_domain_snapshot snap; + int flags; }; struct remote_domain_snapshot_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; struct remote_domain_snapshot_num_args { - remote_nonnull_domain domain; - int flags; + remote_nonnull_domain domain; + int flags; }; struct remote_domain_snapshot_num_ret { - int num; + int num; }; struct remote_domain_snapshot_list_names_args { - remote_nonnull_domain domain; - int nameslen; - int flags; + remote_nonnull_domain domain; + int nameslen; + int flags; }; struct remote_domain_snapshot_list_names_ret { - struct { - u_int names_len; - remote_nonnull_string * names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string * names_val; + } names; }; struct remote_domain_snapshot_lookup_by_name_args { - remote_nonnull_domain domain; - remote_nonnull_string name; - int flags; + remote_nonnull_domain domain; + remote_nonnull_string name; + int flags; }; struct remote_domain_snapshot_lookup_by_name_ret { - remote_nonnull_domain_snapshot snap; + remote_nonnull_domain_snapshot snap; }; struct remote_domain_has_current_snapshot_args { - remote_nonnull_domain domain; - int flags; + remote_nonnull_domain domain; + int flags; }; struct remote_domain_has_current_snapshot_ret { - int result; + int result; }; struct remote_domain_snapshot_current_args { - remote_nonnull_domain domain; - int flags; + remote_nonnull_domain domain; + int flags; }; struct remote_domain_snapshot_current_ret { - remote_nonnull_domain_snapshot snap; + remote_nonnull_domain_snapshot snap; }; struct remote_domain_revert_to_snapshot_args { - remote_nonnull_domain_snapshot snap; - int flags; + remote_nonnull_domain_snapshot snap; + int flags; }; struct remote_domain_snapshot_delete_args { - remote_nonnull_domain_snapshot snap; - int flags; + remote_nonnull_domain_snapshot snap; + int flags; }; struct remote_domain_open_console_args { - remote_nonnull_domain domain; - remote_string devname; - u_int flags; + remote_nonnull_domain domain; + remote_string devname; + u_int flags; }; struct remote_message_header { - u_int prog; - u_int vers; - int proc; - remote_message_type type; - u_int serial; - remote_message_status status; + u_int prog; + u_int vers; + int proc; + remote_message_type type; + u_int serial; + remote_message_status status; }; -- 1.7.4

On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/Makefile.am (remote_protocol-structs): Flatten tabs. * src/remote_protocol-structs: Likewise. Also add a hint to emacs to make it easier to keep spaces in the file. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg00519.html
src/Makefile.am | 4 + src/remote_protocol-structs | 1489 ++++++++++++++++++++++--------------------- 2 files changed, 749 insertions(+), 744 deletions(-)
ACK

On 03/27/2011 02:42 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/Makefile.am (remote_protocol-structs): Flatten tabs. * src/remote_protocol-structs: Likewise. Also add a hint to emacs to make it easier to keep spaces in the file. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg00519.html
src/Makefile.am | 4 + src/remote_protocol-structs | 1489 ++++++++++++++++++++++--------------------- 2 files changed, 749 insertions(+), 744 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

* src/util/logging.c (virLogStartup, virLogSetBufferSize): Over-allocate, so that a debugger can just print the circular buffer. Suggested by Daniel Veillard. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01107.html src/util/logging.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/logging.c b/src/util/logging.c index f4910ad..48c0cfd 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -197,14 +197,14 @@ int virLogStartup(void) { virLogInitialized = 1; virLogLock(); - if (VIR_ALLOC_N(virLogBuffer, virLogSize) < 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1) < 0) { /* * The debug buffer is not a critical component, allow startup * even in case of failure to allocate it in case of a * configuration mistake. */ virLogSize = 64 * 1024; - if (VIR_ALLOC_N(virLogBuffer, virLogSize) < 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1) < 0) { pbm = "Failed to allocate debug buffer: deactivating debug log\n"; virLogSize = 0; } else { @@ -249,14 +249,14 @@ virLogSetBufferSize(int size) { oldsize = virLogSize; oldLogBuffer = virLogBuffer; - if (INT_MAX / 1024 < size) { + if (INT_MAX / 1024 <= size) { pbm = "Requested log size of %d kB too large\n"; ret = -1; goto error; } virLogSize = size * 1024; - if (VIR_ALLOC_N(virLogBuffer, virLogSize) < 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1) < 0) { pbm = "Failed to allocate debug buffer of %d kB\n"; virLogBuffer = oldLogBuffer; virLogSize = oldsize; -- 1.7.4

On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/util/logging.c (virLogStartup, virLogSetBufferSize): Over-allocate, so that a debugger can just print the circular buffer. Suggested by Daniel Veillard. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01107.html
src/util/logging.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/util/logging.c b/src/util/logging.c index f4910ad..48c0cfd 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -197,14 +197,14 @@ int virLogStartup(void) {
virLogInitialized = 1; virLogLock(); - if (VIR_ALLOC_N(virLogBuffer, virLogSize)< 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)< 0) { /* * The debug buffer is not a critical component, allow startup * even in case of failure to allocate it in case of a * configuration mistake. */ virLogSize = 64 * 1024; - if (VIR_ALLOC_N(virLogBuffer, virLogSize)< 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)< 0) { pbm = "Failed to allocate debug buffer: deactivating debug log\n"; virLogSize = 0; } else { @@ -249,14 +249,14 @@ virLogSetBufferSize(int size) { oldsize = virLogSize; oldLogBuffer = virLogBuffer;
- if (INT_MAX / 1024< size) { + if (INT_MAX / 1024<= size) { pbm = "Requested log size of %d kB too large\n"; ret = -1; goto error; }
virLogSize = size * 1024; - if (VIR_ALLOC_N(virLogBuffer, virLogSize)< 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)< 0) { pbm = "Failed to allocate debug buffer of %d kB\n"; virLogBuffer = oldLogBuffer; virLogSize = oldsize;
ACK

On 03/27/2011 02:51 AM, Laine Stump wrote:
On 03/26/2011 08:12 AM, Eric Blake wrote:
* src/util/logging.c (virLogStartup, virLogSetBufferSize): Over-allocate, so that a debugger can just print the circular buffer. Suggested by Daniel Veillard. ---
Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01107.html
src/util/logging.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/util/logging.c b/src/util/logging.c index f4910ad..48c0cfd 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -197,14 +197,14 @@ int virLogStartup(void) {
virLogInitialized = 1; virLogLock(); - if (VIR_ALLOC_N(virLogBuffer, virLogSize)< 0) { + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)< 0) { /*
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

* src/libvirt_xenxs.syms: New file. * src/Makefile.am (USED_SYM_FILES, EXTRA_DIST): Add new file. * src/libvirt_private.syms (domain_conf.h): Add missing exports. * tests/Makefile.am (xml2sexprtest_LDADD, sexpr2xmltest_LDADD) (xmconfigtest_LDADD, xencapstest_LDADD): Add missing library. (LDADDS): Globally include libvirt_util.la as needed. Don't include WARN_CFLAGS; INCLUDES already does that. --- Original post: https://www.redhat.com/archives/libvir-list/2011-March/msg01041.html Definitely needs to interact with proposed libxenlight use of xenxs: https://www.redhat.com/archives/libvir-list/2011-March/msg01141.html src/Makefile.am | 9 +++++++-- src/libvirt_private.syms | 20 ++++++++++++++++++++ src/libvirt_xenxs.syms | 22 ++++++++++++++++++++++ tests/Makefile.am | 30 +++++++++++++++++------------- 4 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 src/libvirt_xenxs.syms diff --git a/src/Makefile.am b/src/Makefile.am index 4f2f08f..ae66887 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1119,6 +1119,10 @@ if WITH_VMX USED_SYM_FILES += libvirt_vmx.syms endif +if WITH_XEN +USED_SYM_FILES += libvirt_xenxs.syms +endif + EXTRA_DIST += \ libvirt_public.syms \ libvirt_private.syms \ @@ -1127,8 +1131,9 @@ EXTRA_DIST += \ libvirt_linux.syms \ libvirt_macvtap.syms \ libvirt_daemon.syms \ - libvirt_nwfilter.syms \ - libvirt_vmx.syms + libvirt_nwfilter.syms \ + libvirt_vmx.syms \ + libvirt_xenxs.syms BUILT_SOURCES += libvirt.syms libvirt.def libvirt_qemu.def diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 11fd5c7..5f58970 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -312,6 +312,8 @@ virDomainSoundModelTypeFromString; virDomainSoundModelTypeToString; virDomainStateTypeFromString; virDomainStateTypeToString; +virDomainSysinfoTypeFromString; +virDomainSysinfoTypeToString; virDomainTimerModeTypeFromString; virDomainTimerModeTypeToString; virDomainTimerNameTypeFromString; @@ -758,6 +760,24 @@ virSecurityManagerSetSocketLabel; virSecurityManagerVerify; +# sexpr.h +sexpr2string; +sexpr_append; +sexpr_cons; +sexpr_float; +sexpr_fmt_node; +sexpr_free; +sexpr_has; +sexpr_int; +sexpr_lookup; +sexpr_nil; +sexpr_node; +sexpr_node_copy; +sexpr_string; +sexpr_u64; +string2sexpr; + + # storage_conf.h virStoragePartedFsTypeTypeToString; virStoragePoolDefFormat; diff --git a/src/libvirt_xenxs.syms b/src/libvirt_xenxs.syms new file mode 100644 index 0000000..2f7caf4 --- /dev/null +++ b/src/libvirt_xenxs.syms @@ -0,0 +1,22 @@ +# +# These symbols are currently dependent upon WITH_XEN (configure --with-xen), +# and will soon also impact WITH_LIBXL (--with-libxl). +# + +# xen_sxpr.h +xenFormatSxpr; +xenFormatSxprChr; +xenFormatSxprDisk; +xenFormatSxprNet; +xenFormatSxprOnePCI; +xenFormatSxprSound; +xenGetDomIdFromSxpr; +xenGetDomIdFromSxprString; +xenParseSxpr; +xenParseSxprChar; +xenParseSxprSound; +xenParseSxprString; + +# xen_xm.h +xenFormatXM; +xenParseXM; diff --git a/tests/Makefile.am b/tests/Makefile.am index 5896442..89d879c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,8 +14,8 @@ INCLUDES = \ $(SASL_CFLAGS) \ $(SELINUX_CFLAGS) \ $(APPARMOR_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(WARN_CFLAGS) + $(COVERAGE_CFLAGS) \ + $(WARN_CFLAGS) if WITH_DRIVER_MODULES INCLUDES += \ @@ -25,15 +25,15 @@ endif LDADDS = \ $(STATIC_BINARIES) \ $(LIBXML_LIBS) \ - $(GNUTLS_LIBS) \ - $(SASL_LIBS) \ - $(SELINUX_LIBS) \ - $(APPARMOR_LIBS) \ - $(WARN_CFLAGS) \ + $(GNUTLS_LIBS) \ + $(SASL_LIBS) \ + $(SELINUX_LIBS) \ + $(APPARMOR_LIBS) \ ../src/libvirt_test.la \ + ../src/libvirt_util.la \ ../gnulib/lib/libgnu.la \ $(LIBSOCKET) \ - $(COVERAGE_LDFLAGS) + $(COVERAGE_LDFLAGS) EXTRA_DIST = \ capabilityschemadata \ @@ -222,27 +222,31 @@ valgrind: sockettest_SOURCES = \ sockettest.c \ testutils.c testutils.h -sockettest_LDADD = ../src/libvirt_util.la $(LDADDS) +sockettest_LDADD = $(LDADDS) if WITH_XEN xml2sexprtest_SOURCES = \ xml2sexprtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) +xml2sexprtest_LDADD = ../src/libvirt_xenxs.la \ + ../src/libvirt_driver_xen.la $(LDADDS) sexpr2xmltest_SOURCES = \ sexpr2xmltest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) +sexpr2xmltest_LDADD = ../src/libvirt_xenxs.la \ + ../src/libvirt_driver_xen.la $(LDADDS) xmconfigtest_SOURCES = \ xmconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) +xmconfigtest_LDADD = ../src/libvirt_xenxs.la \ + ../src/libvirt_driver_xen.la $(LDADDS) xencapstest_SOURCES = \ xencapstest.c testutils.h testutils.c -xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) +xencapstest_LDADD = ../src/libvirt_xenxs.la \ + ../src/libvirt_driver_xen.la $(LDADDS) reconnect_SOURCES = \ reconnect.c -- 1.7.4
participants (4)
-
Eric Blake
-
Laine Stump
-
Matthias Bolte
-
Paolo Bonzini