]> xenbits.xensource.com Git - libvirt.git/commitdiff
libvirtd: Alter order of virNetDaemonNew
authorJohn Ferlan <jferlan@redhat.com>
Mon, 6 Nov 2017 21:55:15 +0000 (16:55 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 18 Nov 2017 12:51:43 +0000 (07:51 -0500)
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.

daemon/libvirtd.c

index 4fc33ba0d4d03d2aa4591cf4a4a34c58bae3dbdf..73f24915df4994b5a281629a0bceed74fce48023 100644 (file)
@@ -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;
     }