* [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h
@ 2011-04-08 20:45 Blue Swirl
2011-04-08 21:09 ` [Qemu-devel] " Stefan Weil
2011-04-12 9:50 ` [Qemu-devel] " Jes Sorensen
0 siblings, 2 replies; 4+ messages in thread
From: Blue Swirl @ 2011-04-08 20:45 UTC (permalink / raw)
To: qemu-devel, Stefan Weil
[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]
Move generic or OS related function declarations and macro
TFR to qemu-common.h.
While moving, also add #include <winsock2.h> to fix a
recent mingw32 build breakage.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
qemu-common.h | 21 +++++++++++++++++++++
sysemu.h | 21 ---------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/qemu-common.h b/qemu-common.h
index 82e27c1..8b48a09 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -12,6 +12,7 @@
#endif
#define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
+#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUFile QEMUFile;
@@ -39,6 +40,16 @@ typedef struct Monitor Monitor;
#include <sys/time.h>
#include <assert.h>
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include "qemu-os-win32.h"
+#endif
+
+#ifdef CONFIG_POSIX
+#include "qemu-os-posix.h"
+#endif
+
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
@@ -338,6 +349,16 @@ void qemu_progress_init(int enabled, float min_skip);
void qemu_progress_end(void);
void qemu_progress_print(float percent, int max);
+#define QEMU_FILE_TYPE_BIOS 0
+#define QEMU_FILE_TYPE_KEYMAP 1
+char *qemu_find_file(int type, const char *name);
+
+/* OS specific functions */
+void os_setup_early_signal_handling(void);
+char *os_find_datadir(const char *argv0);
+void os_parse_cmd_args(int index, const char *optarg);
+void os_pidfile_error(void);
+
/* Convert a byte between binary and BCD. */
static inline uint8_t to_bcd(uint8_t val)
{
diff --git a/sysemu.h b/sysemu.h
index bbbd0fd..f112c22 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -8,22 +8,9 @@
#include "qemu-timer.h"
#include "notify.h"
-#ifdef _WIN32
-#include <windows.h>
-#include "qemu-os-win32.h"
-#endif
-
-#ifdef CONFIG_POSIX
-#include "qemu-os-posix.h"
-#endif
-
/* vl.c */
extern const char *bios_name;
-#define QEMU_FILE_TYPE_BIOS 0
-#define QEMU_FILE_TYPE_KEYMAP 1
-char *qemu_find_file(int type, const char *name);
-
extern int vm_running;
extern const char *qemu_name;
extern uint8_t qemu_uuid[];
@@ -100,12 +87,6 @@ int qemu_loadvm_state(QEMUFile *f);
/* SLIRP */
void do_info_slirp(Monitor *mon);
-/* OS specific functions */
-void os_setup_early_signal_handling(void);
-char *os_find_datadir(const char *argv0);
-void os_parse_cmd_args(int index, const char *optarg);
-void os_pidfile_error(void);
-
typedef enum DisplayType
{
DT_DEFAULT,
@@ -191,8 +172,6 @@ extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
-
void do_usb_add(Monitor *mon, const QDict *qdict);
void do_usb_del(Monitor *mon, const QDict *qdict);
void usb_info(Monitor *mon);
--
1.7.2.5
[-- Attachment #2: 0004-Move-generic-or-OS-function-declarations-to-qemu-com.patch --]
[-- Type: text/x-diff, Size: 3374 bytes --]
From 1b6c81353325046aeb36fe14efd6da644c20ec85 Mon Sep 17 00:00:00 2001
Message-Id: <1b6c81353325046aeb36fe14efd6da644c20ec85.1302295418.git.blauwirbel@gmail.com>
In-Reply-To: <6a1748c587d34b0ce37488596c68c4aee58a4638.1302295418.git.blauwirbel@gmail.com>
References: <6a1748c587d34b0ce37488596c68c4aee58a4638.1302295418.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sun, 27 Mar 2011 09:04:57 +0000
Subject: [PATCH 04/11] Move generic or OS function declarations to qemu-common.h
Move generic or OS related function declarations and macro
TFR to qemu-common.h.
While moving, also add #include <winsock2.h> to fix a
recent mingw32 build breakage.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
qemu-common.h | 21 +++++++++++++++++++++
sysemu.h | 21 ---------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/qemu-common.h b/qemu-common.h
index 82e27c1..8b48a09 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -12,6 +12,7 @@
#endif
#define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
+#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUFile QEMUFile;
@@ -39,6 +40,16 @@ typedef struct Monitor Monitor;
#include <sys/time.h>
#include <assert.h>
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include "qemu-os-win32.h"
+#endif
+
+#ifdef CONFIG_POSIX
+#include "qemu-os-posix.h"
+#endif
+
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
@@ -338,6 +349,16 @@ void qemu_progress_init(int enabled, float min_skip);
void qemu_progress_end(void);
void qemu_progress_print(float percent, int max);
+#define QEMU_FILE_TYPE_BIOS 0
+#define QEMU_FILE_TYPE_KEYMAP 1
+char *qemu_find_file(int type, const char *name);
+
+/* OS specific functions */
+void os_setup_early_signal_handling(void);
+char *os_find_datadir(const char *argv0);
+void os_parse_cmd_args(int index, const char *optarg);
+void os_pidfile_error(void);
+
/* Convert a byte between binary and BCD. */
static inline uint8_t to_bcd(uint8_t val)
{
diff --git a/sysemu.h b/sysemu.h
index bbbd0fd..f112c22 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -8,22 +8,9 @@
#include "qemu-timer.h"
#include "notify.h"
-#ifdef _WIN32
-#include <windows.h>
-#include "qemu-os-win32.h"
-#endif
-
-#ifdef CONFIG_POSIX
-#include "qemu-os-posix.h"
-#endif
-
/* vl.c */
extern const char *bios_name;
-#define QEMU_FILE_TYPE_BIOS 0
-#define QEMU_FILE_TYPE_KEYMAP 1
-char *qemu_find_file(int type, const char *name);
-
extern int vm_running;
extern const char *qemu_name;
extern uint8_t qemu_uuid[];
@@ -100,12 +87,6 @@ int qemu_loadvm_state(QEMUFile *f);
/* SLIRP */
void do_info_slirp(Monitor *mon);
-/* OS specific functions */
-void os_setup_early_signal_handling(void);
-char *os_find_datadir(const char *argv0);
-void os_parse_cmd_args(int index, const char *optarg);
-void os_pidfile_error(void);
-
typedef enum DisplayType
{
DT_DEFAULT,
@@ -191,8 +172,6 @@ extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
-
void do_usb_add(Monitor *mon, const QDict *qdict);
void do_usb_del(Monitor *mon, const QDict *qdict);
void usb_info(Monitor *mon);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [PATCH 04/11] Move generic or OS function declarations to qemu-common.h
2011-04-08 20:45 [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h Blue Swirl
@ 2011-04-08 21:09 ` Stefan Weil
2011-04-12 9:50 ` [Qemu-devel] " Jes Sorensen
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2011-04-08 21:09 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
Am 08.04.2011 22:45, schrieb Blue Swirl:
> Move generic or OS related function declarations and macro
> TFR to qemu-common.h.
>
> While moving, also add #include <winsock2.h> to fix a
> recent mingw32 build breakage.
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> qemu-common.h | 21 +++++++++++++++++++++
> sysemu.h | 21 ---------------------
> 2 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/qemu-common.h b/qemu-common.h
> index 82e27c1..8b48a09 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -12,6 +12,7 @@
> #endif
>
> #define QEMU_BUILD_BUG_ON(x) typedef char
> __build_bug_on__##__LINE__[(x)?-1:1];
> +#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
>
> typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUFile QEMUFile;
> @@ -39,6 +40,16 @@ typedef struct Monitor Monitor;
> #include <sys/time.h>
> #include <assert.h>
>
> +#ifdef _WIN32
> +#include <windows.h>
> +#include <winsock2.h>
> +#include "qemu-os-win32.h"
> +#endif
> +
As far as I could see, there is no file which includes qemu-os-win32.h
without including qemu-common.h.
So it is possible to move windows.h and winsock2.h to qemu-os-win32.h
This would reduce complexity of the common header qemu-common.h a little.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h
2011-04-08 20:45 [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h Blue Swirl
2011-04-08 21:09 ` [Qemu-devel] " Stefan Weil
@ 2011-04-12 9:50 ` Jes Sorensen
2011-04-15 20:17 ` Blue Swirl
1 sibling, 1 reply; 4+ messages in thread
From: Jes Sorensen @ 2011-04-12 9:50 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
On 04/08/11 22:45, Blue Swirl wrote:
> Move generic or OS related function declarations and macro
> TFR to qemu-common.h.
>
> While moving, also add #include <winsock2.h> to fix a
> recent mingw32 build breakage.
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> qemu-common.h | 21 +++++++++++++++++++++
> sysemu.h | 21 ---------------------
> 2 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/qemu-common.h b/qemu-common.h
> index 82e27c1..8b48a09 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -12,6 +12,7 @@
> #endif
>
> #define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
> +#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
>
> typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUFile QEMUFile;
> @@ -39,6 +40,16 @@ typedef struct Monitor Monitor;
> #include <sys/time.h>
> #include <assert.h>
>
> +#ifdef _WIN32
> +#include <windows.h>
> +#include <winsock2.h>
> +#include "qemu-os-win32.h"
> +#endif
> +
> +#ifdef CONFIG_POSIX
> +#include "qemu-os-posix.h"
> +#endif
> +
Nice, the more we can get out of the dreadful sysemu.h the better.
However, please put the includes of windows.h and winsock2.h into
qemu-os-win32.h instead.
Cheers,
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h
2011-04-12 9:50 ` [Qemu-devel] " Jes Sorensen
@ 2011-04-15 20:17 ` Blue Swirl
0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-04-15 20:17 UTC (permalink / raw)
To: Jes Sorensen; +Cc: qemu-devel
On Tue, Apr 12, 2011 at 12:50 PM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> On 04/08/11 22:45, Blue Swirl wrote:
>> Move generic or OS related function declarations and macro
>> TFR to qemu-common.h.
>>
>> While moving, also add #include <winsock2.h> to fix a
>> recent mingw32 build breakage.
>>
>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>> ---
>> qemu-common.h | 21 +++++++++++++++++++++
>> sysemu.h | 21 ---------------------
>> 2 files changed, 21 insertions(+), 21 deletions(-)
>>
>> diff --git a/qemu-common.h b/qemu-common.h
>> index 82e27c1..8b48a09 100644
>> --- a/qemu-common.h
>> +++ b/qemu-common.h
>> @@ -12,6 +12,7 @@
>> #endif
>>
>> #define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
>> +#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
>>
>> typedef struct QEMUTimer QEMUTimer;
>> typedef struct QEMUFile QEMUFile;
>> @@ -39,6 +40,16 @@ typedef struct Monitor Monitor;
>> #include <sys/time.h>
>> #include <assert.h>
>>
>> +#ifdef _WIN32
>> +#include <windows.h>
>> +#include <winsock2.h>
>> +#include "qemu-os-win32.h"
>> +#endif
>> +
>> +#ifdef CONFIG_POSIX
>> +#include "qemu-os-posix.h"
>> +#endif
>> +
>
> Nice, the more we can get out of the dreadful sysemu.h the better.
> However, please put the includes of windows.h and winsock2.h into
> qemu-os-win32.h instead.
Thanks for the comments, applied with the includes fixed.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-15 20:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08 20:45 [Qemu-devel] [PATCH 04/11] Move generic or OS function declarations to qemu-common.h Blue Swirl
2011-04-08 21:09 ` [Qemu-devel] " Stefan Weil
2011-04-12 9:50 ` [Qemu-devel] " Jes Sorensen
2011-04-15 20:17 ` 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).