* [Qemu-devel] [PATCH 5/6] qemu fixes
@ 2008-11-28 10:39 Christoph Egger
2008-11-28 11:34 ` [Qemu-devel] " Jan Kiszka
2008-12-05 18:00 ` Blue Swirl
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Egger @ 2008-11-28 10:39 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
[-- Attachment #1: Type: text/plain, Size: 809 bytes --]
Hi,
This is a series of four patches which improve support
for qemu on NetBSD.
sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
on NetBSD, which doesn't exist in sys-queue.h. Therefore,
include <sys/queue.h> before including sys-queue.h.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: block_qemu.diff --]
[-- Type: text/x-diff, Size: 596 bytes --]
Index: block.c
===================================================================
--- block.c (revision 5805)
+++ block.c (working copy)
@@ -21,6 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include "config-host.h"
+#ifdef _BSD /* include native header before sys-queue.h */
+#include <sys/queue.h>
+#endif
+
#include "qemu-common.h"
#include "console.h"
#include "block_int.h"
@@ -29,7 +34,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
-#include <sys/queue.h>
#include <sys/disk.h>
#endif
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] Re: [PATCH 5/6] qemu fixes
2008-11-28 10:39 [Qemu-devel] [PATCH 5/6] qemu fixes Christoph Egger
@ 2008-11-28 11:34 ` Jan Kiszka
2008-11-28 11:56 ` Christoph Egger
2008-12-05 18:00 ` Blue Swirl
1 sibling, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2008-11-28 11:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
Christoph Egger wrote:
> Hi,
>
> This is a series of four patches which improve support
> for qemu on NetBSD.
>
> sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
> the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
> on NetBSD, which doesn't exist in sys-queue.h. Therefore,
> include <sys/queue.h> before including sys-queue.h.
Does this patch (which my mail client unfortunately refuses to cite...)
take into account that we now have TAILQ_FOREACH_SAFE which NetBSD may lack?
Jan
--
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes
2008-11-28 11:34 ` [Qemu-devel] " Jan Kiszka
@ 2008-11-28 11:56 ` Christoph Egger
2008-11-28 12:17 ` Jan Kiszka
2008-11-28 16:46 ` M. Warner Losh
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Egger @ 2008-11-28 11:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Jan Kiszka
On Friday 28 November 2008 12:34:54 Jan Kiszka wrote:
> Christoph Egger wrote:
> > Hi,
> >
> > This is a series of four patches which improve support
> > for qemu on NetBSD.
> >
> > sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
> > the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
> > on NetBSD, which doesn't exist in sys-queue.h. Therefore,
> > include <sys/queue.h> before including sys-queue.h.
>
> Does this patch (which my mail client unfortunately refuses to cite...)
> take into account that we now have TAILQ_FOREACH_SAFE which NetBSD may
> lack?
Yes, NetBSD has it:
#define TAILQ_FOREACH_SAFE(var, head, field, next) \
for ((var) = ((head)->tqh_first); \
(var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \
(var) = (next))
Another option to this patch would be:
Renaming _SYS_QUEUE_H_ to QEMU_SYS_QUEUE_H_
at least allows to include both sys-queue.h and <sys/queue.h>.
If the macros are not compatible, gcc prints a warning about
redefining them. Using the -Wredundant-decls warning flag, gcc
always prints a warning when you try override or duplicate macro
defines and function declarations.
Christoph
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes
2008-11-28 11:56 ` Christoph Egger
@ 2008-11-28 12:17 ` Jan Kiszka
2008-11-28 16:46 ` M. Warner Losh
1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2008-11-28 12:17 UTC (permalink / raw)
To: Christoph Egger; +Cc: Blue Swirl, qemu-devel
Christoph Egger wrote:
> On Friday 28 November 2008 12:34:54 Jan Kiszka wrote:
>> Christoph Egger wrote:
>>> Hi,
>>>
>>> This is a series of four patches which improve support
>>> for qemu on NetBSD.
>>>
>>> sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
>>> the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
>>> on NetBSD, which doesn't exist in sys-queue.h. Therefore,
>>> include <sys/queue.h> before including sys-queue.h.
>> Does this patch (which my mail client unfortunately refuses to cite...)
>> take into account that we now have TAILQ_FOREACH_SAFE which NetBSD may
>> lack?
>
> Yes, NetBSD has it:
>
> #define TAILQ_FOREACH_SAFE(var, head, field, next) \
> for ((var) = ((head)->tqh_first); \
> (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \
> (var) = (next))
>
> Another option to this patch would be:
>
> Renaming _SYS_QUEUE_H_ to QEMU_SYS_QUEUE_H_
> at least allows to include both sys-queue.h and <sys/queue.h>.
>
> If the macros are not compatible, gcc prints a warning about
> redefining them. Using the -Wredundant-decls warning flag, gcc
> always prints a warning when you try override or duplicate macro
> defines and function declarations.
I don't think allowing inclusion of both headers in their current form
is a good idea. But we may try harder to make the best out of the host's
sys/queue.h and provide missing support in form of
#ifndef MACRO_XYZ
#define MACRO_XYZ ...
#endif
Jan
--
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes
2008-11-28 11:56 ` Christoph Egger
2008-11-28 12:17 ` Jan Kiszka
@ 2008-11-28 16:46 ` M. Warner Losh
1 sibling, 0 replies; 6+ messages in thread
From: M. Warner Losh @ 2008-11-28 16:46 UTC (permalink / raw)
To: qemu-devel, Christoph.Egger; +Cc: blauwirbel, jan.kiszka
In message: <200811281256.54759.Christoph.Egger@amd.com>
Christoph Egger <Christoph.Egger@amd.com> writes:
: On Friday 28 November 2008 12:34:54 Jan Kiszka wrote:
: > Christoph Egger wrote:
: > > Hi,
: > >
: > > This is a series of four patches which improve support
: > > for qemu on NetBSD.
: > >
: > > sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
: > > the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
: > > on NetBSD, which doesn't exist in sys-queue.h. Therefore,
: > > include <sys/queue.h> before including sys-queue.h.
: >
: > Does this patch (which my mail client unfortunately refuses to cite...)
: > take into account that we now have TAILQ_FOREACH_SAFE which NetBSD may
: > lack?
:
: Yes, NetBSD has it:
:
: #define TAILQ_FOREACH_SAFE(var, head, field, next) \
: for ((var) = ((head)->tqh_first); \
: (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \
: (var) = (next))
:
: Another option to this patch would be:
:
: Renaming _SYS_QUEUE_H_ to QEMU_SYS_QUEUE_H_
: at least allows to include both sys-queue.h and <sys/queue.h>.
That would be the better option, because _XXX is reserved for the
compiler/library/toolchain, not for the application...
Warner
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] Re: [PATCH 5/6] qemu fixes
2008-11-28 10:39 [Qemu-devel] [PATCH 5/6] qemu fixes Christoph Egger
2008-11-28 11:34 ` [Qemu-devel] " Jan Kiszka
@ 2008-12-05 18:00 ` Blue Swirl
1 sibling, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2008-12-05 18:00 UTC (permalink / raw)
To: Christoph Egger; +Cc: qemu-devel
On 11/28/08, Christoph Egger <Christoph.Egger@amd.com> wrote:
>
> Hi,
>
> This is a series of four patches which improve support
> for qemu on NetBSD.
>
>
> sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
> the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
> on NetBSD, which doesn't exist in sys-queue.h. Therefore,
> include <sys/queue.h> before including sys-queue.h.
>
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Thanks, applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-12-05 18:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-28 10:39 [Qemu-devel] [PATCH 5/6] qemu fixes Christoph Egger
2008-11-28 11:34 ` [Qemu-devel] " Jan Kiszka
2008-11-28 11:56 ` Christoph Egger
2008-11-28 12:17 ` Jan Kiszka
2008-11-28 16:46 ` M. Warner Losh
2008-12-05 18:00 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).