[libvirt] [PATCH] virnetsocket: fix getsockopt on FreeBSD
by Ryota Ozaki
aa0f099 introduced a strict error checking for getsockopt and it
revealed that getting a peer credential of a socket on FreeBSD
didn't work. Libvirtd hits the error:
error : virNetSocketGetUNIXIdentity:1198 : Failed to get valid
client socket identity groups
SOL_SOCKET (0xffff) was used as a level of getsockopt for
LOCAL_PEERCRED, however, it was wrong. 0 is correct as well as
Mac OS X.
So for LOCAL_PEERCRED our options are SOL_LOCAL (if defined) or
0 on Mac OS X and FreeBSD. According to the fact, the patch
simplifies the code by removing ifdef __APPLE__.
I tested the patch on FreeBSD 8.4, 9.2 and 10.0-BETA1.
Signed-off-by: Ryota Ozaki <ozaki.ryota(a)gmail.com>
---
src/rpc/virnetsocket.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 3eb5708..04bf25a 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1152,18 +1152,17 @@ cleanup:
/* VIR_SOL_PEERCRED - the value needed to let getsockopt() work with
* LOCAL_PEERCRED
*/
-# ifdef __APPLE__
-# ifdef SOL_LOCAL
-# define VIR_SOL_PEERCRED SOL_LOCAL
-# else
-/* Prior to Mac OS X 10.7, SOL_LOCAL was not defined and users were
- * expected to supply 0 as the second value for getsockopt() when using
- * LOCAL_PEERCRED
- */
-# define VIR_SOL_PEERCRED 0
-# endif
+
+/* Mac OS X 10.8 provides SOL_LOCAL for LOCAL_PEERCRED */
+# ifdef SOL_LOCAL
+# define VIR_SOL_PEERCRED SOL_LOCAL
# else
-# define VIR_SOL_PEERCRED SOL_SOCKET
+/* FreeBSD and Mac OS X prior to 10.7, SOL_LOCAL is not defined and
+ * users are expected to supply 0 as the second value for getsockopt()
+ * when using LOCAL_PEERCRED. NB SOL_SOCKET cannot be used instead
+ * of SOL_LOCAL
+ */
+# define VIR_SOL_PEERCRED 0
# endif
int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
--
1.8.4
11 years
[libvirt] Entering freeze for libvirt-1.1.4
by Daniel Veillard
I finally tagged and genrated tarballs for RC1 of 1.1.4, so we have
now entered freeze. The bits are available as usual at:
ftp://libvirt.org/libvirt/
My initial testing doesn't show anything suspicious but is limited,
so please give it a try, especially for portability issues !
If all goes well i will probably make an rc2 by Thurday and release
1.1.4 for good on Monday 4th.
Give it a try !
thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
11 years
[libvirt] [PATCH] MacOS: Handle changes to args in xdrproc_t
by Doug Goldstein
With Mac OS X 10.9, xdrproc_t is no longer defined as:
typedef bool_t (*xdrproc_t) (XDR *, void *, ...);
but instead as
typedef bool-t (*xdrproc_t) (XDR *, void *, unsigned int);
The rationale explained in the header is that using a vararg is
incorrect and has a potential to change the ABI slightly. They decided
to specify the exact number of parameters and for compatibility with old
code decided to make the signature require 3 arguments. The third
argument is ignored for cases that its not used and its recommended to
supply a 0.
---
configure.ac | 41 +++++++++++++++++++++++++++++++++++++++++
src/rpc/virnetmessage.c | 10 ++++++++--
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1c5b168..f2bae88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -697,6 +697,47 @@ if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then
*) XDR_CFLAGS=$lv_cv_xdr_cflags ;;
esac
AC_SUBST([XDR_CFLAGS])
+
+ dnl Mac OS X Mavericks (10.9) dropped the varargs definition that
+ dnl allowed 2 or 3 parameters to xdrproc_t callbacks and decided on
+ dnl 3 arguments being a must.
+ old_CFLAGS=$CFLAGS
+ AC_CACHE_CHECK([whether xdrproc_t callbacks take 2 or 3 args],
+ [lv_cv_xdrproc_t_args], [
+ CFLAGS="$old_CFLAGS $XDR_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <rpc/rpc.h>
+ ]],
+ [[
+ XDR xdr;
+ xdrproc_t filter = NULL;
+
+ return (filter)(&xdr, NULL);
+ ]])],
+ [lv_cv_xdrproc_t_args=2], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <rpc/rpc.h>
+ ]],
+ [[
+ XDR xdr;
+ xdrproc_t filter = NULL;
+
+ return (filter)(&xdr, NULL, 0);
+ ]])],
+ [lv_cv_xdrproc_t_args=3],
+ [lv_cv_xdrproc_t_args=unknown])
+ ])
+ CFLAGS="$old_CFLAGS"
+ ])
+ case $lv_cv_xdrproc_t_args in
+ unknown) AC_MSG_ERROR([cannot determine arg count for xdrproc_t]) ;;
+ *)
+ AC_DEFINE_UNQUOTED([XDRPROC_T_ARG_COUNT], [$lv_cv_xdrproc_t_args],
+ [number of arguments that xdrproc_t func ptr takes])
+ ;;
+ esac
fi
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index d60366b..79e496f 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -33,6 +33,12 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+#if XDRPROC_T_ARG_COUNT == 3
+# define VIR_XDRPROC(proc, xdr, data) ((proc)((xdr), (data), 0))
+#else
+# define VIR_XDRPROC(proc, xdr, data) ((proc)((xdr), (data)))
+#endif
+
virNetMessagePtr virNetMessageNew(bool tracked)
{
virNetMessagePtr msg;
@@ -345,7 +351,7 @@ int virNetMessageEncodePayload(virNetMessagePtr msg,
msg->bufferLength - msg->bufferOffset, XDR_ENCODE);
/* Try to encode the payload. If the buffer is too small increase it. */
- while (!(*filter)(&xdr, data)) {
+ while (!VIR_XDRPROC(*filter, &xdr, data)) {
unsigned int newlen = (msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX) * 4;
if (newlen > VIR_NET_MESSAGE_MAX) {
@@ -402,7 +408,7 @@ int virNetMessageDecodePayload(virNetMessagePtr msg,
xdrmem_create(&xdr, msg->buffer + msg->bufferOffset,
msg->bufferLength - msg->bufferOffset, XDR_DECODE);
- if (!(*filter)(&xdr, data)) {
+ if (!VIR_XDRPROC(*filter, &xdr, data)) {
virReportError(VIR_ERR_RPC, "%s", _("Unable to decode message payload"));
goto error;
}
--
1.8.1.5
11 years
[libvirt] [PATCH] MacOS: Handle changes to xdrproc_t definition
by Doug Goldstein
With Mac OS X 10.9, xdrproc_t is no longer defined as:
typedef bool_t (*xdrproc_t)(XDR *, ...);
but instead as:
typdef bool_t (*xdrproc_t)(XDR *, void *, unsigned int);
For reference, Linux systems typically define it as:
typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
The rationale explained in the header is that using a vararg is
incorrect and has a potential to change the ABI slightly do to compiler
optimizations taken and the undefined behavior. They decided
to specify the exact number of parameters and for compatibility with old
code decided to make the signature require 3 arguments. The third
argument is ignored for cases that its not used and its recommended to
supply a 0.
---
src/rpc/virnetmessage.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index d60366b..af07404 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -345,7 +345,7 @@ int virNetMessageEncodePayload(virNetMessagePtr msg,
msg->bufferLength - msg->bufferOffset, XDR_ENCODE);
/* Try to encode the payload. If the buffer is too small increase it. */
- while (!(*filter)(&xdr, data)) {
+ while (!(*filter)(&xdr, data, 0)) {
unsigned int newlen = (msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX) * 4;
if (newlen > VIR_NET_MESSAGE_MAX) {
@@ -402,7 +402,7 @@ int virNetMessageDecodePayload(virNetMessagePtr msg,
xdrmem_create(&xdr, msg->buffer + msg->bufferOffset,
msg->bufferLength - msg->bufferOffset, XDR_DECODE);
- if (!(*filter)(&xdr, data)) {
+ if (!(*filter)(&xdr, data, 0)) {
virReportError(VIR_ERR_RPC, "%s", _("Unable to decode message payload"));
goto error;
}
--
1.8.1.5
11 years
[libvirt] [RFC PATCHv2 0/2] gluster pools
by Eric Blake
This addresses the review from RFCv1 for splitting the glfs checks
to be different from the storage backend checks:
https://www.redhat.com/archives/libvir-list/2013-October/msg00645.html
I'm still just in RFC stage; wanting to make sure I have the
documentation correct for sample XML prior to actually coding
up the use of <glfs.h> from storage_backend_gluster.c.
Note that qemu's block/gluster.c documents that qemu expects
that when using glfs to bypass the file system, the image will
always be specified as:
* file=gluster[+transport]://[server[:port]]/volname/image[?socket=...]
which means that there is no way to pass a direct gluster volume
as a raw block device to qemu (it is always a file embedded within
the gluster volume); hence my choice of making a single gluster
volume act as the storage pool.
Eric Blake (2):
storage: initial support for linking with libgfapi
storage: document gluster pool
configure.ac | 21 +++++++
docs/formatstorage.html.in | 11 ++--
docs/schemas/storagepool.rng | 21 +++++++
docs/storage.html.in | 90 +++++++++++++++++++++++++++-
libvirt.spec.in | 15 +++++
m4/virt-gluster.m4 | 26 ++++++++
po/POTFILES.in | 1 +
src/Makefile.am | 9 +++
src/conf/storage_conf.c | 20 +++++--
src/conf/storage_conf.h | 3 +-
src/storage/storage_backend.c | 6 ++
src/storage/storage_backend.h | 6 +-
src/storage/storage_backend_gluster.c | 46 ++++++++++++++
src/storage/storage_backend_gluster.h | 29 +++++++++
tests/storagepoolxml2xmlin/pool-gluster.xml | 8 +++
tests/storagepoolxml2xmlout/pool-gluster.xml | 11 ++++
tests/storagepoolxml2xmltest.c | 1 +
17 files changed, 311 insertions(+), 13 deletions(-)
create mode 100644 m4/virt-gluster.m4
create mode 100644 src/storage/storage_backend_gluster.c
create mode 100644 src/storage/storage_backend_gluster.h
create mode 100644 tests/storagepoolxml2xmlin/pool-gluster.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-gluster.xml
--
1.8.3.1
11 years
[libvirt] RHBZ 1013045: Crash on xen domain startup: *** Error in `/usr/sbin/libvirtd': free(): invalid next size (fast): 0x00007f82c8003210 ***
by Jeremy Fitzhardinge
Hi all,
I posted this bug (https://bugzilla.redhat.com/show_bug.cgi?id=1013045)
to the Redhat Bugzilla a while ago, and the only response has been to
post a note to this list about the bug.
Summary below, but it looks like a pretty clear use-after-free or
something. The full details are attached to the bug report.
Thanks,
J
--
Description of problem:
When starting a Xen domain with libvirt + libxl, it crashes after
creating the domain. The domain is left in a paused state, and works
fine if manually unpaused with xl unpause. virt-manager never shows the
domain as running.
[...]
Steps to Reproduce:
1. Open virt-manager
2. Connect to localhost (xen)
3. Start a domain
Actual results:
Domain is created in a paused state, virt-manager shows errors about
losing connection to the daemon. Logs show libvirtd crashed.
Expected results:
Domain creation.
Additional info:
Sep 27 09:08:30 saboo libvirtd[24880]: *** Error in
`/usr/sbin/libvirtd': free(): invalid next size (fast):
0x00007f82c8003210 ***
Sep 27 09:08:30 saboo libvirtd[24880]: ======= Backtrace: =========
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libc.so.6(+0x365b27d0e8)[0x7f82f5a7a0e8]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(virFree+0x1a)[0x7f82f8f07d5a]
Sep 27 09:08:30 saboo libvirtd[24880]:
/usr/lib64/libvirt/connection-driver/libvirt_driver_libxl.so(+0x14b6c)[0x7f82e032bb6c]
Sep 27 09:08:30 saboo libvirtd[24880]:
/usr/lib64/libvirt/connection-driver/libvirt_driver_libxl.so(+0x154d4)[0x7f82e032c4d4]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(virDomainCreate+0xf7)[0x7f82f8fdb6b7]
Sep 27 09:08:30 saboo libvirtd[24880]:
/usr/sbin/libvirtd(+0x350c7)[0x7f82f9a1a0c7]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(virNetServerProgramDispatch+0x3ba)[0x7f82f90314aa]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(+0x3a33f822d8)[0x7f82f902c2d8]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(+0x3a33ea0c15)[0x7f82f8f4ac15]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libvirt.so.0(+0x3a33ea0691)[0x7f82f8f4a691]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libpthread.so.0(+0x365ba07c53)[0x7f82f61ccc53]
Sep 27 09:08:30 saboo libvirtd[24880]:
/lib64/libc.so.6(clone+0x6d)[0x7f82f5af2d3d]
11 years
[libvirt] [PATCH] Use a port from the migration range for NBD as well
by Ján Tomko
Instead of using a port from the remote display range.
---
src/qemu/qemu_migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index cb59620..4f35a7a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1115,7 +1115,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
goto cleanup;
if (!port &&
- ((virPortAllocatorAcquire(driver->remotePorts, &port) < 0) ||
+ ((virPortAllocatorAcquire(driver->migrationPorts, &port) < 0) ||
(qemuMonitorNBDServerStart(priv->mon, listenAddr, port) < 0))) {
qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
--
1.8.1.5
11 years
[libvirt] [PATCH] Fix race in starting transient VMs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When starting a transient VM the first thing done is to check
for duplicates. The check looks if there are any running VMs
with the matching name/uuid. It explicitly allows there to
be inactive VMs, so that a persistent VM can be temporarily
booted with a different config.
There is a race condition, however, where 2 or more clients
try to create the same transient VM. The first client will
cause a virDomainObjPtr to be added to the domain list, and
it is inactive at this stage. The second client may then
come along and see this inactive VM, and mistake it for a
persistent VM.
If the first VM fails to start its transient guest for any
reason, then it'll remove the virDomainObjPtr from the list.
The second client now has a virDomainObjPtr that it can try
to boot, which libvirt no longer has a record of. The result
can be a running QEMU process that is orphaned.
It was also, however, possible for the virDomainObjPtr to be
completely free'd which will cause libvirtd to crash in some
scenarios.
The fix is to only allow an existing inactive VM if it is
marked as persistent.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/conf/domain_conf.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 51c4e29..454fbfe 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2171,6 +2171,12 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
vm->def->name);
goto error;
}
+ if (!vm->persistent) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("domain is being started as '%s'"),
+ vm->def->name);
+ goto error;
+ }
}
virDomainObjAssignDef(vm,
--
1.8.3.1
11 years
[libvirt] [PATCH v2] xenapi: fix the coding stype in xenapi_driver.c
by Hongwei Bi
fix the if statement coding stype
Signed-off-by: Hongwei Bi <hwbi2008(a)gmail.com>
---
src/xenapi/xenapi_driver.c | 63 ++++++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 21 deletions(-)
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 4b522c0..c5b8d8f 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -437,7 +437,8 @@ xenapiConnectGetCapabilities(virConnectPtr conn)
virCapsPtr caps = ((struct _xenapiPrivate *)(conn->privateData))->caps;
if (caps) {
char *xml = virCapabilitiesFormatXML(caps);
- if (!xml) goto cleanup;
+ if (!xml)
+ goto cleanup;
return xml;
}
cleanup:
@@ -704,7 +705,8 @@ xenapiDomainLookupByName(virConnectPtr conn,
}
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(conn, VIR_ERR_NO_DOMAIN, NULL);
return NULL;
}
@@ -739,7 +741,8 @@ xenapiDomainSuspend(virDomainPtr dom)
return 0;
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -774,7 +777,8 @@ xenapiDomainResume(virDomainPtr dom)
return 0;
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -812,7 +816,8 @@ xenapiDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
return 0;
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -855,7 +860,8 @@ xenapiDomainReboot(virDomainPtr dom, unsigned int flags)
xen_vm_set_free(vms);
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -899,7 +905,8 @@ xenapiDomainDestroyFlags(virDomainPtr dom,
dom->id = -1;
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -949,7 +956,8 @@ xenapiDomainGetOSType(virDomainPtr dom)
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
cleanup:
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
return ostype;
}
/*
@@ -977,7 +985,8 @@ xenapiDomainGetMaxMemory(virDomainPtr dom)
xen_vm_set_free(vms);
return mem_static_max / 1024;
} else {
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return 0;
}
@@ -1011,7 +1020,8 @@ xenapiDomainSetMaxMemory(virDomainPtr dom, unsigned long memory)
}
xen_vm_set_free(vms);
} else {
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1057,7 +1067,8 @@ xenapiDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
xen_vm_set_free(vms);
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1145,7 +1156,8 @@ xenapiDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
return 0;
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1198,7 +1210,8 @@ xenapiDomainPinVcpu(virDomainPtr dom, unsigned int vcpu ATTRIBUTE_UNUSED,
return -1;
}
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, NULL);
return -1;
}
@@ -1319,7 +1332,8 @@ xenapiDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
xen_vm_set_free(vms);
return (int)maxvcpu;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, NULL);
return -1;
}
@@ -1360,7 +1374,8 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
/* Flags checked by virDomainDefFormat */
- if (!xen_vm_get_by_name_label(session, &vms, dom->name)) return NULL;
+ if (!xen_vm_get_by_name_label(session, &vms, dom->name))
+ return NULL;
if (vms->size != 1) {
xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
_("Domain name is not unique"));
@@ -1524,7 +1539,8 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
}
xen_vif_set_free(vif_set);
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xml = virDomainDefFormat(defPtr, flags);
virDomainDefFree(defPtr);
return xml;
@@ -1654,7 +1670,8 @@ xenapiDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
xen_vm_set_free(vms);
} else {
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1748,7 +1765,8 @@ xenapiDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
xen_vm_set_free(vms);
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1800,10 +1818,12 @@ xenapiDomainGetAutostart(virDomainPtr dom, int *autostart)
}
xen_vm_set_free(vms);
xen_string_string_map_free(result);
- if (flag == 0) return -1;
+ if (flag == 0)
+ return -1;
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1842,7 +1862,8 @@ xenapiDomainSetAutostart(virDomainPtr dom, int autostart)
xen_vm_set_free(vms);
return 0;
}
- if (vms) xen_vm_set_free(vms);
+ if (vms)
+ xen_vm_set_free(vms);
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
--
1.8.1.2
11 years
[libvirt] [PATCH 0/3] Test our PCI device handling functions
by Michal Privoznik
*** BLURB HERE ***
Michal Privoznik (3):
tests: Introduce virpcitest
virpcitest: Test virPCIDeviceDetach
virpcitest: Introduce testVirPCIDeviceReattach
.gitignore | 1 +
cfg.mk | 4 +-
tests/Makefile.am | 21 +-
tests/virpcimock.c | 872 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/virpcitest.c | 184 +++++++++++
5 files changed, 1078 insertions(+), 4 deletions(-)
create mode 100644 tests/virpcimock.c
create mode 100644 tests/virpcitest.c
--
1.8.1.5
11 years