[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/7] Move target_words_bigendian() prototype
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/7] Move target_words_bigendian() prototype to exec-all.h |
Date: |
Mon, 15 Dec 2014 11:17:58 +0100 |
On Fri, 12 Dec 2014 16:20:16 -0200
Eduardo Habkost <address@hidden> wrote:
> On Wed, Dec 10, 2014 at 07:44:04PM +0000, Peter Maydell wrote:
> > On 10 December 2014 at 19:26, Eduardo Habkost <address@hidden> wrote:
> > > Signed-off-by: Eduardo Habkost <address@hidden>
> > > ---
> > > exec.c | 1 -
> > > hw/virtio/virtio.c | 1 -
> > > include/exec/exec-all.h | 2 ++
> > > 3 files changed, 2 insertions(+), 2 deletions(-)
> >
> > I thought this prototype was not in a generally
> > included header file because it's really not something that
> > should be needed by most code. If we do want to move it into
> > a header then we definitely don't want it in exec-all.h.
>
> I have no idea what would be the best place for the prototype, then.
> CCing the people who introduced the function, in case they have any
> suggestion.
>
> Anyway, I don't want to make this series depend on dealing with the
> virtio default-endianness mess, so in the next version I will drop this
> patch and simply put the prototype inside tests/x86-stub.c.
>
Indeed, this function is part of the legacy virtio endianness mess. And
Peter's remark is true: the prototype was deliberately kept hidden since
no code should need it except virtio.
There are two users and this isn't likely to change (except when everyone
will have switched to virtio-1 and we drop all the legacy virtio hacks):
- virtio_default_endian() in hw/virtio/virtio.c
- cpu_common_virtio_is_big_endian() in qom/cpu.c
I don't think it is worth moving the prototype to a common header file.
Perhaps a comment saying "this is a legacy virtio hack that should
stay hidden" would be more appropriate.
--
Greg
- [Qemu-devel] [PATCH v3 0/7] Target-specific unit test support, add unit tests for target-i386/cpu.c code, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 2/7] tests: Support target-specific unit tests, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 4/7] tests: Add unit test for X86CPU code, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 5/7] target-i386: Isolate enabled-by-default features to a separate array, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 7/7] tests: test-x86-cpu: Add KVM feature bit initialization test, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 6/7] tests: test-x86-cpu: Add TCG feature bit initialization test, Eduardo Habkost, 2014/12/10
- [Qemu-devel] [PATCH v3 3/7] tests: Make test-x86-cpuid target-specific, Eduardo Habkost, 2014/12/10