On 21.12.2011 20:08, Eric Blake wrote: > On 12/20/2011 08:21 AM, Michal Privoznik wrote: >> This patch alters dumping code, so we can report progress >> and allow cancel via ^C. >> --- >> tools/virsh.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++------- >> tools/virsh.pod | 8 +++--- >> 2 files changed, 73 insertions(+), 14 deletions(-) >> >> >> + sigemptyset(&sigmask); >> + sigaddset(&sigmask, SIGINT); >> + if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) >> + goto out_sig; >> + >> if (!vshConnectionUsability(ctl, ctl->conn)) >> - return false; >> + goto out; > > Is it any more efficient to do the argument validation prior to the > pthread_sigmask? I'd rather not since this code is executed in a separate thread which we want to ignore SIGINT. Otherwise we may hit situation where this thread receives the signal and therefore gets terminated without starting any job or writing anything to pipe. > >> + >> + ret = do_watch_job(ctl, dom, verbose, p[0], 0, NULL, "Dump"); > > _("Dump") > > ACK. > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list