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