[libvirt] [PATCH 2/5] libvirtd: Alter order of virNetDaemonNew

John Ferlan posted 5 patches 7 years, 6 months ago
[libvirt] [PATCH 2/5] libvirtd: Alter order of virNetDaemonNew
Posted by John Ferlan 7 years, 6 months ago
Let's be sure we can get a Daemon object before the server object.
This is a more "orderly" way to do things since the svr object would
be added to the dmn object afterwards.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 daemon/libvirtd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 4fc33ba0d4..73f24915df 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1297,6 +1297,11 @@ int main(int argc, char **argv) {
         goto cleanup;
     }
 
+    if (!(dmn = virNetDaemonNew())) {
+        ret = VIR_DAEMON_ERR_INIT;
+        goto cleanup;
+    }
+
     if (!(srv = virNetServerNew("libvirtd", 1,
                                 config->min_workers,
                                 config->max_workers,
@@ -1314,8 +1319,7 @@ int main(int argc, char **argv) {
         goto cleanup;
     }
 
-    if (!(dmn = virNetDaemonNew()) ||
-        virNetDaemonAddServer(dmn, srv) < 0) {
+    if (virNetDaemonAddServer(dmn, srv) < 0) {
         ret = VIR_DAEMON_ERR_INIT;
         goto cleanup;
     }
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/5] libvirtd: Alter order of virNetDaemonNew
Posted by Erik Skultety 7 years, 6 months ago
On Tue, Nov 07, 2017 at 09:39:53PM -0500, John Ferlan wrote:
> Let's be sure we can get a Daemon object before the server object.
> This is a more "orderly" way to do things since the svr object would
> be added to the dmn object afterwards.
>
> Signed-off-by: John Ferlan <jferlan@redhat.com>

Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list