[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/13] block: Make essential BlockDriver obje
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/13] block: Make essential BlockDriver objects public |
Date: |
Tue, 02 Dec 2014 09:45:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 12/02/2014 02:11 AM, Max Reitz wrote:
>>> -static BlockDriver bdrv_qcow2 = {
>>> +BlockDriver *bdrv_qcow2 = &(BlockDriver){
>> Do we want any use of 'const', to avoid accidental manipulation of the
>> pointer and/or pointed-to contents?
>
> Sounds good at first, but for instance qemu_opts_create() (which is
> often called with bdrv_qcow2->create_opts and the like) don't take a
> const pointer. We could fix all those functions, but trying to fix the
> const-ness of the block layer sounds like really tedious work to me...
> Also, bdrv_find_format() returns a non-const pointer so it's at least
> not more broken than it was before.
Fair enough - no need to hold up this patch on what would turn into a
much larger task of chasing const-correctness.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature