[libvirt] [PATCH] nwfilter: reorder locks
by Stefan Berger
This patch reorders the locks for the nwfilter updates and the access
the nwfilter objects. In the case that the IP address learning thread
was instantiating filters while an update happened, the previous order
lead to a deadlock.
I am also adding a text file describing the locking order of the
nwfilter subsystem.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/conf/nwfilter_conf.c | 9 ++++----
src/nwfilter/locking.txt | 45
+++++++++++++++++++++++++++++++++++++++++
src/nwfilter/nwfilter_driver.c | 4 +++
3 files changed, 54 insertions(+), 4 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -2440,15 +2440,13 @@ virNWFilterTestUnassignDef(virConnectPtr
{
int rc = 0;
- virNWFilterLockFilterUpdates();
-
nwfilter->wantRemoved = 1;
/* trigger the update on VMs referencing the filter */
if (virNWFilterTriggerVMFilterRebuild(conn))
rc = 1;
nwfilter->wantRemoved = 0;
- virNWFilterUnlockFilterUpdates();
+
return rc;
}
@@ -2480,8 +2478,9 @@ virNWFilterObjAssignDef(virConnectPtr co
return NULL;
}
+ virNWFilterLockFilterUpdates();
+
if ((nwfilter = virNWFilterObjFindByName(nwfilters, def->name))) {
- virNWFilterLockFilterUpdates();
nwfilter->newDef = def;
/* trigger the update on VMs referencing the filter */
if (virNWFilterTriggerVMFilterRebuild(conn)) {
@@ -2498,6 +2497,8 @@ virNWFilterObjAssignDef(virConnectPtr co
return nwfilter;
}
+ virNWFilterUnlockFilterUpdates();
+
if (VIR_ALLOC(nwfilter) < 0) {
virReportOOMError();
return NULL;
Index: libvirt-acl/src/nwfilter/nwfilter_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_driver.c
@@ -372,6 +372,8 @@ nwfilterUndefine(virNWFilterPtr obj) {
nwfilterDriverLock(driver);
virNWFilterCallbackDriversLock();
+ virNWFilterLockFilterUpdates();
+
nwfilter = virNWFilterObjFindByUUID(&driver->nwfilters, obj->uuid);
if (!nwfilter) {
virNWFilterReportError(VIR_ERR_NO_NWFILTER,
@@ -399,6 +401,8 @@ cleanup:
if (nwfilter)
virNWFilterObjUnlock(nwfilter);
+ virNWFilterUnlockFilterUpdates();
+
virNWFilterCallbackDriversUnlock();
nwfilterDriverUnlock(driver);
return ret;
Index: libvirt-acl/src/nwfilter/locking.txt
===================================================================
--- /dev/null
+++ libvirt-acl/src/nwfilter/locking.txt
@@ -0,0 +1,45 @@
+NWfilter locks:
+---------------
+
+The following NWFilter functions grab locks:
+
+- nwfilterDriverLock(driverState)
+ - protects driverState
+- virNWFilterCallbackDriversLock()
+ - lock access to callback drivers
+- virNWFilterLockFilterUpdates()
+ - prevent modification of any filter in use by any VM
+- virNWFilterObjLock()
+ called by
+ - virNWFilterObjFindByUUID(),
+ - virNWFilterObjFindByName(),
+ - virNWFilterObjAssignDef()
+ and the functions return with the lock held
+
+
+NWFilter-Lock ordering:
+-----------------------
+
+Order in which the NWFilter lock functions have to be called:
+
+1. nwFilterDriverLock
+2. virNWFilterCallbackDriversLock
+3. virNWFilterLockFilterUpdates
+4. virNWFilterObjLock
+
+Other locks:
+------------
+
+Other relevant locks to consider are related to hypervisor drivers. The
+following locking orders are good with the qemu_driver as an example:
+
+qemu_driver - qemu_domain - filter object
+qemu_driver - filter object - qemu_domain
+
+The qemu_driver serves as a general lock for all subsequent locks to a
+qemu_domain. This works because the qemu_driver will always be locked
+for a qemu_domain, thus only one lock-sequence of either (qemu_domain,
+filter object) or (filter object, qemu_domain) can be active at any time.
+
+Reference:
+https://www.redhat.com/archives/libvir-list/2010-October/msg00152.html
13 years, 7 months
[libvirt] [PATCH] interface: reformat error logs
by Laine Stump
It was suggested during review of a different patch that the libvirt
interface driver API's should have "netcf:" in their log
messages. This patch eliminates that from all interface driver API
functions, and also eliminates the extra " - " in the case that netcf
returns no details in its error info (which *never* happens at
present, but could happen sometime in the future.
---
src/interface/netcf_driver.c | 79 +++++++++++++++++++++++++-----------------
1 files changed, 47 insertions(+), 32 deletions(-)
diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c
index b5b4f79..dd15c9d 100644
--- a/src/interface/netcf_driver.c
+++ b/src/interface/netcf_driver.c
@@ -107,8 +107,9 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struct netcf *ncf, virInterfac
int errcode = ncf_error(ncf, &errmsg, &details);
if (errcode != NETCF_NOERROR) {
interfaceReportError(netcf_to_vir_err(errcode),
- _("couldn't find interface named '%s' (netcf: %s - %s)"),
- ifinfo->name, errmsg, details ? details : "");
+ _("couldn't find interface named '%s': %s%s%s"),
+ ifinfo->name, errmsg, details ? " - " : "",
+ details ? details : "");
} else {
interfaceReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"),
@@ -188,8 +189,8 @@ static int interfaceNumOfInterfaces(virConnectPtr conn)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to get number of interfaces on host (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("failed to get number of interfaces on host: %s%s%s"),
+ errmsg, details ? " - " : "", details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -208,8 +209,9 @@ static int interfaceListInterfaces(virConnectPtr conn, char **const names, int n
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to list host interfaces (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("failed to list host interfaces: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -228,8 +230,9 @@ static int interfaceNumOfDefinedInterfaces(virConnectPtr conn)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to get number of defined interfaces on host (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("failed to get number of defined interfaces on host: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -248,8 +251,9 @@ static int interfaceListDefinedInterfaces(virConnectPtr conn, char **const names
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to list host defined interfaces (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("failed to list host defined interfaces: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -271,8 +275,9 @@ static virInterfacePtr interfaceLookupByName(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details);
if (errcode != NETCF_NOERROR) {
interfaceReportError(netcf_to_vir_err(errcode),
- _("couldn't find interface named '%s' (netcf: %s - %s)"),
- name, errmsg, details ? details : "");
+ _("couldn't find interface named '%s': %s%s%s"),
+ name, errmsg,
+ details ? " - " : "", details ? details : "");
} else {
interfaceReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), name);
@@ -303,8 +308,9 @@ static virInterfacePtr interfaceLookupByMACString(virConnectPtr conn,
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("couldn't find interface with MAC address '%s' (netcf: %s - %s)"),
- macstr, errmsg, details ? details : "");
+ _("couldn't find interface with MAC address '%s': %s%s%s"),
+ macstr, errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
if (niface == 0) {
@@ -353,8 +359,9 @@ static char *interfaceGetXMLDesc(virInterfacePtr ifinfo,
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("could not get interface XML description (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("could not get interface XML description: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -407,8 +414,9 @@ static virInterfacePtr interfaceDefineXML(virConnectPtr conn,
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("could not get interface XML description (netcf: %s - %s)"),
- errmsg, details ? details : "");
+ _("could not get interface XML description: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -440,8 +448,9 @@ static int interfaceUndefine(virInterfacePtr ifinfo) {
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to undefine interface %s (netcf: %s - %s)"),
- ifinfo->name, errmsg, details ? details : "");
+ _("failed to undefine interface %s: %s%s%s"),
+ ifinfo->name, errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -471,8 +480,9 @@ static int interfaceCreate(virInterfacePtr ifinfo,
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to create (start) interface %s (netcf: %s - %s)"),
- ifinfo->name, errmsg, details ? details : "");
+ _("failed to create (start) interface %s: %s%s%s"),
+ ifinfo->name, errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -502,8 +512,9 @@ static int interfaceDestroy(virInterfacePtr ifinfo,
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to destroy (stop) interface %s (netcf: %s - %s)"),
- ifinfo->name, errmsg, details ? details : "");
+ _("failed to destroy (stop) interface %s: %s%s%s"),
+ ifinfo->name, errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -532,8 +543,9 @@ static int interfaceIsActive(virInterfacePtr ifinfo)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to get status of interface %s (netcf: %s - %s)"),
- ifinfo->name, errmsg, details ? details : "");
+ _("failed to get status of interface %s: %s%s%s"),
+ ifinfo->name, errmsg, details ? " - " : "",
+ details ? details : "");
goto cleanup;
}
@@ -560,8 +572,9 @@ static int interfaceChangeBegin(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to begin transaction: %s%s%s)"),
- errmsg, details ? " - " : "", details ? details : "");
+ _("failed to begin transaction: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -582,8 +595,9 @@ static int interfaceChangeCommit(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to commit transaction: %s%s%s)"),
- errmsg, details ? " - " : "", details ? details : "");
+ _("failed to commit transaction: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
@@ -604,8 +618,9 @@ static int interfaceChangeRollback(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details);
interfaceReportError(netcf_to_vir_err(errcode),
- _("failed to rollback transaction: %s%s%s)"),
- errmsg, details ? " - " : "", details ? details : "");
+ _("failed to rollback transaction: %s%s%s"),
+ errmsg, details ? " - " : "",
+ details ? details : "");
}
interfaceDriverUnlock(driver);
--
1.7.3.4
13 years, 7 months
Re: [libvirt] [Qemu-devel] [RFC] live snapshot, live merge, live block migration
by Dor Laor
On 05/20/2011 03:19 PM, Stefan Hajnoczi wrote:
> I'm interested in what the API for snapshots would look like.
> Specifically how does user software do the following:
> 1. Create a snapshot
> 2. Delete a snapshot
> 3. List snapshots
> 4. Access data from a snapshot
There are plenty of options there:
- Run a (unrelated) VM and hotplug the snapshot as additional disk
- Use v2v (libguestfs)
- Boot the VM w/ RO
- Plenty more
> 5. Restore a VM from a snapshot
> 6. Get the dirty blocks list (for incremental backup)
It might be needed for additional proposes like efficient delta sync
across sites or any other storage operation (dedup, etc)
>
> We've discussed image format-level approaches but I think the scope of
> the API should cover several levels at which snapshots are
> implemented:
> 1. Image format - image file snapshot (Jes, Jagane)
> 2. Host file system - ext4 and btrfs snapshots
> 3. Storage system - LVM or SAN volume snapshots
>
> It will be hard to take advantage of more efficient host file system
> or storage system snapshots if they are not designed in now.
I agree but it can also be a chicken and the egg problem.
Actually 1/2/3/5 are already working today regardless of live snapshots.
> Is anyone familiar enough with the libvirt storage APIs to draft an
> extension that adds snapshot support? I will take a stab at it if no
> one else want to try it.
I added libvirt-list and Ayal Baron from vdsm.
What you're asking is even beyond snapshots, it's the whole management
of VM images. Doing the above operations is simple but for enterprise
virtualization solution you'll need to lock the NFS/SAN images, handle
failures of VM/SAN/Mgmt, keep the snapshots info in mgmt DB, etc.
Today it is managed by a combination of rhev-m/vdsm and libvirt.
I agree it would have been nice to get such common single entry point
interface.
>
> Stefan
13 years, 7 months
[libvirt] [PATCH] Add domainCoreDump to libxl driver
by Markus Groß
For core dumping to work correctly the following patch
for xen is needed:
http://lists.xensource.com/archives/html/xen-devel/2011-05/msg01469.html
This patch is in xen-unstable and is considered for backport to
the xen stable branches. Without this patch the mapped
memory pages of the pv guest are not unmapped after core-dump.
---
src/libxl/libxl_driver.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index b2cc0e8..75008db 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1627,6 +1627,92 @@ libxlDomainGetState(virDomainPtr dom,
}
static int
+libxlDomainCoreDump(virDomainPtr dom, const char *to, int flags)
+{
+ libxlDriverPrivatePtr driver = dom->conn->privateData;
+ libxlDomainObjPrivatePtr priv;
+ virDomainObjPtr vm;
+ virDomainEventPtr event = NULL;
+ int paused = 0;
+ int ret = -1;
+
+ virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH, -1);
+
+ libxlDriverLock(driver);
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(dom->uuid, uuidstr);
+ libxlError(VIR_ERR_NO_DOMAIN,
+ _("No domain with matching uuid '%s'"), uuidstr);
+ goto cleanup;
+ }
+
+ if (!virDomainObjIsActive(vm)) {
+ libxlError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
+ goto cleanup;
+ }
+
+ priv = vm->privateData;
+
+ if (!(flags & VIR_DUMP_LIVE) &&
+ virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
+ if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+ libxlError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to suspend domain '%d' with libxenlight"),
+ dom->id);
+ goto cleanup;
+ }
+ virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_DUMP);
+ paused = 1;
+ }
+
+ if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
+ libxlError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to dump core of domain '%d' with libxenlight"),
+ dom->id);
+ goto cleanup;
+ }
+
+ if (flags & VIR_DUMP_CRASH) {
+ if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
+ libxlError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to destroy domain '%d'"), dom->id);
+ goto cleanup;
+ }
+
+ event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
+ VIR_DOMAIN_EVENT_STOPPED_CRASHED);
+
+ } else if (paused) {
+ if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+ libxlError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to resume domain '%d' with libxenlight"),
+ dom->id);
+ goto cleanup;
+ }
+ virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
+ VIR_DOMAIN_RUNNING_UNPAUSED);
+ }
+
+ if ((flags & VIR_DUMP_CRASH) && !vm->persistent) {
+ virDomainRemoveInactive(&driver->domains, vm);
+ vm = NULL;
+ }
+
+ ret = 0;
+
+cleanup:
+ if (vm)
+ virDomainObjUnlock(vm);
+ if (event)
+ libxlDomainEventQueue(driver, event);
+ libxlDriverUnlock(driver);
+ return ret;
+}
+
+static int
libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
unsigned int flags)
{
@@ -2722,6 +2808,7 @@ static virDriver libxlDriver = {
.domainSetMemoryFlags = libxlDomainSetMemoryFlags, /* 0.9.0 */
.domainGetInfo = libxlDomainGetInfo, /* 0.9.0 */
.domainGetState = libxlDomainGetState, /* 0.9.2 */
+ .domainCoreDump = libxlDomainCoreDump, /* 0.9.2 */
.domainSetVcpus = libxlDomainSetVcpus, /* 0.9.0 */
.domainSetVcpusFlags = libxlDomainSetVcpusFlags, /* 0.9.0 */
.domainGetVcpusFlags = libxlDomainGetVcpusFlags, /* 0.9.0 */
--
1.7.5.1
13 years, 7 months
[libvirt] [PATCH] OpenVZ driver: fix openvzGetVPSUUID()
by Jean-Baptiste Rouault
openvzGetUUID did not work since openvz_readline()
was replaced by getline()
---
src/openvz/openvz_conf.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 2cccd81..7b939b2 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -863,7 +863,6 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
char *conf_file;
char *line = NULL;
size_t line_size = 0;
- ssize_t ret;
char *saveptr = NULL;
char *uuidbuf;
char *iden;
@@ -877,16 +876,8 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
if (fp == NULL)
goto cleanup;
- while (1) {
- ret = getline(&line, &line_size, fp);
- if (ret == -1)
- goto cleanup;
-
- if (ret == 0) { /* EoF, UUID was not found */
- uuidstr[0] = 0;
- break;
- }
-
+ uuidstr[0] = 0;
+ while (getline(&line, &line_size, fp) >= 0) {
iden = strtok_r(line, " ", &saveptr);
uuidbuf = strtok_r(NULL, "\n", &saveptr);
--
1.7.1
13 years, 7 months
[libvirt] [PATCH 0/6] Add virNodeGetMemoryStats() API
by Minoru Usui
Hi, everyone.
I wrote new API called virNodeGetMemoryStats().
It returns total/free/buffer/cached memory of the node from /proc/meminfo.
The user I/F is like virNodeGetCPUStats().
Previous discussion is here.
(See about virNodeGetFreeMemory() part.)
http://www.mail-archive.com/libvir-list@redhat.com/msg32553.html
This patch series based on latest git tree.
If my virNodeGetCPUStats() patch series applied, I'll rebase on it.
Minoru Usui (6):
virNodeGetMemoryStats: Expose new API
virNodeGetMemoryStats: Define internal driver API
virNodeGetMemoryStats: Implement public API
virNodeGetMemoryStats: Implement remote protocol
virNodeGetMemoryStats: Implement virsh support
virNodeGetMemoryStats: Implement linux support
daemon/remote.c | 76 +++++++++++++++++++++++++++++++++
include/libvirt/libvirt.h.in | 65 +++++++++++++++++++++++++++-
src/driver.h | 8 +++
src/libvirt.c | 81 +++++++++++++++++++++++++++++++++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 1 +
src/lxc/lxc_driver.c | 1 +
src/nodeinfo.c | 97 ++++++++++++++++++++++++++++++++++++++++++
src/nodeinfo.h | 4 ++
src/qemu/qemu_driver.c | 1 +
src/remote/remote_driver.c | 63 +++++++++++++++++++++++++++
src/remote/remote_protocol.x | 21 +++++++++-
src/uml/uml_driver.c | 1 +
tools/virsh.c | 51 ++++++++++++++++++++++
tools/virsh.pod | 4 ++
15 files changed, 473 insertions(+), 2 deletions(-)
--
Minoru Usui <usui(a)mxm.nes.nec.co.jp>
13 years, 7 months
[libvirt] [PATCH] sexpr: Improve serialization error reporting
by Matthias Bolte
---
src/util/sexpr.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/util/sexpr.c b/src/util/sexpr.c
index d8d4c2d..0e30087 100644
--- a/src/util/sexpr.c
+++ b/src/util/sexpr.c
@@ -215,7 +215,7 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
virBufferAddChar(buffer, '(');
if (sexpr2string(sexpr->u.s.car, buffer) < 0)
- goto error;
+ return -1;
while (sexpr->u.s.cdr->kind != SEXPR_NIL) {
sexpr = sexpr->u.s.cdr;
@@ -223,7 +223,7 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
virBufferAddChar(buffer, ' ');
if (sexpr2string(sexpr->u.s.car, buffer) < 0)
- goto error;
+ return -1;
}
virBufferAddChar(buffer, ')');
@@ -241,14 +241,12 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
virBufferAddLit(buffer, "()");
break;
default:
- goto error;
+ virSexprError(VIR_ERR_SEXPR_SERIAL,
+ _("unknown s-expression kind %d"), sexpr->kind);
+ return -1;
}
return 0;
-
- error:
- virSexprError(VIR_ERR_SEXPR_SERIAL, NULL);
- return -1;
}
#define IS_SPACE(c) ((c == 0x20) || (c == 0x9) || (c == 0xD) || (c == 0xA))
--
1.7.0.4
13 years, 7 months
[libvirt] [PATCH] Ensure hvsupport.html.in is built before HTML validation
by Daniel P. Berrange
In a parallel make, HTML validation tries to run before
hvsupport.html.in has been built.
* docs/Makefile.am: List hvsupport.html.in as a built source
---
docs/Makefile.am | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 59ae685..2b6ccf7 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -8,6 +8,8 @@ DOC_SOURCE_DIR=../src
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
+BUILT_SOURCES=hvsupport.html.in
+
apihtml = \
html/index.html \
html/libvirt-libvirt.html \
--
1.7.4.4
13 years, 7 months