提交 311f4069 编写于 作者: J Ján Tomko

qemu: remove pointless address validation on hot unplug

Back in the times of using 'pci_del', unplugging a device without
a PCI address was not wired up.

After completely removing support for qemu without QEMU_CAPS_DEVICE,
aliases are used to uniquely identify devices in all cases.

Remove the pointless validation of data that was already present
in the domain definition.
上级 8a0d84e2
...@@ -4634,23 +4634,6 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, ...@@ -4634,23 +4634,6 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
} }
if (qemuDomainIsS390CCW(vm->def) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a valid CCW address"));
goto cleanup;
}
} else {
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a valid PCI address"));
goto cleanup;
}
}
if (!detach->info.alias) { if (!detach->info.alias) {
if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0) if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0)
goto cleanup; goto cleanup;
...@@ -4908,13 +4891,6 @@ qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver, ...@@ -4908,13 +4891,6 @@ qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
return -1; return -1;
} }
if (!virDomainDeviceAddressIsValid(detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
return -1;
}
qemuDomainMarkDeviceForRemoval(vm, detach->info); qemuDomainMarkDeviceForRemoval(vm, detach->info);
qemuDomainObjEnterMonitor(driver, vm); qemuDomainObjEnterMonitor(driver, vm);
...@@ -5240,28 +5216,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, ...@@ -5240,28 +5216,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virDomainNetGetActualHostdev(detach)); virDomainNetGetActualHostdev(detach));
goto cleanup; goto cleanup;
} }
if (qemuDomainIsS390CCW(vm->def) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a CCW address"));
goto cleanup;
}
} else {
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
goto cleanup;
}
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) { if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device :%s"), _("cannot hot unplug multifunction PCI device :%s"),
dev->data.disk->dst); dev->data.disk->dst);
goto cleanup; goto cleanup;
}
} }
if (!detach->info.alias) { if (!detach->info.alias) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册