[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH RFC 7/7] nbd/replication: implement
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH RFC 7/7] nbd/replication: implement .bdrv_get_info() for nbd and replication driver |
Date: |
Thu, 20 Oct 2016 10:34:21 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/20/2016 08:57 AM, zhanghailiang wrote:
> Without this callback, there will be an error reports in the primary side:
> "qemu-system-x86_64: Couldn't determine the cluster size of the target image,
> which has no backing file: Operation not supported
> Aborting, since this may create an unusable destination image"
>
> For nbd driver, it doesn't have cluster size, so here we return
> a fake value for it.
>
> Signed-off-by: zhanghailiang <address@hidden>
> Signed-off-by: Wen Congyang <address@hidden>
> ---
> block/nbd.c | 12 ++++++++++++
> block/replication.c | 6 ++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/block/nbd.c b/block/nbd.c
> index 6bc06d6..96d7023 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -40,6 +40,8 @@
>
> #define EN_OPTSTR ":exportname="
>
> +#define NBD_FAKE_CLUSTER_SIZE 512
Why 512? NBD allows byte-addressable operations (even if it is more
efficient on aligned I/O); and I've been working hard to convert things
to the point that NBD does not enforce alignment on other layers.
Wouldn't 1 be better?
> +static int nbd_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
> +{
> + bdi->cluster_size = NBD_FAKE_CLUSTER_SIZE;
I also have patches written (but waiting for NBD write zeroes support to
be reviewed first) that add support for the experimental NBD block info,
that lets a server advertise actual sizes to the client rather than
having to guess. Here's the last time I posted a preview of it:
https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg03567.html
It would be nice to use that instead of just faking things.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH RFC 3/7] replication: add shared-disk and shared-disk-id options, (continued)
- [Qemu-block] [PATCH RFC 3/7] replication: add shared-disk and shared-disk-id options, zhanghailiang, 2016/10/20
- [Qemu-block] [PATCH RFC 2/7] block-backend: Introduce blk_root() helper, zhanghailiang, 2016/10/20
- [Qemu-block] [PATCH RFC 6/7] replication: Implement block replication for shared disk case, zhanghailiang, 2016/10/20
- [Qemu-block] [PATCH RFC 5/7] replication: fix code logic with the new shared_disk option, zhanghailiang, 2016/10/20
- [Qemu-block] [PATCH RFC 1/7] docs/block-replication: Add description for shared-disk case, zhanghailiang, 2016/10/20
- [Qemu-block] [PATCH RFC 7/7] nbd/replication: implement .bdrv_get_info() for nbd and replication driver, zhanghailiang, 2016/10/20
- Re: [Qemu-block] [Qemu-devel] [PATCH RFC 7/7] nbd/replication: implement .bdrv_get_info() for nbd and replication driver,
Eric Blake <=
- [Qemu-block] [PATCH RFC 4/7] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint(), zhanghailiang, 2016/10/20
- Re: [Qemu-block] [PATCH RFC 0/7] COLO block replication supports shared disk case, Changlong Xie, 2016/10/25