mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemuDomainRemoveChrDevice: Detach fdset after chardev hot-unplug
Our code uses fdsets for the pipe passed from virtlogd to qemu, but the chardev hot-unplug code neglected to detach the fdset after the chardev was removed. This kept the FDs open by qemu even after they were not used any more. After the refactor to use qemuFDPass for chardevs we now configure the 'opaque' field for fdsets used for chardevs so we can use qemuHotplugRemoveFDSet to remove the unused fdset. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6d161bcc60
commit
22d5ce0252
@ -4881,6 +4881,7 @@ qemuDomainRemoveChrDevice(virQEMUDriver *driver,
|
||||
if (monitor) {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
|
||||
qemuHotplugRemoveFDSet(priv->mon, chr->info.alias, NULL);
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
}
|
||||
|
||||
|
@ -708,7 +708,7 @@ mymain(void)
|
||||
|
||||
DO_TEST_DETACH("console-compat-2-live", "console-virtio", false, false,
|
||||
"device_del", QMP_DEVICE_DELETED("console1") QMP_OK,
|
||||
"chardev-remove", QMP_OK);
|
||||
"chardev-remove", QMP_OK, "query-fdsets", "{\"return\": []}");
|
||||
|
||||
DO_TEST_ATTACH("base-live", "disk-virtio", false, true,
|
||||
"human-monitor-command", HMP("OK\\r\\n"),
|
||||
@ -768,7 +768,7 @@ mymain(void)
|
||||
"device_add", QMP_OK);
|
||||
DO_TEST_DETACH("base-live", "qemu-agent-detach", false, false,
|
||||
"device_del", QMP_DEVICE_DELETED("channel0") QMP_OK,
|
||||
"chardev-remove", QMP_OK);
|
||||
"chardev-remove", QMP_OK, "query-fdsets", "{\"return\": []}");
|
||||
|
||||
DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true,
|
||||
"human-monitor-command", HMP("OK\\r\\n"),
|
||||
|
Loading…
Reference in New Issue
Block a user