if (qemuProcessAttach(conn, driver, vm, pid,
pidfile, monConfig, monJSON) < 0) {
- monConfig = NULL;
qemuDomainRemoveInactive(driver, vm);
qemuDomainObjEndJob(driver, vm);
goto cleanup;
}
- monConfig = NULL;
-
dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
qemuDomainObjEndJob(driver, vm);
cleanup:
virDomainDefFree(def);
- virDomainChrSourceDefFree(monConfig);
+ virObjectUnref(monConfig);
virDomainObjEndAPI(&vm);
VIR_FREE(pidfile);
virObjectUnref(caps);
goto error;
VIR_DEBUG("Preparing monitor state");
- priv->monConfig = monConfig;
- monConfig = NULL;
+ priv->monConfig = virObjectRef(monConfig);
priv->monJSON = monJSON;
/* Attaching to running QEMU so we need to detect whether it was started
VIR_FREE(sec_managers);
if (seclabelgen)
virSecurityLabelDefFree(seclabeldef);
- virDomainChrSourceDefFree(monConfig);
+ virObjectUnref(priv->monConfig);
+ priv->monConfig = NULL;
virObjectUnref(cfg);
virObjectUnref(caps);
return -1;