[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v5 2/4] raw: Recognize zoned backin
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v5 2/4] raw: Recognize zoned backing devices |
Date: |
Wed, 28 Aug 2019 10:32:55 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Fri, Aug 23, 2019 at 03:49:25PM -0400, Dmitry Fomichev wrote:
> +static int hdev_get_zoned_model(int fd)
Please use the enum:
static BdrvZonedModel hdev_get_zoned_model(int fd)
> +{
> +#ifdef CONFIG_LINUX
> + char buf[32];
> + int ret;
> +
> + ret = hdev_read_blk_queue_entry(fd, "zoned", buf, sizeof(buf));
> + if (ret < 0) {
> + ret = BLK_ZONED_MODEL_NONE;
> + goto out;
> }
> - g_free(sysfspath);
> +
> + buf[ret - 1] = 0;
The ret - 1 looks suspicious since sg_get_max_segments() does buf[ret] =
0 instead. A comment would make it clear why ret - 1 is used here:
buf[ret - 1] = 0; /* strip newline and NUL-terminate */
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v5 0/4] virtio/block: handle zoned backing devices, Dmitry Fomichev, 2019/08/23
- [Qemu-devel] [PATCH v5 4/4] raw: Don't open ZBDs if backend can't handle them, Dmitry Fomichev, 2019/08/23
- [Qemu-devel] [PATCH v5 1/4] block: Add zoned device model property, Dmitry Fomichev, 2019/08/23
- [Qemu-devel] [PATCH v5 3/4] block/ide/scsi: Set BLK_PERM_SUPPORT_ZONED, Dmitry Fomichev, 2019/08/23
- [Qemu-devel] [PATCH v5 2/4] raw: Recognize zoned backing devices, Dmitry Fomichev, 2019/08/23
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 2/4] raw: Recognize zoned backing devices,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH v5 0/4] virtio/block: handle zoned backing devices, no-reply, 2019/08/23
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 0/4] virtio/block: handle zoned backing devices, Stefan Hajnoczi, 2019/08/28