[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 02/20] block: Drop private ioctl-only members
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/20] block: Drop private ioctl-only members of BlockRequest |
Date: |
Fri, 6 May 2016 06:23:38 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/06/2016 04:37 AM, Kevin Wolf wrote:
> Am 05.05.2016 um 01:55 hat Eric Blake geschrieben:
>> I was thrown by the fact that the public type BlockRequest had
>> an anonymous union, but no obvious discriminator. Turns out
>> that the only client of the second branch of the union was code
>> internal to io.c, and that with a slight abuse of QEMUIOVector*
>> to pass a void* pointer, we can make the public interface less
>> confusing.
>>
>> (Yes, I know that strict C doesn't guarantee that you can cast
>> void* to the wrong type and then back to void* - it only
>> guarantees the reverse direction of the original pointer to
>> void* and back to the original type - but we already have other
>> assumptions throughout the qemu code base that assume that all
>> pointers are interchangeable in representation).
>>
>> Signed-off-by: Eric Blake <address@hidden>
>
> Do you really think abusing fields makes things clearer than using a
> union? We could just add comments instead that tell which branch is used
> for what. And after my patch "block: Remove bdrv_aio_multiwrite()", I
> think the struct isn't part of a public interface any more anyway.
Oh, you're right! Consider this patch severed from the series (I may
still send a documentation patch, and/or move the struct out of the
public header into block_int.h, but it is sufficiently unrelated to the
rest of the series).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v6 04/20] block: Switch blk_*write_zeroes() to byte interface, (continued)
- [Qemu-devel] [PATCH v6 03/20] block: Switch blk_read_unthrottled() to byte interface, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 01/20] block: Allow BDRV_REQ_FUA through blk_pwrite(), Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 02/20] block: Drop private ioctl-only members of BlockRequest, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 05/20] block: Introduce byte-based aio read/write, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 08/20] virtio: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 09/20] xen_disk: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 18/20] qemu-img: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 10/20] fdc: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 11/20] nand: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 19/20] qemu-io: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v6 13/20] pflash: Switch to byte-based block access, Eric Blake, 2016/05/04