mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
qemu_hotplug: remove qemuDomainAttachDeviceControllerLive
This function calls qemuDomainAttachControllerDevice for SCSI controllers and reports an error for all other controllers. Move the error inside qemuDomainAttachControllerDevice and delete this wrapper.
This commit is contained in:
parent
bec787ee9d
commit
aaa42d905a
@ -7712,27 +7712,6 @@ qemuDomainUndefine(virDomainPtr dom)
|
||||
return qemuDomainUndefineFlags(dom, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainAttachDeviceControllerLive(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainDeviceDefPtr dev)
|
||||
{
|
||||
virDomainControllerDefPtr cont = dev->data.controller;
|
||||
int ret = -1;
|
||||
|
||||
switch (cont->type) {
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
|
||||
ret = qemuDomainAttachControllerDevice(driver, vm, cont);
|
||||
break;
|
||||
default:
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("'%s' controller cannot be hot plugged."),
|
||||
virDomainControllerTypeToString(cont->type));
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
||||
virDomainDeviceDefPtr dev,
|
||||
@ -7753,7 +7732,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_CONTROLLER:
|
||||
ret = qemuDomainAttachDeviceControllerLive(driver, vm, dev);
|
||||
ret = qemuDomainAttachControllerDevice(driver, vm, dev->data.controller);
|
||||
if (!ret) {
|
||||
alias = dev->data.controller->info.alias;
|
||||
dev->data.controller = NULL;
|
||||
|
@ -444,6 +444,13 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
|
||||
bool releaseaddr = false;
|
||||
bool addedToAddrSet = false;
|
||||
|
||||
if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("'%s' controller cannot be hot plugged."),
|
||||
virDomainControllerTypeToString(controller->type));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virDomainControllerFind(vm->def, controller->type, controller->idx) >= 0) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("target %s:%d already exists"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user