mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
Revert "virStateDriver - Separate AutoStart from Initialize"
https://bugzilla.redhat.com/show_bug.cgi?id=1685151 This reverts commit cefb97fb815c81fc882da752f45effd23bcb9b4b. The stateAutoStart callback will be removed in the next commit. Therefore move autostarting of domains, networks and storage pools back into stateInitialize callbacks. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
31c3c35c94
commit
fc380c2e01
@ -779,6 +779,9 @@ libxlStateInitialize(bool privileged,
|
||||
NULL, NULL) < 0)
|
||||
goto error;
|
||||
|
||||
virDomainObjListForEach(libxl_driver->domains, libxlAutostartDomain,
|
||||
libxl_driver);
|
||||
|
||||
virDomainObjListForEach(libxl_driver->domains, libxlDomainManagedSaveLoad,
|
||||
libxl_driver);
|
||||
|
||||
@ -790,16 +793,6 @@ libxlStateInitialize(bool privileged,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
libxlStateAutoStart(void)
|
||||
{
|
||||
if (!libxl_driver)
|
||||
return;
|
||||
|
||||
virDomainObjListForEach(libxl_driver->domains, libxlAutostartDomain,
|
||||
libxl_driver);
|
||||
}
|
||||
|
||||
static int
|
||||
libxlStateReload(void)
|
||||
{
|
||||
@ -6611,7 +6604,6 @@ static virConnectDriver libxlConnectDriver = {
|
||||
static virStateDriver libxlStateDriver = {
|
||||
.name = "LIBXL",
|
||||
.stateInitialize = libxlStateInitialize,
|
||||
.stateAutoStart = libxlStateAutoStart,
|
||||
.stateCleanup = libxlStateCleanup,
|
||||
.stateReload = libxlStateReload,
|
||||
};
|
||||
|
@ -1632,6 +1632,8 @@ static int lxcStateInitialize(bool privileged,
|
||||
NULL, NULL) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virLXCProcessAutostartAll(lxc_driver);
|
||||
|
||||
virObjectUnref(caps);
|
||||
return 0;
|
||||
|
||||
@ -1641,19 +1643,6 @@ static int lxcStateInitialize(bool privileged,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* lxcStateAutoStart:
|
||||
*
|
||||
* Function to autostart the LXC daemons
|
||||
*/
|
||||
static void lxcStateAutoStart(void)
|
||||
{
|
||||
if (!lxc_driver)
|
||||
return;
|
||||
|
||||
virLXCProcessAutostartAll(lxc_driver);
|
||||
}
|
||||
|
||||
static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
|
||||
{
|
||||
virLXCDriverPtr driver = opaque;
|
||||
@ -5502,7 +5491,6 @@ static virConnectDriver lxcConnectDriver = {
|
||||
static virStateDriver lxcStateDriver = {
|
||||
.name = LXC_DRIVER_NAME,
|
||||
.stateInitialize = lxcStateInitialize,
|
||||
.stateAutoStart = lxcStateAutoStart,
|
||||
.stateCleanup = lxcStateCleanup,
|
||||
.stateReload = lxcStateReload,
|
||||
};
|
||||
|
@ -660,6 +660,10 @@ networkStateInitialize(bool privileged,
|
||||
networkReloadFirewallRules(network_driver, true);
|
||||
networkRefreshDaemons(network_driver);
|
||||
|
||||
virNetworkObjListForEach(network_driver->networks,
|
||||
networkAutostartConfig,
|
||||
network_driver);
|
||||
|
||||
network_driver->networkEventState = virObjectEventStateNew();
|
||||
|
||||
#ifdef WITH_FIREWALLD
|
||||
@ -699,23 +703,6 @@ networkStateInitialize(bool privileged,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* networkStateAutoStart:
|
||||
*
|
||||
* Function to AutoStart the bridge configs
|
||||
*/
|
||||
static void
|
||||
networkStateAutoStart(void)
|
||||
{
|
||||
if (!network_driver)
|
||||
return;
|
||||
|
||||
virNetworkObjListForEach(network_driver->networks,
|
||||
networkAutostartConfig,
|
||||
network_driver);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* networkStateReload:
|
||||
*
|
||||
@ -5652,7 +5639,6 @@ static virConnectDriver networkConnectDriver = {
|
||||
static virStateDriver networkStateDriver = {
|
||||
.name = "bridge",
|
||||
.stateInitialize = networkStateInitialize,
|
||||
.stateAutoStart = networkStateAutoStart,
|
||||
.stateCleanup = networkStateCleanup,
|
||||
.stateReload = networkStateReload,
|
||||
};
|
||||
|
@ -914,6 +914,8 @@ qemuStateInitialize(bool privileged,
|
||||
|
||||
qemuProcessReconnectAll(qemu_driver);
|
||||
|
||||
qemuAutostartDomains(qemu_driver);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
@ -924,20 +926,6 @@ qemuStateInitialize(bool privileged,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* qemuStateAutoStart:
|
||||
*
|
||||
* Function to auto start the QEMU daemons
|
||||
*/
|
||||
static void
|
||||
qemuStateAutoStart(void)
|
||||
{
|
||||
if (!qemu_driver)
|
||||
return;
|
||||
|
||||
qemuAutostartDomains(qemu_driver);
|
||||
}
|
||||
|
||||
static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
|
||||
{
|
||||
virQEMUDriverPtr driver = opaque;
|
||||
@ -22672,7 +22660,6 @@ static virConnectDriver qemuConnectDriver = {
|
||||
static virStateDriver qemuStateDriver = {
|
||||
.name = QEMU_DRIVER_NAME,
|
||||
.stateInitialize = qemuStateInitialize,
|
||||
.stateAutoStart = qemuStateAutoStart,
|
||||
.stateCleanup = qemuStateCleanup,
|
||||
.stateReload = qemuStateReload,
|
||||
.stateStop = qemuStateStop,
|
||||
|
@ -294,6 +294,8 @@ storageStateInitialize(bool privileged,
|
||||
|
||||
storagePoolUpdateAllState();
|
||||
|
||||
storageDriverAutostart();
|
||||
|
||||
driver->storageEventState = virObjectEventStateNew();
|
||||
|
||||
storageDriverUnlock();
|
||||
@ -306,22 +308,6 @@ storageStateInitialize(bool privileged,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* storageStateAutoStart:
|
||||
*
|
||||
* Function to auto start the storage driver
|
||||
*/
|
||||
static void
|
||||
storageStateAutoStart(void)
|
||||
{
|
||||
if (!driver)
|
||||
return;
|
||||
|
||||
storageDriverLock();
|
||||
storageDriverAutostart();
|
||||
storageDriverUnlock();
|
||||
}
|
||||
|
||||
/**
|
||||
* storageStateReload:
|
||||
*
|
||||
@ -2832,7 +2818,6 @@ static virConnectDriver storageConnectDriver = {
|
||||
static virStateDriver stateDriver = {
|
||||
.name = "storage",
|
||||
.stateInitialize = storageStateInitialize,
|
||||
.stateAutoStart = storageStateAutoStart,
|
||||
.stateCleanup = storageStateCleanup,
|
||||
.stateReload = storageStateReload,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user