mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemuDomainAttachHostPCIDevice: Handle hostevs with unassigned type of address
A <hostdev/> can have <address type='unassigned'/> which means libvirt manages the device detach from/reattach to the host but the device is never exposed to the guest. This means that we have to take a shortcut during hotplug, similar to the one we are taking when constructing the command line (see qemuBuildHostdevCommandLine()). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2040548 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
89f9346791
commit
f5de3af7f4
@ -1668,6 +1668,12 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
|
|||||||
qemuDomainFillDeviceIsolationGroup(vm->def, &dev);
|
qemuDomainFillDeviceIsolationGroup(vm->def, &dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED) {
|
||||||
|
/* Unassigned devices are not exposed to QEMU. Our job is done here. */
|
||||||
|
ret = 0;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (qemuDomainEnsurePCIAddress(vm, &dev) < 0)
|
if (qemuDomainEnsurePCIAddress(vm, &dev) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
releaseaddr = true;
|
releaseaddr = true;
|
||||||
@ -1692,6 +1698,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
|
|||||||
exit_monitor:
|
exit_monitor:
|
||||||
qemuDomainObjExitMonitor(driver, vm);
|
qemuDomainObjExitMonitor(driver, vm);
|
||||||
|
|
||||||
|
done:
|
||||||
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
|
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user