]> xenbits.xensource.com Git - libvirt.git/commit
virsh: Fix Ctrl-C behavior when watching a job
authorJiri Denemark <jdenemar@redhat.com>
Mon, 1 Jun 2015 13:06:16 +0000 (15:06 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 3 Jun 2015 07:53:02 +0000 (09:53 +0200)
commite9507fd41c9c6b73093cc0a4ce568bf0d8204854
treea83718d1954f3fd5015f29cb0f7d9967bb7090c8
parentf4c67f079441f1662c5591006b6fa47e04edef92
virsh: Fix Ctrl-C behavior when watching a job

When watching a job (save, managedsave, dump, migrate) virsh spawns a
thread to call the appropriate API and waits for the result while
watching for interruption signals (SIGINT, Ctrl-C on the terminal).
Whenever such signal is caught, virsh calls virDomainAbortJob, stops
waiting for the job, and returns the result of virDomainAbortJob.

This is wrong because the job might have finished in the meantime or it
might have been cancelled by someone else and virsh would just report
the failure to abort the job. However, we are not interested in the
virDomainAbortJob's result at all, we need to keep waiting for the main
job to finish and report its result instead.

https://bugzilla.redhat.com/show_bug.cgi?id=1131755

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tools/virsh-domain.c