mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 17:17:56 +03:00
qemu: Remove redundant DomainObjIsActive calls
The common idiom in the driver API implementations is roughly: - ACL check - BeginJob (if needed) - AgentAvailable (if needed) - !IsActive A few calls had an extra !IsActive before BeginJob, which doesn't seem to serve much use. Drop them
This commit is contained in:
parent
27f2b74782
commit
b0a2ba2462
@ -1884,12 +1884,6 @@ static int qemuDomainSuspend(virDomainPtr dom)
|
||||
if (virDomainSuspendEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
priv = vm->privateData;
|
||||
|
||||
@ -2566,12 +2560,6 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
|
||||
if (virDomainInjectNMIEnsureACL(domain->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
@ -15903,12 +15891,6 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
|
||||
if (virDomainQemuMonitorCommandEnsureACL(domain->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -18512,12 +18494,6 @@ qemuDomainFSTrim(virDomainPtr dom,
|
||||
if (virDomainFSTrimEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user