/*
- * Copyright (C) 2010-2013 Red Hat, Inc.
+ * Copyright (C) 2010-2014 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* lxc_process.c: LXC process lifecycle management
VIR_DEBUG("Faking reboot");
if (conn) {
- virConnectRef(conn);
+ virObjectRef(conn);
autodestroy = true;
} else {
conn = virConnectOpen("lxc:///");
goto cleanup;
}
- if (conn)
- virConnectClose(conn);
-
ret = 0;
cleanup:
+ virObjectUnref(conn);
return ret;
}
virLXCProcessAutostartDomain,
&data);
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
}
static int
virDomainObjListForEach(driver->domains, qemuAutostartDomain, &data);
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
virObjectUnref(cfg);
}
if (!qemu_driver->workerPool)
goto error;
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
virNWFilterRegisterCallbackDriver(&qemuCallbackDriver);
return 0;
error:
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
VIR_FREE(driverConf);
VIR_FREE(membase);
VIR_FREE(mempath);
virDomainFree(domains[i]);
VIR_FREE(domains);
VIR_FREE(flags);
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
virObjectUnref(cfg);
return ret;
/*
* qemu_migration.c: QEMU migration handling
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
cleanup:
orig_err = virSaveLastError();
qemuDomainObjEnterRemote(vm);
- virConnectClose(dconn);
+ virObjectUnref(dconn);
qemuDomainObjExitRemote(vm);
if (orig_err) {
virSetError(orig_err);
/*
* qemu_process.c: QEMU process management
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
if (obj && virObjectUnref(obj))
virObjectUnlock(obj);
- virConnectClose(conn);
+ virObjectUnref(conn);
virObjectUnref(cfg);
return;
virObjectUnlock(obj);
}
}
- virConnectClose(conn);
+ virObjectUnref(conn);
virObjectUnref(cfg);
}
* that the threads we start see a valid connection throughout their
* lifetime. We simply increase the reference counter here.
*/
- virConnectRef(data->conn);
+ virObjectRef(data->conn);
if (virThreadCreate(&thread, false, qemuProcessReconnect, data) < 0) {
- virConnectClose(data->conn);
+ virObjectUnref(data->conn);
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not create thread. QEMU initialization "
/*
* storage_driver.c: core driver for storage APIs
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
virStoragePoolObjUnlock(pool);
}
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
}
/**
virDomainObjListForEach(driver->domains, umlAutostartDomain, &data);
umlDriverUnlock(driver);
- if (conn)
- virConnectClose(conn);
+ virObjectUnref(conn);
}