mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Revert "Separate out StateAutoStart from StateInitialize"
https://bugzilla.redhat.com/show_bug.cgi?id=1685151
This reverts commit e4a969092b
.
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>
This commit is contained in:
parent
fc380c2e01
commit
07a9c8bae8
@ -30,9 +30,6 @@ typedef int
|
|||||||
virStateInhibitCallback callback,
|
virStateInhibitCallback callback,
|
||||||
void *opaque);
|
void *opaque);
|
||||||
|
|
||||||
typedef void
|
|
||||||
(*virDrvStateAutoStart)(void);
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvStateCleanup)(void);
|
(*virDrvStateCleanup)(void);
|
||||||
|
|
||||||
@ -48,7 +45,6 @@ typedef virStateDriver *virStateDriverPtr;
|
|||||||
struct _virStateDriver {
|
struct _virStateDriver {
|
||||||
const char *name;
|
const char *name;
|
||||||
virDrvStateInitialize stateInitialize;
|
virDrvStateInitialize stateInitialize;
|
||||||
virDrvStateAutoStart stateAutoStart;
|
|
||||||
virDrvStateCleanup stateCleanup;
|
virDrvStateCleanup stateCleanup;
|
||||||
virDrvStateReload stateReload;
|
virDrvStateReload stateReload;
|
||||||
virDrvStateStop stateStop;
|
virDrvStateStop stateStop;
|
||||||
|
@ -632,11 +632,7 @@ virRegisterStateDriver(virStateDriverPtr driver)
|
|||||||
* @callback: callback to invoke to inhibit shutdown of the daemon
|
* @callback: callback to invoke to inhibit shutdown of the daemon
|
||||||
* @opaque: data to pass to @callback
|
* @opaque: data to pass to @callback
|
||||||
*
|
*
|
||||||
* Initialize all virtualization drivers. Accomplished in two phases,
|
* Initialize all virtualization drivers.
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* Returns 0 if all succeed, -1 upon any failure.
|
* Returns 0 if all succeed, -1 upon any failure.
|
||||||
*/
|
*/
|
||||||
@ -664,14 +660,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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user