]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: report an error if memballoon has wrong address type
authorJán Tomko <jtomko@redhat.com>
Mon, 29 Apr 2013 18:01:19 +0000 (20:01 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 30 Apr 2013 08:23:44 +0000 (10:23 +0200)
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

index d161b5672ca2b5d94937b3f4b1e4227a11824eb0..3184e5b9c3289227da9df527b4b5f1c4c92717be 100644 (file)
@@ -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;
     }