]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Report more accurate error on failure to attach device.
authorHu Tao <hutao@cn.fujitsu.com>
Thu, 27 Jan 2011 07:21:42 +0000 (15:21 +0800)
committerEric Blake <eblake@redhat.com>
Fri, 28 Jan 2011 03:27:05 +0000 (20:27 -0700)
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 <eblake@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c

index a28598f31049c15fd07240dbf8e4159f5c18ad0d..1ce894107fc91afb10f2c7e510537ef34962014f 100644 (file)
@@ -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;
     }
 
index 8be993bd13c6123cc039ab666cdeeb47fecb80fe..ca81a3d0f5fa2b19c45470f4feb46d882eb43efd 100644 (file)
@@ -260,7 +260,6 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
             goto cleanup;
 
         if (!(devstr = qemuBuildControllerDevStr(controller))) {
-            virReportOOMError();
             goto cleanup;
         }
     }