mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
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 <eblake@redhat.com>
This commit is contained in:
parent
f15cad2916
commit
cdbba1c496
@ -1496,6 +1496,9 @@ qemuBuildControllerDevStr(virDomainControllerDefPtr def)
|
|||||||
/* We always get an IDE controller, whether we want it or not. */
|
/* We always get an IDE controller, whether we want it or not. */
|
||||||
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
|
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
|
||||||
default:
|
default:
|
||||||
|
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Unknown controller type: %s"),
|
||||||
|
virDomainControllerTypeToString(def->type));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,6 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(devstr = qemuBuildControllerDevStr(controller))) {
|
if (!(devstr = qemuBuildControllerDevStr(controller))) {
|
||||||
virReportOOMError();
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user