Blob Blame History Raw
From a26ad1b57617abc4de8a0d13716b898d311ee01e Mon Sep 17 00:00:00 2001
Message-Id: <a26ad1b57617abc4de8a0d13716b898d311ee01e@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 27 Jun 2019 15:18:15 +0200
Subject: [PATCH] bhyve: Move autostarting of domains into bhyveStateInitialize
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The stateAutoStart callback will go away shortly. Therefore, move
the autostart call into state initialize callback.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 31c3c35c940010a793fea8351751bb04fab1a6d4)

https://bugzilla.redhat.com/show_bug.cgi?id=1685151

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <1a93e2bef531c11190c652fcfb73b568ee73e487.1561641375.git.mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/bhyve/bhyve_driver.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 9284b51783..ec016ecc0c 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1270,6 +1270,8 @@ bhyveStateInitialize(bool privileged,
 
     virBhyveProcessReconnectAll(bhyve_driver);
 
+    bhyveAutostartDomains(bhyve_driver);
+
     return 0;
 
  cleanup:
@@ -1297,15 +1299,6 @@ bhyveDriverGetGrubCaps(virConnectPtr conn)
     return 0;
 }
 
-static void
-bhyveStateAutoStart(void)
-{
-    if (!bhyve_driver)
-        return;
-
-    bhyveAutostartDomains(bhyve_driver);
-}
-
 static int
 bhyveConnectGetMaxVcpus(virConnectPtr conn,
                         const char *type)
@@ -1713,7 +1706,6 @@ static virConnectDriver bhyveConnectDriver = {
 static virStateDriver bhyveStateDriver = {
     .name = "bhyve",
     .stateInitialize = bhyveStateInitialize,
-    .stateAutoStart = bhyveStateAutoStart,
     .stateCleanup = bhyveStateCleanup,
 };
 
-- 
2.22.0