]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircommand: Document virCommandSetSendBuffer() behaviour wrt daemonize
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 22 Mar 2022 10:03:10 +0000 (11:03 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 1 Dec 2022 13:22:39 +0000 (14:22 +0100)
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@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
src/util/vircommand.c

index bbfbe1970677e3e5776c3cf1b0ef1e5329edfe71..cdc74bc2fdd4df3cee60ca211551a5a1fa866f8b 100644 (file)
@@ -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,