mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu_hotplug: Properly check for qemuMonitorDelDevice retval
Luckily, the function returns only 0 or -1 so all the checks work as expected. Anyway, our rule is that a positive value means success so if the function ever returns a positive value these checks will fail. Make them check for a negative value properly. At the same time fix qemuDomainDetachExtensionDevice() reval check. It is somewhat related to the aim of this patch. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1dd24167b8
commit
8b71b0c727
@ -5457,11 +5457,11 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
if (detach->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
|
||||
qemuDomainDetachExtensionDevice(priv->mon, &detach->info)) {
|
||||
qemuDomainDetachExtensionDevice(priv->mon, &detach->info) < 0) {
|
||||
goto exit_monitor;
|
||||
}
|
||||
|
||||
if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
|
||||
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -6975,7 +6975,7 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
|
||||
qemuDomainMarkDeviceForRemoval(vm, &input->info);
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
if (qemuMonitorDelDevice(priv->mon, input->info.alias)) {
|
||||
if (qemuMonitorDelDevice(priv->mon, input->info.alias) < 0) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -7018,7 +7018,7 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
|
||||
qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
if (qemuMonitorDelDevice(priv->mon, vsock->info.alias)) {
|
||||
if (qemuMonitorDelDevice(priv->mon, vsock->info.alias) < 0) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user