From: Hu Tao Date: Thu, 27 Jan 2011 07:21:42 +0000 (+0800) Subject: qemu: Report more accurate error on failure to attach device. X-Git-Tag: v0.8.8~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdbba1c4960a22b5f8c034dd9257bec2d5fa38d6;p=thirdparty%2Flibvirt.git qemu: Report more accurate error on failure to attach device. When attaching device from a xml file and the device is mis-configured, virsh gives mis-leading message "out of memory". This patch fixes this. Signed-off-by: Eric Blake --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a28598f310..1ce894107f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1496,6 +1496,9 @@ qemuBuildControllerDevStr(virDomainControllerDefPtr def) /* We always get an IDE controller, whether we want it or not. */ case VIR_DOMAIN_CONTROLLER_TYPE_IDE: default: + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown controller type: %s"), + virDomainControllerTypeToString(def->type)); goto error; } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8be993bd13..ca81a3d0f5 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -260,7 +260,6 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, goto cleanup; if (!(devstr = qemuBuildControllerDevStr(controller))) { - virReportOOMError(); goto cleanup; } }