From cdbba1c4960a22b5f8c034dd9257bec2d5fa38d6 Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Thu, 27 Jan 2011 15:21:42 +0800 Subject: [PATCH] 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 --- src/qemu/qemu_command.c | 3 +++ src/qemu/qemu_hotplug.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) 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; } }