]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_process: Document qemuProcessPrepare{Domain,Host}() order
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2022 11:18:50 +0000 (12:18 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2022 13:21:33 +0000 (14:21 +0100)
The domain startup process is split into multiple phases. One of
them is preparing the domain (at that point live) XML, private
data, various paths, etc - see qemuProcessPrepareDomain(); the
other prepares the host - see qemuProcessPrepareHost(). It's
obvious that the domain XML preparation function must be called
before the host preparation function (e.g. the host preparation
might try to create a file which path is generated in the domain
preparation phase). Nevertheless, let's document this
expectation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index e1c18dde903f74d3cc276800f72bea2bc7e2c50b..19b924262353be7db959987bf64d61d89f56a586 100644 (file)
@@ -6634,6 +6634,8 @@ qemuProcessPrepareChardevSource(virDomainDef *def,
  * start the domain but create a valid qemu command.  If some code shouldn't be
  * executed in this case, make sure to check this flag.
  *
+ * This function MUST be called before qemuProcessPrepareHost().
+ *
  * TODO: move all XML modification from qemuBuildCommandLine into this function
  */
 int
@@ -7151,6 +7153,8 @@ qemuProcessPrepareHostBackendChardevHotplug(virDomainObj *vm,
  * update live XML) to prepare environment for a domain which is about to start
  * and it's the only place to do those modifications.
  *
+ * This function MUST be called only after qemuProcessPrepareDomain().
+ *
  * TODO: move all host modification from qemuBuildCommandLine into this function
  */
 int