[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component()
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const |
Date: |
Mon, 14 Jan 2013 18:27:18 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Andreas Färber <address@hidden> writes:
> Am 14.01.2013 13:19, schrieb Markus Armbruster:
>> Andreas Färber <address@hidden> writes:
>>
>>> This allows to navigate partial well-known paths from an object.
>>
>> Why does making the argument const allow such navigation?
>
> Without const, object_resolve_path_component(foo, "bar") results in a
> compile error (09/10 accesses "ide[1]" etc. to avoid exposing the full
> MacIOState).
>
> Apparently this function was so far only used on dynamically generated
> (non-const) arrays:
>
> qom/container.c: child = object_resolve_path_component(obj,
> parts[i]);
> qom/object.c: child = object_resolve_path_component(parent,
> parts[index]);
Makes sense, but isn't immediately obvious from your commit message.
What about:
qom: Make object_resolve_path_component() path argument const
Navigating well-known paths from an object like
object_resolve_path_component(foo, "bar")
is perfectly legitimate, but doesn't compile, because the second
parameter lacks const. Fix that.
- [Qemu-devel] [RFC ppc-next v3 06/10] mac_nvram: Clean up public API, (continued)
- [Qemu-devel] [RFC ppc-next v3 10/10] cuda: QOM'ify CUDA, Andreas Färber, 2013/01/13
- [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Andreas Färber, 2013/01/13
- Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Markus Armbruster, 2013/01/14
- Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Andreas Färber, 2013/01/14
- Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const,
Markus Armbruster <=
- [Qemu-devel] Go along with glib's basic type typedef silliness? (was: [PATCH 01/10] qom: Make object_resolve_path_component() path argument const), Markus Armbruster, 2013/01/14
- Re: [Qemu-devel] Go along with glib's basic type typedef silliness? (was: [PATCH 01/10] qom: Make object_resolve_path_component() path argument const), Blue Swirl, 2013/01/17
- Re: [Qemu-devel] Go along with glib's basic type typedef silliness?, Markus Armbruster, 2013/01/18
- Re: [Qemu-devel] Go along with glib's basic type typedef silliness?, Blue Swirl, 2013/01/19
[Qemu-devel] [RFC ppc-next v3 07/10] mac_nvram: Mark as Big Endian, Andreas Färber, 2013/01/13
[Qemu-devel] [RFC ppc-next v3 05/10] macio: Split MacIO in two, Andreas Färber, 2013/01/13
[Qemu-devel] [RFC ppc-next v3 04/10] macio: Delay qdev init until all fields are initialized, Andreas Färber, 2013/01/13
[Qemu-devel] [RFC ppc-next v3 03/10] macio: QOM'ify some more, Andreas Färber, 2013/01/13
[Qemu-devel] [RFC ppc-next v3 09/10] ide/macio: QOM'ify MacIO IDE, Andreas Färber, 2013/01/13
Re: [Qemu-devel] [RFC ppc-next v3 00/10] target-ppc: MacIO QOM'ification, Markus Armbruster, 2013/01/14