From 07fcd59de63ab3917d0f28d876cb1d2dcbbeb2a8 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Thu, 3 Mar 2016 17:24:12 +0800 Subject: pc-dimm: correct comment of MemoryHotplugState correct comment and remove an unused macro. commit adcb4ee6 already correct its type Signed-off-by: Cao jin Signed-off-by: Eduardo Habkost --- include/hw/mem/pc-dimm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 218dfb0..8cdc326 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -20,8 +20,6 @@ #include "sysemu/hostmem.h" #include "hw/qdev.h" -#define DEFAULT_PC_DIMMSIZE (1024*1024*1024) - #define TYPE_PC_DIMM "pc-dimm" #define PC_DIMM(obj) \ OBJECT_CHECK(PCDIMMDevice, (obj), TYPE_PC_DIMM) @@ -72,7 +70,7 @@ typedef struct PCDIMMDeviceClass { /** * MemoryHotplugState: - * @base: address in guest RAM address space where hotplug memory + * @base: address in guest physical address space where hotplug memory * address space begins. * @mr: hotplug memory address space container */ -- cgit v1.1 From 8c9a2b71de67742b40870da22abeccab57c81924 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 28 Oct 2015 19:19:58 -0200 Subject: vl: Table-based select_vgahw() Instead of implementing separate check functions for each vga interface type, add a table enumerating the possible VGA interfaces. Reviewed-by: Eric Blake Reviewed-by: Marcel Apfelbaum Signed-off-by: Eduardo Habkost --- include/sysemu/sysemu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 38fb3ca..2033f8c 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -146,6 +146,7 @@ extern int autostart; typedef enum { VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO, + VGA_TYPE_MAX, } VGAInterfaceType; extern int vga_interface_type; -- cgit v1.1 From 7b7d2be50c9c0f125b0025024b7048df87ac36bb Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:17 -0300 Subject: vl: Add DT_COCOA DisplayType value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of reusing DT_SDL for Cocoa, use DT_COCOA to indicate that a Cocoa display was requested. configure already ensures CONFIG_COCOA and CONFIG_SDL are never set at the same time. The only case where DT_SDL is used outside a #ifdef CONFIG_SDL block is in the no_frame/alt_grab/ctrl_grab check. That means the only user-visible change is that we will start printing a warning if the SDL-specific options are used in Cocoa mode. This is a bugfix, because no_frame/alt_grab/ctrl_grab are not used by Cocoa code. Cc: Andreas Färber Cc: Peter Maydell Acked-by: Andreas Färber Signed-off-by: Eduardo Habkost --- include/sysemu/sysemu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 2033f8c..90766da 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -136,6 +136,7 @@ typedef enum DisplayType DT_DEFAULT, DT_CURSES, DT_SDL, + DT_COCOA, DT_GTK, DT_NOGRAPHIC, DT_NONE, -- cgit v1.1 From f8c75b2486d62bf1cbe824aa4c471118061bdcd3 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:18 -0300 Subject: vnc: Initialization stubs This reduces the number of CONFIG_VNC #ifdefs in the vl.c code. The only user-visible difference is that this will make QEMU complain about syntax when using "-display vnc" ("VNC requires a display argument vnc=") even if CONFIG_VNC is disabled. Signed-off-by: Eduardo Habkost --- include/ui/console.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index d5a88d9..6640348 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -6,6 +6,8 @@ #include "qapi/qmp/qdict.h" #include "qemu/notify.h" #include "qapi-types.h" +#include "qemu/error-report.h" +#include "qapi/error.h" #ifdef CONFIG_OPENGL # include @@ -430,10 +432,10 @@ void cocoa_display_init(DisplayState *ds, int full_screen); void vnc_display_init(const char *id); void vnc_display_open(const char *id, Error **errp); void vnc_display_add_client(const char *id, int csock, bool skipauth); -char *vnc_display_local_addr(const char *id); #ifdef CONFIG_VNC int vnc_display_password(const char *id, const char *password); int vnc_display_pw_expire(const char *id, time_t expires); +char *vnc_display_local_addr(const char *id); QemuOpts *vnc_parse(const char *str, Error **errp); int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); #else @@ -445,6 +447,22 @@ static inline int vnc_display_pw_expire(const char *id, time_t expires) { return -ENODEV; }; +static inline QemuOpts *vnc_parse(const char *str, Error **errp) +{ + error_setg(errp, "VNC support is disabled"); + return NULL; +} +static inline int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) +{ + error_setg(errp, "VNC support is disabled"); + return -1; +} +static inline char *vnc_display_local_addr(const char *id) +{ + /* This must never be called if CONFIG_VNC is disabled */ + error_report("VNC support is disabled"); + abort(); +} #endif /* curses.c */ -- cgit v1.1 From 674ec686936fcde6977616dce2a68b42533ab2d7 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:19 -0300 Subject: curses: curses_display_init() stub One less #ifdef in vl.c. Signed-off-by: Eduardo Habkost --- include/ui/console.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 6640348..f5fa9cb 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -466,7 +466,16 @@ static inline char *vnc_display_local_addr(const char *id) #endif /* curses.c */ +#ifdef CONFIG_CURSES void curses_display_init(DisplayState *ds, int full_screen); +#else +static inline void curses_display_init(DisplayState *ds, int full_screen) +{ + /* This must never be called if CONFIG_CURSES is disabled */ + error_report("curses support is disabled"); + abort(); +} +#endif /* input.c */ int index_from_key(const char *key, size_t key_length); -- cgit v1.1 From 476db0814d8953e6c5f2dd0299249be3a751fc6a Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:20 -0300 Subject: sdl: Initialization stubs This reduces the number of CONFIG_SDL #ifdefs in vl.c. Signed-off-by: Eduardo Habkost --- include/ui/console.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index f5fa9cb..f3e749d 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -422,8 +422,24 @@ void surface_gl_setup_viewport(ConsoleGLState *gls, #endif /* sdl.c */ +#ifdef CONFIG_SDL void sdl_display_early_init(int opengl); void sdl_display_init(DisplayState *ds, int full_screen, int no_frame); +#else +static inline void sdl_display_early_init(int opengl) +{ + /* This must never be called if CONFIG_SDL is disabled */ + error_report("SDL support is disabled"); + abort(); +} +static inline void sdl_display_init(DisplayState *ds, int full_screen, + int no_frame) +{ + /* This must never be called if CONFIG_SDL is disabled */ + error_report("SDL support is disabled"); + abort(); +} +#endif /* cocoa.m */ void cocoa_display_init(DisplayState *ds, int full_screen); -- cgit v1.1 From e35ee7c1aa1f257d3e0e52422cf4bd79d3b68d58 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:21 -0300 Subject: cocoa: cocoa_display_init() stub One less #ifdef in vl.c. Signed-off-by: Eduardo Habkost --- include/ui/console.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index f3e749d..7ac997f 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -442,7 +442,16 @@ static inline void sdl_display_init(DisplayState *ds, int full_screen, #endif /* cocoa.m */ +#ifdef CONFIG_COCOA void cocoa_display_init(DisplayState *ds, int full_screen); +#else +static inline void cocoa_display_init(DisplayState *ds, int full_screen) +{ + /* This must never be called if CONFIG_COCOA is disabled */ + error_report("Cocoa support is disabled"); + abort(); +} +#endif /* vnc.c */ void vnc_display_init(const char *id); -- cgit v1.1 From 19a2c6269f2e81d3aecdddb4d77fb674f9ca8fa3 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:22 -0300 Subject: gtk: Initialization stubs This reduces the number of CONFIG_GTK #ifdefs in vl.c. Signed-off-by: Eduardo Habkost --- include/ui/console.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 7ac997f..52a5f65 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -506,7 +506,24 @@ static inline void curses_display_init(DisplayState *ds, int full_screen) int index_from_key(const char *key, size_t key_length); /* gtk.c */ +#ifdef CONFIG_GTK void early_gtk_display_init(int opengl); void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover); +#else +static inline void gtk_display_init(DisplayState *ds, bool full_screen, + bool grab_on_hover) +{ + /* This must never be called if CONFIG_GTK is disabled */ + error_report("GTK support is disabled"); + abort(); +} + +static inline void early_gtk_display_init(int opengl) +{ + /* This must never be called if CONFIG_GTK is disabled */ + error_report("GTK support is disabled"); + abort(); +} +#endif #endif -- cgit v1.1 From 6f0c894c25e42454e9065fc4e5cc22c251cea30d Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:23 -0300 Subject: spice: Initialization stubs on qemu-spice.h This reduces the number of CONFIG_SPICE #ifdefs in vl.c. Cc: Gerd Hoffmann Reviewed-by: Gerd Hoffmann Signed-off-by: Eduardo Habkost --- include/ui/qemu-spice.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index aa24363..57ac91b 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -51,6 +51,8 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name) #else /* CONFIG_SPICE */ +#include "qemu/error-report.h" + #define using_spice 0 #define spice_displays 0 static inline int qemu_spice_set_passwd(const char *passwd, @@ -75,6 +77,17 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth, return -1; } +static inline void qemu_spice_display_init(void) +{ + /* This must never be called if CONFIG_SPICE is disabled */ + error_report("spice support is disabled"); + abort(); +} + +static inline void qemu_spice_init(void) +{ +} + #endif /* CONFIG_SPICE */ static inline bool qemu_using_spice(Error **errp) -- cgit v1.1 From cfc58cf37362a931990efc75f3f580dfec49ac1e Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:25 -0300 Subject: vl: Replace DT_NOGRAPHIC with machine option All DisplayType values are just UI options that don't affect any hardware emulation code, except for DT_NOGRAPHIC. Replace DT_NOGRAPHIC with DT_NONE plus a new "-machine graphics=on|off" option, so hardware emulation code don't need to use the display_type variable. Cc: Michael Walle Cc: Blue Swirl Cc: Mark Cave-Ayland Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 1 + include/sysemu/sysemu.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hw/boards.h b/include/hw/boards.h index 8d4fe56..f968a25 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -154,6 +154,7 @@ struct MachineState { bool iommu; bool suppress_vmdesc; bool enforce_config_section; + bool enable_graphics; ram_addr_t ram_size; ram_addr_t maxram_size; diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 90766da..6076b80 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -138,7 +138,6 @@ typedef enum DisplayType DT_SDL, DT_COCOA, DT_GTK, - DT_NOGRAPHIC, DT_NONE, } DisplayType; -- cgit v1.1 From d29345d011114b90f0a6871fb0d46a7741c6c33c Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:26 -0300 Subject: vl: Make display_type a local variable Now display_type is only used inside main(), and don't need to be a global variable. Signed-off-by: Eduardo Habkost --- include/sysemu/sysemu.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 6076b80..7e9f93e 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -155,7 +155,6 @@ extern int vga_interface_type; extern int graphic_width; extern int graphic_height; extern int graphic_depth; -extern DisplayType display_type; extern int display_opengl; extern const char *keyboard_layout; extern int win2k_install_hack; -- cgit v1.1 From 0cb48c4678af6e1fedbb48c52e5baa01f7266f54 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 19 Apr 2016 16:55:27 -0300 Subject: vl: Move DisplayType typedef to vl.c Now the type is only used inside vl.c and doesn't need to be in a header file. Signed-off-by: Eduardo Habkost --- include/sysemu/sysemu.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 7e9f93e..618169c 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -131,16 +131,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name, int qemu_loadvm_state(QEMUFile *f); -typedef enum DisplayType -{ - DT_DEFAULT, - DT_CURSES, - DT_SDL, - DT_COCOA, - DT_GTK, - DT_NONE, -} DisplayType; - extern int autostart; typedef enum { -- cgit v1.1 From bacc344c548ce165a0001276ece56ee4b0bddae3 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Thu, 28 Jan 2016 11:58:08 +0100 Subject: machine: add properties to compat_props incrementaly Switch to adding compat properties incrementaly instead of completly overwriting compat_props per machine type. That removes data duplication which we have due to nested [PC|SPAPR]_COMPAT_* macros. It also allows to set default device properties from default foo_machine_options() hook, which will be used in following patch for putting VMGENID device as a function if ISA bridge on pc/q35 machines. Suggested-by: Eduardo Habkost Signed-off-by: Igor Mammedov Acked-by: Cornelia Huck Reviewed-by: Eduardo Habkost [ehabkost: Fixed CCW_COMPAT_* and PC_COMPAT_0_* defines] Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 11 +++++++++-- include/hw/i386/pc.h | 9 --------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/hw/boards.h b/include/hw/boards.h index f968a25..d268bd0 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -114,7 +114,7 @@ struct MachineClass { const char *default_machine_opts; const char *default_boot_order; const char *default_display; - GlobalProperty *compat_props; + GArray *compat_props; const char *hw_version; ram_addr_t default_ram_size; bool option_rom_has_mr; @@ -186,11 +186,18 @@ struct MachineState { #define SET_MACHINE_COMPAT(m, COMPAT) \ do { \ + int i; \ static GlobalProperty props[] = { \ COMPAT \ { /* end of list */ } \ }; \ - (m)->compat_props = props; \ + if (!m->compat_props) { \ + m->compat_props = g_array_new(false, false, sizeof(void *)); \ + } \ + for (i = 0; props[i].driver != NULL; i++) { \ + GlobalProperty *prop = &props[i]; \ + g_array_append_val(m->compat_props, prop); \ + } \ } while (0) #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 96f0b66..367b6db 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -360,7 +360,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); HW_COMPAT_2_5 #define PC_COMPAT_2_4 \ - PC_COMPAT_2_5 \ HW_COMPAT_2_4 \ {\ .driver = "Haswell-" TYPE_X86_CPU,\ @@ -431,7 +430,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_3 \ - PC_COMPAT_2_4 \ HW_COMPAT_2_3 \ {\ .driver = TYPE_X86_CPU,\ @@ -512,7 +510,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_2_2 \ - PC_COMPAT_2_3 \ HW_COMPAT_2_2 \ {\ .driver = "kvm64" "-" TYPE_X86_CPU,\ @@ -606,7 +603,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_2_1 \ - PC_COMPAT_2_2 \ HW_COMPAT_2_1 \ {\ .driver = "coreduo" "-" TYPE_X86_CPU,\ @@ -620,7 +616,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_2_0 \ - PC_COMPAT_2_1 \ {\ .driver = "virtio-scsi-pci",\ .property = "any_layout",\ @@ -680,7 +675,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_7 \ - PC_COMPAT_2_0 \ {\ .driver = TYPE_USB_DEVICE,\ .property = "msos-desc",\ @@ -698,7 +692,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_6 \ - PC_COMPAT_1_7 \ {\ .driver = "e1000",\ .property = "mitigation",\ @@ -722,7 +715,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_5 \ - PC_COMPAT_1_6 \ {\ .driver = "Conroe-" TYPE_X86_CPU,\ .property = "model",\ @@ -766,7 +758,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_4 \ - PC_COMPAT_1_5 \ {\ .driver = "scsi-hd",\ .property = "discard_granularity",\ -- cgit v1.1