just dig a little more in qemu code, just before the synced=true is updated ,
s->common.offset is updated to end * BDRV_SECTOR_SIZE; should_complete = false; if (s->in_flight == 0 && cnt == 0) { trace_mirror_before_flush(s); ret = bdrv_flush(s->target); if (ret < 0) { if (mirror_error_action(s, false, -ret) == BLOCK_ERROR_ACTION_REPORT) { goto immediate_exit; } } else { /* We're out of the streaming phase. From now on, if the job * is cancelled we will actually complete all pending I/O and * report completion. This way, block-job-cancel will leave * the target in a consistent state. */ s->common.offset = end * BDRV_SECTOR_SIZE; if (!s->synced) { block_job_event_ready(&s->common); s->synced = true; } should_complete = s->should_complete || block_job_is_cancelled(&s->common); cnt = bdrv_get_dirty_count(bs, s->dirty_bitmap); } } So, I think current proxmox code detection is correct ? last if ($stat->{len} == $stat->{offset}); ----- Mail original ----- De: "Alexandre DERUMIER" <aderum...@odiso.com> À: "Dietmar Maurer" <diet...@proxmox.com> Cc: pve-devel@pve.proxmox.com Envoyé: Jeudi 2 Octobre 2014 07:49:57 Objet: Re: [pve-devel] possible problem with drive-mirror and block-job-completed >>Also make sure you are testing with latest qemu (2.1.2). I'll try to reproduce it today. (I never had this problem with nfs, maybe it's related to rbd with writeback) ----- Mail original ----- De: "Dietmar Maurer" <diet...@proxmox.com> À: "Alexandre DERUMIER" <aderum...@odiso.com>, pve-devel@pve.proxmox.com Envoyé: Jeudi 2 Octobre 2014 07:30:33 Objet: RE: [pve-devel] possible problem with drive-mirror and block-job-completed Also make sure you are testing with latest qemu (2.1.2). > Maybe it could be possible to retrieve the "synced" property without event, > with > some hack ? (through classic qmp query) > _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel