Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-14 Thread Michal Privoznik
On 13.09.2016 19:03, Eric Blake wrote: > On 09/13/2016 06:02 AM, Michal Privoznik wrote: > >>> So, just to make it crystal clear, is this what you're saying? >>> >>> ready | initial C/R |fudged C/R >> >> Oh, This should have been C/E instead of C/R. Current/End. 'e' and 'r' >> keys are just too

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Eric Blake
On 09/13/2016 06:02 AM, Michal Privoznik wrote: >> So, just to make it crystal clear, is this what you're saying? >> >> ready | initial C/R |fudged C/R > > Oh, This should have been C/E instead of C/R. Current/End. 'e' and 'r' > keys are just too close to each other :-) > >>

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Michal Privoznik
On 13.09.2016 11:52, Michal Privoznik wrote: > On 12.09.2016 21:19, Eric Blake wrote: >> On 09/09/2016 04:30 PM, John Ferlan wrote: >> +/* Fix job completeness reporting. If cur == end mgmt + * applications think job is completed. Except when both cur + * and end

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Michal Privoznik
On 12.09.2016 21:19, Eric Blake wrote: > On 09/09/2016 04:30 PM, John Ferlan wrote: > >>> >>> +/* Fix job completeness reporting. If cur == end mgmt >>> + * applications think job is completed. Except when both cur >>> + * and end are zero, in which case qemu hasn't started the >>>

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-12 Thread Eric Blake
On 09/09/2016 04:30 PM, John Ferlan wrote: >> >> +/* Fix job completeness reporting. If cur == end mgmt >> + * applications think job is completed. Except when both cur >> + * and end are zero, in which case qemu hasn't started the >> + * job yet. */ >> +if (!info->cur &&

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-12 Thread John Ferlan
[...] >> >> Can info->ready == 0 ? w/ info->cur = info->end = 0 >> >> If so, then we're in the same mess or some other weird condition. >> >> Seems like "ready" will be set in qemu during block_job_event_ready, so >> that would say to me that as long as the structure is allocated, ready >> will

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-12 Thread Michal Privoznik
On 09.09.2016 23:30, John Ferlan wrote: > > > On 09/05/2016 07:48 AM, Michal Privoznik wrote: >> https://bugzilla.redhat.com/show_bug.cgi?id=1372613 >> >> Apparently, some management applications use the following code >> pattern when waiting for a block job to finish: >> >> while (1) { >>

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-09 Thread John Ferlan
On 09/05/2016 07:48 AM, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1372613 > > Apparently, some management applications use the following code > pattern when waiting for a block job to finish: > > while (1) { > virDomainGetBlockJobInfo(dom, disk, info, flags);

[libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-05 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1372613 Apparently, some management applications use the following code pattern when waiting for a block job to finish: while (1) { virDomainGetBlockJobInfo(dom, disk, info, flags); if (info.cur == info.end) break; sleep(1); }