diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4ff3281214..0d0bea2103 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1318,8 +1318,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml, -1, NULL, NULL, VIR_VM_OP_CREATE) < 0) { virDomainAuditStart(vm, "booted", false); if (qemuDomainObjEndJob(driver, vm) > 0) - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; goto cleanup; } @@ -1658,8 +1657,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, if (!vm->persistent) { if (qemuDomainObjEndJob(driver, vm) > 0) - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } ret = 0; @@ -2529,8 +2527,7 @@ qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom, VIR_DOMAIN_EVENT_STOPPED_SAVED); if (!vm->persistent) { if (qemuDomainObjEndAsyncJob(driver, vm) > 0) - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -2947,8 +2944,7 @@ endjob: if (qemuDomainObjEndAsyncJob(driver, vm) == 0) vm = NULL; else if ((ret == 0) && (flags & VIR_DUMP_CRASH) && !vm->persistent) { - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -4151,7 +4147,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, if (qemuDomainObjEndJob(driver, vm) == 0) vm = NULL; else if (ret < 0 && !vm->persistent) { - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -4830,8 +4826,7 @@ static virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) { if (virDomainSaveConfig(driver->configDir, vm->newDef ? vm->newDef : vm->def) < 0) { VIR_INFO("Defining domain '%s'", vm->def->name); - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; goto cleanup; } @@ -4936,8 +4931,7 @@ qemuDomainUndefineFlags(virDomainPtr dom, if (virDomainObjIsActive(vm)) { vm->persistent = 0; } else { - virDomainRemoveInactive(&driver->domains, - vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -8243,7 +8237,7 @@ qemuDomainMigrateConfirm3(virDomainPtr domain, (!vm->persistent || (flags & VIR_MIGRATE_UNDEFINE_SOURCE))) { if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) virDomainDeleteConfig(driver->configDir, driver->autostartDir, vm); - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -9774,7 +9768,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) { if (!vm->persistent) { if (qemuDomainObjEndJob(driver, vm) > 0) - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; goto cleanup; } @@ -9797,7 +9791,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, if (rc < 0) { if (!vm->persistent) { if (qemuDomainObjEndJob(driver, vm) > 0) - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; goto cleanup; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d9f8d9308b..4fd2e9f68f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1127,7 +1127,7 @@ endjob: if (qemuMigrationJobFinish(driver, vm) == 0) { vm = NULL; } else if (!vm->persistent) { - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } goto cleanup; @@ -2272,7 +2272,7 @@ endjob: (ret == 0 && (flags & VIR_MIGRATE_UNDEFINE_SOURCE)))) { if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) virDomainDeleteConfig(driver->configDir, driver->autostartDir, vm); - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -2351,7 +2351,7 @@ endjob: if (refs == 0) { vm = NULL; } else if (!virDomainObjIsActive(vm) && !vm->persistent) { - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } @@ -2615,7 +2615,7 @@ endjob: if (qemuMigrationJobFinish(driver, vm) == 0) { vm = NULL; } else if (!vm->persistent && !virDomainObjIsActive(vm)) { - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); vm = NULL; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b92bc6fac5..c8f22e2d8a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -150,7 +150,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainAuditStop(vm, auditReason); if (!vm->persistent) - virDomainRemoveInactive(&driver->domains, vm); + qemuDomainRemoveInactive(driver, vm); else virDomainObjUnlock(vm); @@ -2671,11 +2671,12 @@ error: if (virDomainObjUnref(obj) > 0) { /* We can't get the monitor back, so must kill the VM - * to remove danger of it ending up running twice if - * user tries to start it again later */ + * to remove danger of it ending up running twice if + * user tries to start it again later + */ qemuProcessStop(driver, obj, 0, VIR_DOMAIN_SHUTOFF_FAILED); if (!obj->persistent) - virDomainRemoveInactive(&driver->domains, obj); + qemuDomainRemoveInactive(driver, obj); else virDomainObjUnlock(obj); } @@ -2753,7 +2754,7 @@ qemuProcessReconnectHelper(void *payload, * Kill qemu */ qemuProcessStop(src->driver, obj, 0, VIR_DOMAIN_SHUTOFF_FAILED); if (!obj->persistent) - virDomainRemoveInactive(&src->driver->domains, obj); + qemuDomainRemoveInactive(src->driver, obj); else virDomainObjUnlock(obj); } @@ -3700,7 +3701,7 @@ static void qemuProcessAutoDestroyDom(void *payload, if (qemuDomainObjEndJob(data->driver, dom) == 0) dom = NULL; if (dom && !dom->persistent) - virDomainRemoveInactive(&data->driver->domains, dom); + qemuDomainRemoveInactive(data->driver, dom); cleanup: if (dom)