[PATCH 1/9] vircommand: Document virCommandSetSendBuffer() behaviour wrt daemonize

Michal Privoznik mprivozn at redhat.com
Wed Nov 30 09:48:03 UTC 2022


When virCommandSetSendBuffer() is used over a virCommand that is
(or will be) daemonized, then the command must have
VIR_EXEC_ASYNC_IO flag set no later than at virCommandRunAsync()
phase so that the thread that's doing IO is spawned and thus
buffers can be sent to the process.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/util/vircommand.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index bbfbe19706..cdc74bc2fd 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -1693,6 +1693,9 @@ virCommandFreeSendBuffers(virCommand *cmd)
  * @buffer is always stolen regardless of the return value. This function
  * doesn't raise a libvirt error, but rather propagates the error via virCommand.
  * Thus callers don't need to take a special action if -1 is returned.
+ *
+ * When the @cmd is daemonized via virCommandDaemonize() remember to request
+ * asynchronous IO via virCommandDoAsyncIO().
  */
 int
 virCommandSetSendBuffer(virCommand *cmd,
-- 
2.37.4



More information about the libvir-list mailing list