[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/8] block: add the drive-reopen command
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 6/8] block: add the drive-reopen command |
Date: |
Mon, 16 Apr 2012 11:33:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
Am 16.04.2012 09:17, schrieb Paolo Bonzini:
>>> + /*
>>> + * If reopening the image file we just created fails, fall back
>>> + * and try to re-open the original image. If that fails too, we
>>> + * are in serious trouble.
>>> + */
>>> + if (ret != 0) {
>>> + ret = bdrv_open(bs, old_filename, flags, old_drv);
>>> + if (ret != 0) {
>>> + error_set(errp, QERR_OPEN_FILE_FAILED, old_filename);
>>> + } else {
>>> + error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
>>> + }
>>> + }
>>
>> In that worst-case scenario of failing to reopen the old file, should we
>> be halting the domain and/or propagating an event up to the user,
>> similar to how we behave on ENOSPC errors?
>
> Probably yes, but it's made more complex because the rerror/werror
> arguments are only known by the emulated device, not by the disk. I
> (and Federico before me) just copied the existing non-handling in live
> snapshots.
It happens more or less automatically. After a failed bdrv_open() you
have bs->drv = NULL, which makes any subsequent requests fail. This way
you trigger the rerror/werror paths indirectly.
Kevin
- [Qemu-devel] [PATCH 2/8] block: allow interrupting a co_sleep_ns, (continued)
- [Qemu-devel] [PATCH 2/8] block: allow interrupting a co_sleep_ns, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 1/8] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 3/8] block: allow doing I/O in a job after cancellation, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 5/8] block: add drive-mirror command, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 6/8] block: add the drive-reopen command, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 4/8] block: add mirror job, Paolo Bonzini, 2012/04/13
- [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Paolo Bonzini, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Eric Blake, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Paolo Bonzini, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Eric Blake, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Paolo Bonzini, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Eric Blake, 2012/04/13
- Re: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations, Paolo Bonzini, 2012/04/16
[Qemu-devel] [PATCH 7/8] block: add witness argument to drive-reopen, Paolo Bonzini, 2012/04/13