Patchwork [10/11] Introduce machine state v2

login
register
mail settings
Submitter Blue Swirl
Date April 8, 2011, 8:49 p.m.
Message ID <BANLkTinoZ0v8t8eJivPcfHO2rOdrhPkZuA@mail.gmail.com>
Download mbox | patch
Permalink /patch/90422/
State New
Headers show

Comments

Blue Swirl - April 8, 2011, 8:49 p.m.
Move generic machine state to machine-state.h.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 machine-state.h |  102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sysemu.h        |   93 +-------------------------------------------------
 2 files changed, 103 insertions(+), 92 deletions(-)
 create mode 100644 machine-state.h

 #endif

Patch

From ce0f41a994c903d25d36606103a12eede84a80de Mon Sep 17 00:00:00 2001
Message-Id: <ce0f41a994c903d25d36606103a12eede84a80de.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: Sat, 26 Mar 2011 18:41:36 +0000
Subject: [PATCH 10/11] Introduce machine state v2

Move generic machine state to machine-state.h.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 machine-state.h |  102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sysemu.h        |   93 +-------------------------------------------------
 2 files changed, 103 insertions(+), 92 deletions(-)
 create mode 100644 machine-state.h

diff --git a/machine-state.h b/machine-state.h
new file mode 100644
index 0000000..52adbff
--- /dev/null
+++ b/machine-state.h
@@ -0,0 +1,102 @@ 
+#ifndef QEMU_MACHINE_STATE_H
+#define QEMU_MACHINE_STATE_H
+/*
+ * Machine state: All generic machine state.
+ */
+
+#include "notify.h"
+#include "qemu-timer.h"
+#include "qdict.h"
+
+extern const char *bios_name;
+extern uint8_t qemu_uuid[];
+int qemu_uuid_parse(const char *str, uint8_t *uuid);
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+
+void qemu_system_reset_request(void);
+void qemu_system_shutdown_request(void);
+void qemu_system_powerdown_request(void);
+void qemu_system_debug_request(void);
+int qemu_shutdown_requested(void);
+int qemu_reset_requested(void);
+int qemu_powerdown_requested(void);
+extern qemu_irq qemu_system_powerdown;
+void qemu_system_reset(void);
+
+void qemu_add_machine_init_done_notifier(Notifier *notify);
+
+extern int bios_size;
+
+typedef enum {
+    VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
+} VGAInterfaceType;
+
+extern int vga_interface_type;
+#define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
+#define std_vga_enabled (vga_interface_type == VGA_STD)
+#define xenfb_enabled (vga_interface_type == VGA_XENFB)
+#define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
+#define qxl_enabled (vga_interface_type == VGA_QXL)
+
+extern int graphic_width;
+extern int graphic_height;
+extern int graphic_depth;
+extern uint8_t irq0override;
+extern int win2k_install_hack;
+extern int rtc_td_hack;
+extern int usb_enabled;
+extern int smp_cpus;
+extern int max_cpus;
+extern int graphic_rotate;
+extern int semihosting_enabled;
+extern int old_param;
+extern int boot_menu;
+extern QEMUClock *rtc_clock;
+
+#define MAX_NODES 64
+extern int nb_numa_nodes;
+extern uint64_t node_mem[MAX_NODES];
+extern uint64_t node_cpumask[MAX_NODES];
+
+#define MAX_OPTION_ROMS 16
+typedef struct QEMUOptionRom {
+    const char *name;
+    int32_t bootindex;
+} QEMUOptionRom;
+extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
+extern int nb_option_roms;
+
+#define MAX_PROM_ENVS 128
+extern const char *prom_envs[MAX_PROM_ENVS];
+extern unsigned int nb_prom_envs;
+
+/* pci-hotplug */
+void pci_device_hot_add(Monitor *mon, const QDict *qdict);
+void drive_hot_add(Monitor *mon, const QDict *qdict);
+void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
+
+/* pcie aer error injection */
+void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
+int do_pcie_aer_inejct_error(Monitor *mon,
+                             const QDict *qdict, QObject **ret_data);
+
+/* serial ports */
+
+#define MAX_SERIAL_PORTS 4
+
+extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+
+/* parallel ports */
+
+#define MAX_PARALLEL_PORTS 3
+
+extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
+
+void rtc_change_mon_event(struct tm *tm);
+
+void register_devices(void);
+
+void add_boot_device_path(int32_t bootindex, DeviceState *dev,
+                          const char *suffix);
+char *get_boot_devices_list(uint32_t *size);
+#endif
diff --git a/sysemu.h b/sysemu.h
index 2d7a476..815ff34 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -9,97 +9,6 @@ 
 #include "notify.h"
 #include "host-state.h"
 #include "emulator-state.h"
+#include "machine-state.h"
 
-/* vl.c */
-extern const char *bios_name;
-extern uint8_t qemu_uuid[];
-int qemu_uuid_parse(const char *str, uint8_t *uuid);
-#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
-
-void qemu_system_reset_request(void);
-void qemu_system_shutdown_request(void);
-void qemu_system_powerdown_request(void);
-void qemu_system_debug_request(void);
-int qemu_shutdown_requested(void);
-int qemu_reset_requested(void);
-int qemu_powerdown_requested(void);
-extern qemu_irq qemu_system_powerdown;
-void qemu_system_reset(void);
-
-void qemu_add_machine_init_done_notifier(Notifier *notify);
-
-extern int bios_size;
-
-typedef enum {
-    VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
-} VGAInterfaceType;
-
-extern int vga_interface_type;
-#define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
-#define std_vga_enabled (vga_interface_type == VGA_STD)
-#define xenfb_enabled (vga_interface_type == VGA_XENFB)
-#define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
-#define qxl_enabled (vga_interface_type == VGA_QXL)
-
-extern int graphic_width;
-extern int graphic_height;
-extern int graphic_depth;
-extern uint8_t irq0override;
-extern int win2k_install_hack;
-extern int rtc_td_hack;
-extern int usb_enabled;
-extern int smp_cpus;
-extern int max_cpus;
-extern int graphic_rotate;
-extern int semihosting_enabled;
-extern int old_param;
-extern int boot_menu;
-extern QEMUClock *rtc_clock;
-
-#define MAX_NODES 64
-extern int nb_numa_nodes;
-extern uint64_t node_mem[MAX_NODES];
-extern uint64_t node_cpumask[MAX_NODES];
-
-#define MAX_OPTION_ROMS 16
-typedef struct QEMUOptionRom {
-    const char *name;
-    int32_t bootindex;
-} QEMUOptionRom;
-extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
-extern int nb_option_roms;
-
-#define MAX_PROM_ENVS 128
-extern const char *prom_envs[MAX_PROM_ENVS];
-extern unsigned int nb_prom_envs;
-
-/* pci-hotplug */
-void pci_device_hot_add(Monitor *mon, const QDict *qdict);
-void drive_hot_add(Monitor *mon, const QDict *qdict);
-void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
-
-/* pcie aer error injection */
-void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
-int do_pcie_aer_inejct_error(Monitor *mon,
-                             const QDict *qdict, QObject **ret_data);
-
-/* serial ports */
-
-#define MAX_SERIAL_PORTS 4
-
-extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
-
-/* parallel ports */
-
-#define MAX_PARALLEL_PORTS 3
-
-extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-
-void rtc_change_mon_event(struct tm *tm);
-
-void register_devices(void);
-
-void add_boot_device_path(int32_t bootindex, DeviceState *dev,
-                          const char *suffix);
-char *get_boot_devices_list(uint32_t *size);
 #endif
-- 
1.7.2.5