libvirt/SOURCES/libvirt-Revert-Separate-out...

94 lines
3.4 KiB
Diff

From 8069bb50b2548acd3f2176499ede205e6099c067 Mon Sep 17 00:00:00 2001
Message-Id: <8069bb50b2548acd3f2176499ede205e6099c067@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 27 Jun 2019 15:18:17 +0200
Subject: [PATCH] Revert "Separate out StateAutoStart from StateInitialize"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit e4a969092bda5b3b952963fdf6658895165040b7.
Now that drivers may call virConnectOpen() on secondary drivers, it
doesn't make much sense to have autostart separated from driver
initialization callback. In fact, it creates a problem because one
driver during its initialization might try to fetch an object from
another driver but since the object is yet to be autostarted the fetch
fails. This has been observed in reality: qemu driver performs
qemuProcessReconnect() during qemu's stateInitialize phase which may
call virDomainDiskTranslateSourcePool() which connects to the storage
driver to look up the volume. But the storage driver did not autostart
its pools yet therefore volume lookup fails and the domain is killed.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 07a9c8bae8b80ef1650e6d05869cbf55c6aea837)
https://bugzilla.redhat.com/show_bug.cgi?id=1685151
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <4ed5f8f4edd0053cc14f4bb579a945b606b36f5a.1561641375.git.mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
src/driver-state.h | 4 ----
src/libvirt.c | 14 +-------------
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/src/driver-state.h b/src/driver-state.h
index 1cb3e4faf3..e1e060bcc5 100644
--- a/src/driver-state.h
+++ b/src/driver-state.h
@@ -30,9 +30,6 @@ typedef int
virStateInhibitCallback callback,
void *opaque);
-typedef void
-(*virDrvStateAutoStart)(void);
-
typedef int
(*virDrvStateCleanup)(void);
@@ -48,7 +45,6 @@ typedef virStateDriver *virStateDriverPtr;
struct _virStateDriver {
const char *name;
virDrvStateInitialize stateInitialize;
- virDrvStateAutoStart stateAutoStart;
virDrvStateCleanup stateCleanup;
virDrvStateReload stateReload;
virDrvStateStop stateStop;
diff --git a/src/libvirt.c b/src/libvirt.c
index 52f4dd2808..c9e5f47fd4 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -637,11 +637,7 @@ virRegisterStateDriver(virStateDriverPtr driver)
* @callback: callback to invoke to inhibit shutdown of the daemon
* @opaque: data to pass to @callback
*
- * Initialize all virtualization drivers. Accomplished in two phases,
- * the first being state and structure initialization followed by any
- * auto start supported by the driver. This is done to ensure dependencies
- * that some drivers may have on another driver having been initialized
- * will exist, such as the storage driver's need to use the secret driver.
+ * Initialize all virtualization drivers.
*
* Returns 0 if all succeed, -1 upon any failure.
*/
@@ -669,14 +665,6 @@ virStateInitialize(bool privileged,
}
}
}
-
- for (i = 0; i < virStateDriverTabCount; i++) {
- if (virStateDriverTab[i]->stateAutoStart) {
- VIR_DEBUG("Running global auto start for %s state driver",
- virStateDriverTab[i]->name);
- virStateDriverTab[i]->stateAutoStart();
- }
- }
return 0;
}
--
2.22.0