qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC 06/10] qdev: add stubs for vmstate register/unregi


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC 06/10] qdev: add stubs for vmstate register/unregister functions
Date: Tue, 04 Dec 2012 14:08:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Il 04/12/2012 13:49, Eduardo Habkost ha scritto:
> Well, the commit description says that "if you place each function in a
> separate source file, object files for unused functions will not be
> taken in", I don't see it as a requirement. In this case, pulling both
> stubs is a feature: if a binary ends up using the vmstate_register stub,
> we really want it to use the vmstate_unregister stub as well.

I think Eduardo is right.  In the beginning I was thinking more of
having one function per file, but then in some cases the functions are
clearly related.

For example, if you have monitor_printf/monitor_vprintf, you have two
choices:

- put both of them in the same file, as done here for vmstate.

- put each in a separate file.  In this case, it doesn't really make
sense to implement only one, so the monitor_printf stub should use
va_start/va_end to forward to monitor_vprintf.

In the second case, the monitor_printf stub is not even a stub anymore,
because the same function will always be usable.  This makes it much
better to put both of them in the same file, IMHO.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]