mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu_driver: check invalid iothread_id before we do anything else
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
a4a1ad2066
commit
caf66e0196
@ -5754,12 +5754,6 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr persistentDef;
|
||||
int ret = -1;
|
||||
|
||||
if (iothread_id == 0) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("invalid value of 0 for iothread_id"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
priv = vm->privateData;
|
||||
@ -5835,6 +5829,12 @@ qemuDomainAddIOThread(virDomainPtr dom,
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
if (iothread_id == 0) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("invalid value of 0 for iothread_id"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
@ -5862,6 +5862,12 @@ qemuDomainDelIOThread(virDomainPtr dom,
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
if (iothread_id == 0) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("invalid value of 0 for iothread_id"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user