[libvirt] [PATCH] virsh: Add missing "async" option in virsh-domain.c opts_block_commit.

After commit 8aecd351266a66efa59b7f7be77bf66693d99ce0 it'll detect that a required option is not defined and it will assert and exit with: virsh.c:1364: vshCommandOpt: Assertion `valid->name' failed. --- tools/virsh-domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 49cd154..856e888 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1544,6 +1544,10 @@ static const vshCmdOptDef opts_block_commit[] = { .type = VSH_OT_INT, .help = N_("with --wait, abort if copy exceeds timeout (in seconds)") }, + {.name = "async", + .type = VSH_OT_BOOL, + .help = N_("with --wait, don't wait for cancel to finish") + }, {.name = NULL} }; -- 1.8.3.1

On 09/19/2013 07:08 AM, Simone Gotti wrote:
After commit 8aecd351266a66efa59b7f7be77bf66693d99ce0 it'll detect
Yay - my sanity checking found the first victim! Boohoo - that victim was me (the bug has been latent for 1 year now, introduced in ed23b1066).
that a required option is not defined and it will assert and exit with:
virsh.c:1364: vshCommandOpt: Assertion `valid->name' failed. --- tools/virsh-domain.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK. Needs an update to virsh.pod to match, so I squashed this in (borrowing from blockcopy) and pushed. Congratulations on your first libvirt patch. diff --git c/tools/virsh.pod w/tools/virsh.pod index 0ae5178..2864f3d 100644 --- c/tools/virsh.pod +++ w/tools/virsh.pod @@ -737,7 +737,7 @@ I<domif-setlink>) will accept the MAC address printed by this command. =item B<blockcommit> I<domain> I<path> [I<bandwidth>] {[I<base>] | [I<--shallow>]} [I<top>] [I<--delete>] -[I<--wait> [I<--verbose>] [I<--timeout> B<seconds>]] +[I<--wait> [I<--verbose>] [I<--timeout> B<seconds>] [I<--async>]] Reduce the length of a backing image chain, by committing changes at the top of the chain (snapshot or delta files) into backing images. By @@ -756,7 +756,10 @@ operation can be checked with B<blockjob>. However, if I<--wait> is specified, then this command will block until the operation completes, or cancel the operation if the optional I<timeout> in seconds elapses or SIGINT is sent (usually with C<Ctrl-C>). Using I<--verbose> along -with I<--wait> will produce periodic status updates. +with I<--wait> will produce periodic status updates. If job cancellation +is triggered, I<--async> will return control to the user as fast as +possible, otherwise the command may continue to block a little while +longer until the job is done cleaning up. I<path> specifies fully-qualified path of the disk; it corresponds to a unique target name (<target dev='name'/>) or source file (<source -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 09/19/2013 12:18 PM, Eric Blake wrote:
On 09/19/2013 07:08 AM, Simone Gotti wrote:
After commit 8aecd351266a66efa59b7f7be77bf66693d99ce0 it'll detect
Yay - my sanity checking found the first victim! Boohoo - that victim was me (the bug has been latent for 1 year now, introduced in ed23b1066).
that a required option is not defined and it will assert and exit with:
virsh.c:1364: vshCommandOpt: Assertion `valid->name' failed. --- tools/virsh-domain.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK. Needs an update to virsh.pod to match, so I squashed this in (borrowing from blockcopy) and pushed. Congratulations on your first libvirt patch.
And I'm backporting to v1.1.2-maint, since it crashes virsh on Fedora 20. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On gio, 2013-09-19 at 12:18 -0600, Eric Blake wrote:
On 09/19/2013 07:08 AM, Simone Gotti wrote:
After commit 8aecd351266a66efa59b7f7be77bf66693d99ce0 it'll detect
Yay - my sanity checking found the first victim! Boohoo - that victim was me (the bug has been latent for 1 year now, introduced in ed23b1066).
:D
that a required option is not defined and it will assert and exit with:
virsh.c:1364: vshCommandOpt: Assertion `valid->name' failed. --- tools/virsh-domain.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK. Needs an update to virsh.pod to match, so I squashed this in (borrowing from blockcopy) and pushed.
Ops. I really forgot to also check if the docs needed an update.
Congratulations on your first libvirt patch.
Thanks! Bye!
diff --git c/tools/virsh.pod w/tools/virsh.pod index 0ae5178..2864f3d 100644 --- c/tools/virsh.pod +++ w/tools/virsh.pod @@ -737,7 +737,7 @@ I<domif-setlink>) will accept the MAC address printed by this command.
=item B<blockcommit> I<domain> I<path> [I<bandwidth>] {[I<base>] | [I<--shallow>]} [I<top>] [I<--delete>] -[I<--wait> [I<--verbose>] [I<--timeout> B<seconds>]] +[I<--wait> [I<--verbose>] [I<--timeout> B<seconds>] [I<--async>]]
Reduce the length of a backing image chain, by committing changes at the top of the chain (snapshot or delta files) into backing images. By @@ -756,7 +756,10 @@ operation can be checked with B<blockjob>. However, if I<--wait> is specified, then this command will block until the operation completes, or cancel the operation if the optional I<timeout> in seconds elapses or SIGINT is sent (usually with C<Ctrl-C>). Using I<--verbose> along -with I<--wait> will produce periodic status updates. +with I<--wait> will produce periodic status updates. If job cancellation +is triggered, I<--async> will return control to the user as fast as +possible, otherwise the command may continue to block a little while +longer until the job is done cleaning up.
I<path> specifies fully-qualified path of the disk; it corresponds to a unique target name (<target dev='name'/>) or source file (<source
participants (2)
-
Eric Blake
-
Simone Gotti