c313de
From a26ad1b57617abc4de8a0d13716b898d311ee01e Mon Sep 17 00:00:00 2001
c313de
Message-Id: <a26ad1b57617abc4de8a0d13716b898d311ee01e@dist-git>
c313de
From: Michal Privoznik <mprivozn@redhat.com>
c313de
Date: Thu, 27 Jun 2019 15:18:15 +0200
c313de
Subject: [PATCH] bhyve: Move autostarting of domains into bhyveStateInitialize
c313de
MIME-Version: 1.0
c313de
Content-Type: text/plain; charset=UTF-8
c313de
Content-Transfer-Encoding: 8bit
c313de
c313de
The stateAutoStart callback will go away shortly. Therefore, move
c313de
the autostart call into state initialize callback.
c313de
c313de
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
(cherry picked from commit 31c3c35c940010a793fea8351751bb04fab1a6d4)
c313de
c313de
https://bugzilla.redhat.com/show_bug.cgi?id=1685151
c313de
c313de
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c313de
Message-Id: <1a93e2bef531c11190c652fcfb73b568ee73e487.1561641375.git.mprivozn@redhat.com>
c313de
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
c313de
---
c313de
 src/bhyve/bhyve_driver.c | 12 ++----------
c313de
 1 file changed, 2 insertions(+), 10 deletions(-)
c313de
c313de
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
c313de
index 9284b51783..ec016ecc0c 100644
c313de
--- a/src/bhyve/bhyve_driver.c
c313de
+++ b/src/bhyve/bhyve_driver.c
c313de
@@ -1270,6 +1270,8 @@ bhyveStateInitialize(bool privileged,
c313de
 
c313de
     virBhyveProcessReconnectAll(bhyve_driver);
c313de
 
c313de
+    bhyveAutostartDomains(bhyve_driver);
c313de
+
c313de
     return 0;
c313de
 
c313de
  cleanup:
c313de
@@ -1297,15 +1299,6 @@ bhyveDriverGetGrubCaps(virConnectPtr conn)
c313de
     return 0;
c313de
 }
c313de
 
c313de
-static void
c313de
-bhyveStateAutoStart(void)
c313de
-{
c313de
-    if (!bhyve_driver)
c313de
-        return;
c313de
-
c313de
-    bhyveAutostartDomains(bhyve_driver);
c313de
-}
c313de
-
c313de
 static int
c313de
 bhyveConnectGetMaxVcpus(virConnectPtr conn,
c313de
                         const char *type)
c313de
@@ -1713,7 +1706,6 @@ static virConnectDriver bhyveConnectDriver = {
c313de
 static virStateDriver bhyveStateDriver = {
c313de
     .name = "bhyve",
c313de
     .stateInitialize = bhyveStateInitialize,
c313de
-    .stateAutoStart = bhyveStateAutoStart,
c313de
     .stateCleanup = bhyveStateCleanup,
c313de
 };
c313de
 
c313de
-- 
c313de
2.22.0
c313de