qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH v2] Makefile: poison TARGET_xxx for compile once


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH v2] Makefile: poison TARGET_xxx for compile once.
Date: Fri, 25 Jun 2010 10:01:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Thunderbird/3.0.5

On 06/25/2010 05:02 AM, Isaku Yamahata wrote:
poison TARGET_xxx for compile once object
to prevent those ifdef from creeping in again.

didn't poison env which is used as function argument as void *env.
Although it would be possible to sort it out, for now just not poison it.

qemu-malloc.c didn't compile, so I make it non compile-once for now.
It is linked via block-obj-y in Makefile.obj and common-obj-y in
Makefile.objs through block-obj-y. So qemu-malloc.o is explicitly
added to rules.

I'm still skeptical, not about the goal but about the means.

I'm going to push again for my patch to make CPUState opaque for non-per-target files.

I haven't heard good reasons against it. The main objection was that hw files would have no reason for accessing CPUState. But this makes no sense if CPUState is opaque, and on the other hand we have now a proliferation of void* arguments and fields (e.g. in qemu_cpu_kick). Which I am taught is a very bad thing.

If that patch was accepted, we'd just need this to implement your proposal:

diff --git a/cpu-common.h b/cpu-common.h
index f325e60..78f8b12 100644
--- a/cpu-common.h
+++ b/cpu-common.h
@@ -11,10 +11,6 @@
 #include "targphys.h"
 #endif

-#ifndef NEED_CPU_H
-#include "poison.h"
-#endif
-
 #include "bswap.h"
 #include "qemu-queue.h"

diff --git a/qemu-common.h b/qemu-common.h
index 3fb2f0b..3f92d40 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -90,15 +90,12 @@ static inline char *realpath(const char *path, char *resolved_path)

 /* FIXME: Remove NEED_CPU_H.  */
 #ifndef NEED_CPU_H
-
 #include <setjmp.h>
 #include "osdep.h"
 #include "bswap.h"
-
+#include "poison.h"
 #else
-
 #include "cpu.h"
-
 #endif /* !defined(NEED_CPU_H) */

 /* bottom halves */


I'll put this together in a complete patch series and post.

Paolo



reply via email to

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