[PATCH 06/16] Factor out conn

Ryan Moeller posted 16 patches 4 years, 9 months ago
There is a newer version of this series
[PATCH 06/16] Factor out conn
Posted by Ryan Moeller 4 years, 9 months ago
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
---
 src/bhyve/bhyve_driver.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 7b8e4808f9..625dc0ec22 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -946,7 +946,8 @@ bhyveDomainCreateXML(virConnectPtr conn,
 static int
 bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
 {
-    bhyveConnPtr privconn = dom->conn->privateData;
+    virConnectPtr conn = dom->conn;
+    bhyveConnPtr privconn = conn->privateData;
     virDomainObjPtr vm;
     virObjectEventPtr event = NULL;
     int ret = -1;
@@ -956,7 +957,7 @@ bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
     if (!(vm = bhyveDomObjFromDomain(dom)))
         goto cleanup;
 
-    if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0)
+    if (virDomainDestroyFlagsEnsureACL(conn, vm->def) < 0)
         goto cleanup;
 
     if (virDomainObjCheckActive(vm) < 0)
@@ -1060,7 +1061,8 @@ bhyveDomainSetMetadata(virDomainPtr dom,
                        const char *uri,
                        unsigned int flags)
 {
-    bhyveConnPtr privconn = dom->conn->privateData;
+    virConnectPtr conn = dom->conn;
+    bhyveConnPtr privconn = conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
 
@@ -1070,7 +1072,7 @@ bhyveDomainSetMetadata(virDomainPtr dom,
     if (!(vm = bhyveDomObjFromDomain(dom)))
         return -1;
 
-    if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
+    if (virDomainSetMetadataEnsureACL(conn, vm->def, flags) < 0)
         goto cleanup;
 
     ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
-- 
2.24.1


Re: [PATCH 06/16] Factor out conn
Posted by Ján Tomko 4 years, 9 months ago
On Sat, Feb 22, 2020 at 01:38:45AM -0500, Ryan Moeller wrote:
>Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
>---
> src/bhyve/bhyve_driver.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano