[libvirt] [PATCH v2 2/2] qemu: report an error if memballoon has wrong address type

Ján Tomko jtomko at redhat.com
Mon Apr 29 18:20:01 UTC 2013


qemuBuildMemballoonDevStr returns NULL if memballoon doesn't have
the right address type, but it doesn't report an error, leading to:
error: An error occurred, but the cause is unknown

Report a helpful error message instead, e.g.:
error: XML error: memballoon unsupported with address type 'usb'
---
 src/qemu/qemu_command.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d161b56..3184e5b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4175,6 +4175,9 @@ qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
             virBufferAddLit(&buf, "virtio-balloon-ccw");
             break;
         default:
+            virReportError(VIR_ERR_XML_ERROR,
+                           _("memballoon unsupported with address type '%s'"),
+                           virDomainDeviceAddressTypeToString(dev->info.type));
             goto error;
     }
 
-- 
1.8.1.5




More information about the libvir-list mailing list