From: Ján Tomko Date: Fri, 27 Jun 2014 08:47:11 +0000 (+0200) Subject: Add OOM error reporting to a few fucntions X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c997e45408567fe51ffd746681a0eba428144ab0;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git Add OOM error reporting to a few fucntions They report errors in all other cases. --- diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index fd8ab167f..4d8967781 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -223,7 +223,7 @@ static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef, } virBufferTrim(&buf, NULL, 1); - if (virBufferError(&buf)) + if (virBufferCheckError(&buf) < 0) return NULL; virUUIDFormat(vmDef->uuid, uuidstr); diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8e0a55089..751c14309 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2686,7 +2686,7 @@ virQEMUCapsSaveCache(virQEMUCapsPtr qemuCaps, const char *filename) virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); - if (virBufferError(&buf)) + if (virBufferCheckError(&buf) < 0) goto cleanup; xml = virBufferContentAndReset(&buf);