mirror of https://gitee.com/openkylin/libvirt.git
bhyve: driver: factor out conn
Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
501db47d9d
commit
f9fa2fe19f
|
@ -946,7 +946,8 @@ bhyveDomainCreateXML(virConnectPtr conn,
|
||||||
static int
|
static int
|
||||||
bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
|
bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
|
||||||
{
|
{
|
||||||
bhyveConnPtr privconn = dom->conn->privateData;
|
virConnectPtr conn = dom->conn;
|
||||||
|
bhyveConnPtr privconn = conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
virObjectEventPtr event = NULL;
|
virObjectEventPtr event = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
@ -956,7 +957,7 @@ bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
|
||||||
if (!(vm = bhyveDomObjFromDomain(dom)))
|
if (!(vm = bhyveDomObjFromDomain(dom)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0)
|
if (virDomainDestroyFlagsEnsureACL(conn, vm->def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainObjCheckActive(vm) < 0)
|
if (virDomainObjCheckActive(vm) < 0)
|
||||||
|
@ -1060,7 +1061,8 @@ bhyveDomainSetMetadata(virDomainPtr dom,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
bhyveConnPtr privconn = dom->conn->privateData;
|
virConnectPtr conn = dom->conn;
|
||||||
|
bhyveConnPtr privconn = conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
@ -1070,7 +1072,7 @@ bhyveDomainSetMetadata(virDomainPtr dom,
|
||||||
if (!(vm = bhyveDomObjFromDomain(dom)))
|
if (!(vm = bhyveDomObjFromDomain(dom)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
if (virDomainSetMetadataEnsureACL(conn, vm->def, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
||||||
|
|
Loading…
Reference in New Issue