All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] backup notifier fail policy
@ 2016-09-30 17:11 Vladimir Sementsov-Ogievskiy
  2016-09-30 18:59 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2016-09-30 17:11 UTC (permalink / raw)
  To: qemu-devel, qemu block
  Cc: Jeff Cody, John Snow, Fam Zheng, Stefan Hajnoczi, Denis V. Lunev

Hi all!

Please, can somebody explain me, why we fail guest request in case of io 
error in write notifier? I think guest consistency is more important 
than success of unfinished backup. Or, what am I missing?

I'm saying about this code:

static int coroutine_fn backup_before_write_notify(
         NotifierWithReturn *notifier,
         void *opaque)
{
     BackupBlockJob *job = container_of(notifier, BackupBlockJob, 
before_write);
     BdrvTrackedRequest *req = opaque;
     int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
     int nb_sectors = req->bytes >> BDRV_SECTOR_BITS;

     assert(req->bs == blk_bs(job->common.blk));
     assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0);
     assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);

     return backup_do_cow(job, sector_num, nb_sectors, NULL, true);
}

So, what about something like

ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) {
    job->notif_ret = ret;
}

return 0;

and fail block job if notif_ret < 0 in other places of backup code?

-- 
Best regards,
Vladimir

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-10-05 12:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 17:11 [Qemu-devel] backup notifier fail policy Vladimir Sementsov-Ogievskiy
2016-09-30 18:59 ` Vladimir Sementsov-Ogievskiy
2016-10-03 13:11   ` Stefan Hajnoczi
2016-10-03 18:07     ` John Snow
2016-10-04  9:23       ` Stefan Hajnoczi
2016-10-04  9:34         ` Kevin Wolf
2016-10-04 10:41           ` Denis V. Lunev
2016-10-04 11:55             ` Kevin Wolf
2016-10-04 16:02               ` Stefan Hajnoczi
2016-10-04 16:03                 ` John Snow
2016-10-04 16:19                   ` Denis V. Lunev
2016-10-05  8:12                 ` Kevin Wolf
2016-10-05 12:59                   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.