Machine Core queue, 2016-05-20
[Qemu-devel] [PULL 19/21] vl: Use &error_fatal when parsing VNC options
In reply to Eduardo Habkost--- vl.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
vl.c +2 -13
@@ -2151,11 +2151,7 @@ static DisplayType select_display(const char *p)#endif }else if (strstart (p,"vnc" , &opts)) {if (*opts =='=' ) { -Error *err =NULL ; -if (vnc_parse (opts +1 , &err) ==NULL ) { -error_report_err (err); -exit (1 ); - } +vnc_parse (opts +1 , &error_fatal); }else {error_report ("VNC requires a display argument vnc=<display>" );exit (1 );
@@ -3709,15 +3705,8 @@ int main(int argc, char **argv, char **envp) }break ;case QEMU_OPTION_vnc: - { -Error *local_err =NULL ; - -if (vnc_parse (optarg, &local_err) ==NULL ) { -error_report_err (local_err); -exit (1 ); - } +vnc_parse (optarg, &error_fatal);break ; - }case QEMU_OPTION_no_acpi: acpi_enabled =0 ;break ;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 07/21] curses: curses_display_init() stub
In reply to Eduardo HabkostOne less #ifdef in vl.c.
--- include/ui/console.h | 9 +++++++++ vl.c | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-)
include/ui/console.h +9 -0
@@ -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);
vl.c +0 -2
@@ -4540,11 +4540,9 @@ int main(int argc, char **argv, char **envp)case DT_NOGRAPHIC : (void )ds;/* avoid warning if no display is configured */ break ; -#if defined(CONFIG_CURSES )case DT_CURSES :curses_display_init (ds, full_screen);break ; -#endif #if defined(CONFIG_SDL )case DT_SDL :sdl_display_init (ds, full_screen, no_frame);
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 09/21] cocoa: cocoa_display_init() stub
In reply to Eduardo HabkostOne less #ifdef in vl.c.
--- include/ui/console.h | 9 +++++++++ vl.c | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-)
include/ui/console.h +9 -0
@@ -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);
vl.c +0 -2
@@ -4545,11 +4545,9 @@ int main(int argc, char **argv, char **envp)case DT_SDL :sdl_display_init (ds, full_screen, no_frame);break ; -#if defined(CONFIG_COCOA )case DT_COCOA :cocoa_display_init (ds, full_screen);break ; -#endif #if defined(CONFIG_GTK )case DT_GTK :gtk_display_init (ds, full_screen, grab_on_hover);
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 08/21] sdl: Initialization stubs
In reply to Eduardo HabkostThis reduces the number of CONFIG_SDL #ifdefs in vl.c.
--- include/ui/console.h | 16 ++++++++++++++++ vl.c | 6 ++---- 2 files changed, 18 insertions(+), 4 deletions(-)
include/ui/console.h +16 -0
@@ -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);
vl.c +2 -4
@@ -4251,11 +4251,10 @@ int main(int argc, char **argv, char **envp) early_gtk_display_init(request_opengl); }#endif -#if defined(CONFIG_SDL )if (display_type ==DT_SDL ) {sdl_display_early_init (request_opengl); } -#endif +if (request_opengl ==1 && display_opengl ==0 ) {#if defined(CONFIG_OPENGL )error_report ("OpenGL is not supported by the display" );
@@ -4543,11 +4542,10 @@ int main(int argc, char **argv, char **envp)case DT_CURSES :curses_display_init (ds, full_screen);break ; -#if defined(CONFIG_SDL )case DT_SDL :sdl_display_init (ds, full_screen, no_frame);break ; -#elif defined(CONFIG_COCOA ) +#if defined(CONFIG_COCOA )case DT_COCOA :cocoa_display_init (ds, full_screen);break ;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 20/21] vl: Use &error_fatal when parsing monitor options
In reply to Eduardo Habkost--- vl.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
vl.c +1 -6
@@ -2404,7 +2404,6 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)static void monitor_parse (const char *optarg,const char *mode,bool pretty) {static int monitor_device_index =0 ; -Error *local_err =NULL ;QemuOpts *opts;const char *p;char label[32 ];
@@ -2425,11 +2424,7 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty) } } - opts =qemu_opts_create (qemu_find_opts ("mon" ), label,1 , &local_err); -if (!opts) { -error_report_err (local_err); -exit (1 ); - } + opts =qemu_opts_create (qemu_find_opts ("mon" ), label,1 , &error_fatal);qemu_opt_set (opts,"mode" , mode, &error_abort);qemu_opt_set (opts,"chardev" , label, &error_abort);qemu_opt_set_bool (opts,"pretty" , pretty, &error_abort);
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 21/21] Use &error_fatal when initializing crypto on qemu-{img, io, nbd}
In reply to Eduardo HabkostIn addition to making the code simpler, this will replace the long error messages:
cannot initialize crypto: Unable to initialize GNUTLS library: [...] cannot initialize crypto: Unable to initialize gcrypt
with shorter messages:
Unable to initialize GNUTLS library: [...]
Unable to initialize gcrypt
--- qemu-img.c | 5 +---- qemu-io.c | 5 +---- qemu-nbd.c | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-)
qemu-img.c +1 -4
@@ -3492,10 +3492,7 @@ int main(int argc, char **argv)exit (EXIT_FAILURE ); } -if (qcrypto_init (&local_error) <0 ) { -error_reportf_err (local_error,"cannot initialize crypto: " ); -exit (1 ); - } +qcrypto_init (&error_fatal);module_call_init (MODULE_INIT_QOM );bdrv_init ();
qemu-io.c +1 -4
@@ -466,10 +466,7 @@ int main(int argc, char **argv) progname =basename (argv[0 ]);qemu_init_exec_dir (argv[0 ]); -if (qcrypto_init (&local_error) <0 ) { -error_reportf_err (local_error,"cannot initialize crypto: " ); -exit (1 ); - } +qcrypto_init (&error_fatal);module_call_init (MODULE_INIT_QOM );qemu_add_opts (&qemu_object_opts);
qemu-nbd.c +1 -4
@@ -527,10 +527,7 @@ int main(int argc, char **argv) sa_sigterm.sa_handler = termsig_handler;sigaction (SIGTERM , &sa_sigterm,NULL ); -if (qcrypto_init (&local_err) <0 ) { -error_reportf_err (local_err,"cannot initialize crypto: " ); -exit (1 ); - } +qcrypto_init (&error_fatal);module_call_init (MODULE_INIT_QOM );qemu_add_opts (&qemu_object_opts);
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 02/21] vl: Use exit(1) when requested VGA interface is unavailable
In reply to Eduardo HabkostInstead of using exit(0), use exit(1) when an unavailable VGA interface is used in the command-line to indicate it's an error.
--- vl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
vl.c +7 -7
@@ -2027,28 +2027,28 @@ static void select_vgahw (const char *p) vga_interface_type =VGA_STD ; }else {error_report ("standard VGA not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"cirrus" , &opts)) {if (cirrus_vga_available ()) { vga_interface_type =VGA_CIRRUS ; }else {error_report ("Cirrus VGA not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"vmware" , &opts)) {if (vmware_vga_available ()) { vga_interface_type =VGA_VMWARE ; }else {error_report ("VMWare SVGA not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"virtio" , &opts)) {if (virtio_vga_available ()) { vga_interface_type =VGA_VIRTIO ; }else {error_report ("Virtio VGA not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"xenfb" , &opts)) { vga_interface_type =VGA_XENFB ;
@@ -2057,21 +2057,21 @@ static void select_vgahw (const char *p) vga_interface_type =VGA_QXL ; }else {error_report ("QXL VGA not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"tcx" , &opts)) {if (tcx_vga_available ()) { vga_interface_type =VGA_TCX ; }else {error_report ("TCX framebuffer not available" ); -exit (0 ); +exit (1 ); } }else if (strstart (p,"cg3" , &opts)) {if (cg3_vga_available ()) { vga_interface_type =VGA_CG3 ; }else {error_report ("CG3 framebuffer not available" ); -exit (0 ); +exit (1 ); } }else if (!strstart (p,"none" , &opts)) { invalid_vga:
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 03/21] vl: Table-based select_vgahw()
In reply to Eduardo HabkostInstead of implementing separate check functions for each vga interface type, add a table enumerating the possible VGA interfaces.
--- include/sysemu/sysemu.h | 1 + vl.c | 115 ++++++++++++++++++++++++++---------------------- 2 files changed, 64 insertions(+), 52 deletions(-)
include/sysemu/sysemu.h +1 -0
@@ -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;
vl.c +63 -52
126 lines not on this page · raw message
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 04/21] vl: Replace *_vga_available() functions with class_names field
In reply to Eduardo HabkostInstead of requiring a separate function for each VGA interface, just enumerate the corresponding class names on struct VGAInterfaceInfo.
--- vl.c | 70 +++++++++++++++++++++++--------------------------------------------- 1 file changed, 23 insertions(+), 47 deletions(-)
vl.c +23 -47
@@ -1981,46 +1981,12 @@ static const QEMUOption qemu_options[] = { { NULL }, }; -static bool vga_available (void ) -{ -return object_class_by_name ("VGA" ) ||object_class_by_name ("isa-vga" ); -} - -static bool cirrus_vga_available (void ) -{ -return object_class_by_name ("cirrus-vga" ) - ||object_class_by_name ("isa-cirrus-vga" ); -} - -static bool vmware_vga_available (void ) -{ -return object_class_by_name ("vmware-svga" ); -} - -static bool qxl_vga_available (void ) -{ -return object_class_by_name ("qxl-vga" ); -} - -static bool tcx_vga_available (void ) -{ -return object_class_by_name ("SUNW,tcx" ); -} - -static bool cg3_vga_available (void ) -{ -return object_class_by_name ("cgthree" ); -} - -static bool virtio_vga_available (void ) -{ -return object_class_by_name ("virtio-vga" ); -} -typedef struct VGAInterfaceInfo {const char *opt_name;/* option name */ const char *name;/* human-readable name */ -bool (*available)(void ); +/* Class names indicating that support is available. +* If no class is specified, the interface is always available */ +const char *class_names[2 ]; }VGAInterfaceInfo ; static VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] = {
@@ -2030,43 +1996,53 @@ static VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] = { [VGA_STD ] = { .opt_name ="std" , .name ="standard VGA" , - .available = vga_available, + .class_names = {"VGA" ,"isa-vga" }, }, [VGA_CIRRUS ] = { .opt_name ="cirrus" , .name ="Cirrus VGA" , - .available = cirrus_vga_available, + .class_names = {"cirrus-vga" ,"isa-cirrus-vga" }, }, [VGA_VMWARE ] = { .opt_name ="vmware" , .name ="VMWare SVGA" , - .available = vmware_vga_available, + .class_names = {"vmware-svga" }, }, [VGA_VIRTIO ] = { .opt_name ="virtio" , .name ="Virtio VGA" , - .available = virtio_vga_available, + .class_names = {"virtio-vga" }, }, [VGA_QXL ] = { .opt_name ="qxl" , .name ="QXL VGA" , - .available = qxl_vga_available, + .class_names = {"qxl-vga" }, }, [VGA_TCX ] = { .opt_name ="tcx" , .name ="TCX framebuffer" , - .available = tcx_vga_available, + .class_names = {"SUNW,tcx" }, }, [VGA_CG3 ] = { .opt_name ="cg3" , .name ="CG3 framebuffer" , - .available = cg3_vga_available, + .class_names = {"cgthree" }, }, [VGA_XENFB ] = { .opt_name ="xenfb" , }, }; +static bool vga_interface_available (VGAInterfaceType t) +{ +VGAInterfaceInfo *ti = &vga_interfaces[t]; + +assert (t <VGA_TYPE_MAX ); +return !ti->class_names[0 ] || +object_class_by_name (ti->class_names[0 ]) || +object_class_by_name (ti->class_names[1 ]); +} +static void select_vgahw (const char *p) {const char *opts;
@@ -2076,7 +2052,7 @@ static void select_vgahw(const char *p)for (t =0 ; t <VGA_TYPE_MAX ; t++) {VGAInterfaceInfo *ti = &vga_interfaces[t];if (ti->opt_name &&strstart (p, ti->opt_name, &opts)) { -if (ti->available && !ti->available ()) { +if (!vga_interface_available (t)) {error_report ("%s not available" , ti->name);exit (1 ); }
@@ -4492,9 +4468,9 @@ int main(int argc, char **argv, char **envp)if (default_vga) {if (machine_class->default_display) { vga_model = machine_class->default_display; - }else if (cirrus_vga_available ()) { + }else if (vga_interface_available (VGA_CIRRUS )) { vga_model ="cirrus" ; - }else if (vga_available ()) { + }else if (vga_interface_available (VGA_STD )) { vga_model ="std" ; } }
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 06/21] vnc: Initialization stubs
In reply to Eduardo HabkostThis 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=<display>") even if CONFIG_VNC is disabled.
--- include/ui/console.h | 20 +++++++++++++++++++- vl.c | 15 +-------------- 2 files changed, 20 insertions(+), 15 deletions(-)
include/ui/console.h +19 -1
@@ -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 <epoxy/gl.h>
@@ -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 */
vl.c +1 -14
@@ -2148,7 +2148,6 @@ static DisplayType select_display(const char *p)exit (1 );#endif }else if (strstart (p,"vnc" , &opts)) { -#ifdef CONFIG_VNC if (*opts =='=' ) {Error *err =NULL ;if (vnc_parse (opts +1 , &err) ==NULL ) {
@@ -2159,10 +2158,6 @@ static DisplayType select_display(const char *p)error_report ("VNC requires a display argument vnc=<display>" );exit (1 ); } -#else -error_report ("VNC support is disabled" ); -exit (1 ); -#endif }else if (strstart (p,"curses" , &opts)) {#ifdef CONFIG_CURSES display =DT_CURSES ;
@@ -2966,9 +2961,7 @@ int main(int argc, char **argv, char **envp)const char *qtest_log =NULL ;const char *pid_file =NULL ;const char *incoming =NULL ; -#ifdef CONFIG_VNC int show_vnc_port =0 ; -#endif bool defconfig = true;bool userconfig = true;const char *log_mask =NULL ;
@@ -3715,17 +3708,12 @@ int main(int argc, char **argv, char **envp)break ;case QEMU_OPTION_vnc: { -#ifdef CONFIG_VNC Error *local_err =NULL ;if (vnc_parse (optarg, &local_err) ==NULL ) {error_report_err (local_err);exit (1 ); } -#else -error_report ("VNC support is disabled" ); -exit (1 ); -#endif break ; }case QEMU_OPTION_no_acpi:
@@ -4578,7 +4566,6 @@ int main(int argc, char **argv, char **envp)/* must be after terminal init, SDL library changes signal handlers */ os_setup_signal_handling (); -#ifdef CONFIG_VNC /* init remote displays */ qemu_opts_foreach (qemu_find_opts ("vnc" ), vnc_init_func,NULL ,NULL );
@@ -4587,7 +4574,7 @@ int main(int argc, char **argv, char **envp)printf ("VNC server running on '%s'\n" , ret);g_free (ret); } -#endif +#ifdef CONFIG_SPICE if (using_spice) {qemu_spice_display_init ();
Signature · 1 line
2.5.5
The following changes since commit 65603e2fc18b48e6e55a3dd693669413141694ec:
tci: do not include exec/exec-all.h (2016-05-20 15:07:46 +0100)
are available in the git repository at:
git://github.com/ehabkost/qemu.git tags/machine-pull-request
for you to fetch changes up to e8f2d2722eb84a809697e82c762d39c8c13f22f6:
Use &error_fatal when initializing crypto on qemu-{img,io,nbd} (2016-05-20 14:28:55 -0300)
----------------------------------------------------------------
Machine Core queue, 2016-05-20
----------------------------------------------------------------
Cao jin (1):
pc-dimm: correct comment of MemoryHotplugState
Eduardo Habkost (19):
vl: Use exit(1) when requested VGA interface is unavailable
vl: Table-based select_vgahw()
vl: Replace *_vga_available() functions with class_names field
vl: Add DT_COCOA DisplayType value
vnc: Initialization stubs
curses: curses_display_init() stub
sdl: Initialization stubs
cocoa: cocoa_display_init() stub
gtk: Initialization stubs
spice: Initialization stubs on qemu-spice.h
milkymist: Move DT_NOGRAPHIC check outside milkymist_tmu2_create()
vl: Replace DT_NOGRAPHIC with machine option
vl: Make display_type a local variable
vl: Move DisplayType typedef to vl.c
vl: Make display_remote a local variable
vl: Simplify global property registration
vl: Use &error_fatal when parsing VNC options
vl: Use &error_fatal when parsing monitor options
Use &error_fatal when initializing crypto on qemu-{img,io,nbd}
Igor Mammedov (1):
machine: add properties to compat_props incrementaly
hw/arm/virt.c | 4 - hw/core/machine.c | 31 +++++ hw/i386/pc_piix.c | 13 -- hw/lm32/milkymist-hw.h | 4 - hw/lm32/milkymist.c | 4 +- hw/nvram/fw_cfg.c | 6 +- hw/ppc/spapr.c | 4 - hw/s390x/s390-virtio-ccw.c | 1 - hw/sparc/sun4m.c | 2 +- include/hw/boards.h | 12 +- include/hw/i386/pc.h | 9 -- include/hw/mem/pc-dimm.h | 4 +- include/sysemu/sysemu.h | 12 +- include/ui/console.h | 71 ++++++++++- include/ui/qemu-spice.h | 13 ++ qemu-img.c | 5 +- qemu-io.c | 5 +- qemu-nbd.c | 5 +- vl.c | 290 +++++++++++++++++++-------------------------- 19 files changed, 257 insertions(+), 238 deletions(-)
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 12/21] milkymist: Move DT_NOGRAPHIC check outside milkymist_tmu2_create()
DT_NOGRAPHIC handling will be moved to a MachineState field, and it will be easier to change milkymist_init() to check that field.
--- hw/lm32/milkymist-hw.h | 4 ---- hw/lm32/milkymist.c | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-)
hw/lm32/milkymist-hw.h +0 -4
@@ -108,10 +108,6 @@ static inline DeviceState *milkymist_tmu2_create(hwaddr base,int nelements;int ver_major, ver_minor; -if (display_type ==DT_NOGRAPHIC ) { -return NULL ; - } -/* check that GLX will work */ d =XOpenDisplay (NULL );if (d ==NULL ) {
hw/lm32/milkymist.c +3 -1
@@ -167,7 +167,9 @@ milkymist_init(MachineState *machine)milkymist_memcard_create (0x60004000 );milkymist_ac97_create (0x60005000 , irq[4 ], irq[5 ], irq[6 ], irq[7 ]);milkymist_pfpu_create (0x60006000 , irq[8 ]); -milkymist_tmu2_create (0x60007000 , irq[9 ]); +if (display_type !=DT_NOGRAPHIC ) { +milkymist_tmu2_create (0x60007000 , irq[9 ]); + }milkymist_minimac2_create (0x60008000 ,0x30000000 , irq[10 ], irq[11 ]);milkymist_softusb_create (0x6000f000 , irq[15 ],0x20000000 ,0x1000 ,0x20020000 ,0x2000 );
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 18/21] machine: add properties to compat_props incrementaly
In reply to Eduardo HabkostFrom: Igor Mammedov <[email protected]>
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.
--- hw/arm/virt.c | 4 ---- hw/core/machine.c | 10 ++++++++++ hw/i386/pc_piix.c | 13 ------------- hw/ppc/spapr.c | 4 ---- hw/s390x/s390-virtio-ccw.c | 1 - include/hw/boards.h | 11 +++++++++-- include/hw/i386/pc.h | 9 --------- vl.c | 6 +++++- 8 files changed, 24 insertions(+), 34 deletions(-)
hw/arm/virt.c +0 -4
@@ -1418,13 +1418,9 @@ static void virt_2_6_instance_init(Object *obj)static void virt_2_6_class_init (ObjectClass *oc,void *data) {MachineClass *mc =MACHINE_CLASS (oc); -static GlobalProperty compat_props[] = { - {/* end of list */ } - }; mc->desc ="QEMU 2.6 ARM Virtual Machine" ; mc->alias ="virt" ; - mc->compat_props = compat_props; }static const TypeInfo machvirt_info = {
hw/core/machine.c +10 -0
@@ -571,6 +571,15 @@ bool machine_mem_merge(MachineState *machine)return machine->mem_merge; } +static void machine_class_finalize (ObjectClass *klass,void *data) +{ +MachineClass *mc =MACHINE_CLASS (klass); + +if (mc->compat_props) { +g_array_free (mc->compat_props, true); + } +} +static const TypeInfo machine_info = { .name =TYPE_MACHINE , .parent =TYPE_OBJECT ,
@@ -578,6 +587,7 @@ static const TypeInfo machine_info = { .class_size = sizeof(MachineClass), .class_init = machine_class_init, .class_base_init = machine_class_base_init, + .class_finalize = machine_class_finalize, .instance_size = sizeof(MachineState), .instance_init = machine_initfn, .instance_finalize = machine_finalize,
hw/i386/pc_piix.c +0 -13
@@ -582,7 +582,6 @@ DEFINE_I440FX_MACHINE(v1_4, "pc-i440fx-1.4", pc_compat_1_4,#define PC_COMPAT_1_3 \ - PC_COMPAT_1_4 \ {\ .driver = "usb-tablet",\ .property = "usb_version",\
@@ -614,7 +613,6 @@ DEFINE_I440FX_MACHINE(v1_3, "pc-1.3", pc_compat_1_3,#define PC_COMPAT_1_2 \ - PC_COMPAT_1_3 \ {\ .driver = "nec-usb-xhci",\ .property = "msi",\
@@ -653,7 +651,6 @@ DEFINE_I440FX_MACHINE(v1_2, "pc-1.2", pc_compat_1_2,#define PC_COMPAT_1_1 \ - PC_COMPAT_1_2 \ {\ .driver = "virtio-scsi-pci",\ .property = "hotplug",\
@@ -696,7 +693,6 @@ DEFINE_I440FX_MACHINE(v1_1, "pc-1.1", pc_compat_1_2,#define PC_COMPAT_1_0 \ - PC_COMPAT_1_1 \ {\ .driver = TYPE_ISA_FDC,\ .property = "check_media_rate",\
@@ -726,14 +722,10 @@ DEFINE_I440FX_MACHINE(v1_0, "pc-1.0", pc_compat_1_2, pc_i440fx_1_0_machine_options); -#define PC_COMPAT_0_15 \ - PC_COMPAT_1_0 -static void pc_i440fx_0_15_machine_options (MachineClass *m) {pc_i440fx_1_0_machine_options (m); m->hw_version ="0.15" ; -SET_MACHINE_COMPAT (m,PC_COMPAT_0_15 ); } DEFINE_I440FX_MACHINE(v0_15, "pc-0.15", pc_compat_1_2,
@@ -741,7 +733,6 @@ DEFINE_I440FX_MACHINE(v0_15, "pc-0.15", pc_compat_1_2,#define PC_COMPAT_0_14 \ - PC_COMPAT_0_15 \ {\ .driver = "virtio-blk-pci",\ .property = "event_idx",\
@@ -780,7 +771,6 @@ DEFINE_I440FX_MACHINE(v0_14, "pc-0.14", pc_compat_1_2,#define PC_COMPAT_0_13 \ - PC_COMPAT_0_14 \ {\ .driver = TYPE_PCI_DEVICE,\ .property = "command_serr_enable",\
@@ -817,7 +807,6 @@ DEFINE_I440FX_MACHINE(v0_13, "pc-0.13", pc_compat_0_13,#define PC_COMPAT_0_12 \ - PC_COMPAT_0_13 \ {\ .driver = "virtio-serial-pci",\ .property = "max_ports",\
@@ -852,7 +841,6 @@ DEFINE_I440FX_MACHINE(v0_12, "pc-0.12", pc_compat_0_13,#define PC_COMPAT_0_11 \ - PC_COMPAT_0_12 \ {\ .driver = "virtio-blk-pci",\ .property = "vectors",\
@@ -883,7 +871,6 @@ DEFINE_I440FX_MACHINE(v0_11, "pc-0.11", pc_compat_0_13,#define PC_COMPAT_0_10 \ - PC_COMPAT_0_11 \ {\ .driver = "virtio-blk-pci",\ .property = "class",\
hw/ppc/spapr.c +0 -4
@@ -2387,7 +2387,6 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false);* pseries-2.4 */ #define SPAPR_COMPAT_2_4 \ - SPAPR_COMPAT_2_5 \ HW_COMPAT_2_4static void spapr_machine_2_4_instance_options (MachineState *machine)
@@ -2410,7 +2409,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false);* pseries-2.3 */ #define SPAPR_COMPAT_2_3 \ - SPAPR_COMPAT_2_4 \ HW_COMPAT_2_3 \ {\ .driver = "spapr-pci-host-bridge",\
@@ -2438,7 +2436,6 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false);*/ #define SPAPR_COMPAT_2_2 \ - SPAPR_COMPAT_2_3 \ HW_COMPAT_2_2 \ {\ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
@@ -2463,7 +2460,6 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false);* pseries-2.1 */ #define SPAPR_COMPAT_2_1 \ - SPAPR_COMPAT_2_2 \ HW_COMPAT_2_1static void spapr_machine_2_1_instance_options (MachineState *machine)
hw/s390x/s390-virtio-ccw.c +0 -1
@@ -330,7 +330,6 @@ static const TypeInfo ccw_machine_info = { HW_COMPAT_2_5#define CCW_COMPAT_2_4 \ - CCW_COMPAT_2_5 \ HW_COMPAT_2_4 \ {\ .driver = TYPE_S390_SKEYS,\
include/hw/boards.h +9 -2
@@ -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
include/hw/i386/pc.h +0 -9
@@ -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",\
vl.c +5 -1
@@ -4473,7 +4473,11 @@ int main(int argc, char **argv, char **envp) }if (machine_class->compat_props) { -qdev_prop_register_global_list (machine_class->compat_props); +GlobalProperty *p; +for (i =0 ; i < machine_class->compat_props->len; i++) { + p = g_array_index(machine_class->compat_props, GlobalProperty *, i); +qdev_prop_register_global (p); + } }qemu_add_globals ();
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 01/21] pc-dimm: correct comment of MemoryHotplugState
In reply to Eduardo HabkostFrom: Cao jin <[email protected]>
correct comment and remove an unused macro. commit adcb4ee6 already correct its type
--- include/hw/mem/pc-dimm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/hw/mem/pc-dimm.h +1 -3
@@ -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 */
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 10/21] gtk: Initialization stubs
In reply to Eduardo HabkostThis reduces the number of CONFIG_GTK #ifdefs in vl.c.
--- include/ui/console.h | 17 +++++++++++++++++ vl.c | 7 +------ 2 files changed, 18 insertions(+), 6 deletions(-)
include/ui/console.h +17 -0
@@ -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
vl.c +1 -6
@@ -148,9 +148,7 @@ int vga_interface_type = VGA_NONE;static int full_screen =0 ;static int no_frame =0 ;int no_quit =0 ; -#ifdef CONFIG_GTK static bool grab_on_hover; -#endif CharDriverState *serial_hds[MAX_SERIAL_PORTS ];CharDriverState *parallel_hds[MAX_PARALLEL_PORTS ];CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES ];
@@ -4246,11 +4244,10 @@ int main(int argc, char **argv, char **envp) "ignoring option"); } -#if defined(CONFIG_GTK )if (display_type ==DT_GTK ) {early_gtk_display_init (request_opengl); } -#endif +if (display_type ==DT_SDL ) {sdl_display_early_init (request_opengl); }
@@ -4548,11 +4545,9 @@ int main(int argc, char **argv, char **envp)case DT_COCOA :cocoa_display_init (ds, full_screen);break ; -#if defined(CONFIG_GTK )case DT_GTK :gtk_display_init (ds, full_screen, grab_on_hover);break ; -#endif default :break ; }
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 13/21] vl: Replace DT_NOGRAPHIC with machine option
In reply to Eduardo HabkostAll 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.
--- hw/core/machine.c | 21 +++++++++++++++++++++ hw/lm32/milkymist.c | 2 +- hw/nvram/fw_cfg.c | 6 ++++-- hw/sparc/sun4m.c | 2 +- include/hw/boards.h | 1 + include/sysemu/sysemu.h | 1 - vl.c | 13 +++++++------ 7 files changed, 35 insertions(+), 11 deletions(-)
hw/core/machine.c +21 -0
@@ -257,6 +257,20 @@ static void machine_set_usb(Object *obj, bool value, Error **errp) ms->usb_disabled = !value; } +static bool machine_get_graphics (Object *obj,Error **errp) +{ +MachineState *ms =MACHINE (obj); + +return ms->enable_graphics; +} + +static void machine_set_graphics (Object *obj,bool value,Error **errp) +{ +MachineState *ms =MACHINE (obj); + + ms->enable_graphics = value; +} +static bool machine_get_igd_gfx_passthru (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
@@ -382,6 +396,7 @@ static void machine_initfn(Object *obj) ms->kvm_shadow_mem =-1 ; ms->dump_guest_core = true; ms->mem_merge = true; + ms->enable_graphics = true;object_property_add_str (obj,"accel" , machine_get_accel, machine_set_accel,NULL );
@@ -460,6 +475,12 @@ static void machine_initfn(Object *obj)object_property_set_description (obj,"usb" ,"Set on/off to enable/disable usb" ,NULL ); +object_property_add_bool (obj,"graphics" , + machine_get_graphics, + machine_set_graphics,NULL ); +object_property_set_description (obj,"graphics" , +"Set on/off to enable/disable graphics emulation" , +NULL );object_property_add_bool (obj,"igd-passthru" , machine_get_igd_gfx_passthru, machine_set_igd_gfx_passthru,NULL );
hw/lm32/milkymist.c +1 -1
@@ -167,7 +167,7 @@ milkymist_init(MachineState *machine)milkymist_memcard_create (0x60004000 );milkymist_ac97_create (0x60005000 , irq[4 ], irq[5 ], irq[6 ], irq[7 ]);milkymist_pfpu_create (0x60006000 , irq[8 ]); -if (display_type !=DT_NOGRAPHIC ) { +if (machine->enable_graphics) {milkymist_tmu2_create (0x60007000 , irq[9 ]); }milkymist_minimac2_create (0x60008000 ,0x30000000 , irq[10 ], irq[11 ]);
hw/nvram/fw_cfg.c +4 -2
@@ -25,6 +25,7 @@#include "hw/hw.h" #include "sysemu/sysemu.h" #include "sysemu/dma.h" +#include "hw/boards.h" #include "hw/isa/isa.h" #include "hw/nvram/fw_cfg.h" #include "hw/sysbus.h"
@@ -868,16 +869,17 @@ static void fw_cfg_machine_ready(struct Notifier *n, void *data)static void fw_cfg_init1 (DeviceState *dev) {FWCfgState *s =FW_CFG (dev); +MachineState *machine =MACHINE (qdev_get_machine ());assert (!object_resolve_path (FW_CFG_PATH ,NULL )); -object_property_add_child (qdev_get_machine (),FW_CFG_NAME ,OBJECT (s),NULL ); +object_property_add_child (OBJECT (machine),FW_CFG_NAME ,OBJECT (s),NULL );qdev_init_nofail (dev);fw_cfg_add_bytes (s,FW_CFG_SIGNATURE , (char *)"QEMU" ,4 );fw_cfg_add_bytes (s,FW_CFG_UUID , qemu_uuid,16 ); -fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )(display_type ==DT_NOGRAPHIC )); +fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )!machine->enable_graphics);fw_cfg_add_i16 (s,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);fw_cfg_add_i16 (s,FW_CFG_BOOT_MENU , (uint16_t )boot_menu);fw_cfg_bootsplash (s);
hw/sparc/sun4m.c +1 -1
@@ -1000,7 +1000,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,slavio_timer_init_all (hwdef->counter_base, slavio_irq[19 ], slavio_cpu_irq, smp_cpus);slavio_serial_ms_kbd_init (hwdef->ms_kb_base, slavio_irq[14 ], - display_type ==DT_NOGRAPHIC ,ESCC_CLOCK ,1 ); + !machine->enable_graphics,ESCC_CLOCK ,1 );/* Slavio TTYA (base+4, Linux ttyS0) is the first QEMU serial device Slavio TTYB (base+0, Linux ttyS1) is the second QEMU serial device */ escc_init(hwdef->serial_base, slavio_irq[15], slavio_irq[15],
include/hw/boards.h +1 -0
@@ -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;
include/sysemu/sysemu.h +0 -1
@@ -138,7 +138,6 @@ typedef enum DisplayTypeDT_SDL ,DT_COCOA ,DT_GTK , -DT_NOGRAPHIC ,DT_NONE , } DisplayType;
vl.c +7 -6
@@ -2962,6 +2962,7 @@ int main(int argc, char **argv, char **envp)int show_vnc_port =0 ;bool defconfig = true;bool userconfig = true; +bool nographic = false;const char *log_mask =NULL ;const char *log_file =NULL ;char *trace_file =NULL ;
@@ -3206,7 +3207,10 @@ int main(int argc, char **argv, char **envp) display_type =select_display (optarg);break ;case QEMU_OPTION_nographic: - display_type =DT_NOGRAPHIC ; + olist =qemu_find_opts ("machine" ); +qemu_opts_parse_noisily (olist,"graphics=off" , false); + nographic = true; + display_type =DT_NONE ;break ;case QEMU_OPTION_curses:#ifdef CONFIG_CURSES
@@ -4167,7 +4171,7 @@ int main(int argc, char **argv, char **envp)* -nographic _and_ redirects all ports explicitly - this is valid * usage, -nographic is just a no-op in this case. */ -if (display_type ==DT_NOGRAPHIC +if (nographic && (default_parallel || default_serial || default_monitor || default_virtcon)) {error_report ("-nographic cannot be used with -daemonize" );
@@ -4181,7 +4185,7 @@ int main(int argc, char **argv, char **envp)#endif } -if (display_type ==DT_NOGRAPHIC ) { +if (nographic) {if (default_parallel)add_device_config (DEV_PARALLEL ,"null" );if (default_serial && default_monitor) {
@@ -4531,9 +4535,6 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) { -case DT_NOGRAPHIC : - (void )ds;/* avoid warning if no display is configured */ -break ;case DT_CURSES :curses_display_init (ds, full_screen);break ;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 14/21] vl: Make display_type a local variable
In reply to Eduardo HabkostNow display_type is only used inside main(), and don't need to be a global variable.
--- include/sysemu/sysemu.h | 1 - vl.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
include/sysemu/sysemu.h +0 -1
@@ -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;
vl.c +1 -1
@@ -129,7 +129,6 @@ static const char *data_dir[16];static int data_dir_idx;const char *bios_name =NULL ;enum vga_retrace_method vga_retrace_method =VGA_RETRACE_DUMB ; -DisplayType display_type =DT_DEFAULT ;int request_opengl =-1 ;int display_opengl;static int display_remote;
@@ -2963,6 +2962,7 @@ int main(int argc, char **argv, char **envp)bool defconfig = true;bool userconfig = true;bool nographic = false; +DisplayType display_type =DT_DEFAULT ;const char *log_mask =NULL ;const char *log_file =NULL ;char *trace_file =NULL ;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 15/21] vl: Move DisplayType typedef to vl.c
In reply to Eduardo HabkostNow the type is only used inside vl.c and doesn't need to be in a header file.
--- include/sysemu/sysemu.h | 10 ---------- vl.c | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-)
include/sysemu/sysemu.h +0 -10
@@ -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 {
vl.c +9 -0
@@ -2077,6 +2077,15 @@ static void select_vgahw(const char *p) } } +typedef enum DisplayType { +DT_DEFAULT , +DT_CURSES , +DT_SDL , +DT_COCOA , +DT_GTK , +DT_NONE , +}DisplayType ; +static DisplayType select_display (const char *p) {const char *opts;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 17/21] vl: Simplify global property registration
In reply to Eduardo HabkostThere's no need to use qdev_prop_register_global_list() and an array, if we are registering a single GlobalProperty struct. Use qdev_prop_register_global() instead.
--- vl.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-)
vl.c +15 -24
@@ -888,16 +888,13 @@ static void configure_rtc(QemuOpts *opts) value =qemu_opt_get (opts,"driftfix" );if (value) {if (!strcmp (value,"slew" )) { -static GlobalProperty slew_lost_ticks[] = { - { - .driver ="mc146818rtc" , - .property ="lost_tick_policy" , - .value ="slew" , - }, - {/* end of list */ } +static GlobalProperty slew_lost_ticks = { + .driver ="mc146818rtc" , + .property ="lost_tick_policy" , + .value ="slew" , }; -qdev_prop_register_global_list (slew_lost_ticks); +qdev_prop_register_global (&slew_lost_ticks); }else if (!strcmp (value,"none" )) {/* discard is default */ }else {
@@ -3626,16 +3623,13 @@ int main(int argc, char **argv, char **envp) win2k_install_hack =1 ;break ;case QEMU_OPTION_rtc_td_hack: { -static GlobalProperty slew_lost_ticks[] = { - { - .driver ="mc146818rtc" , - .property ="lost_tick_policy" , - .value ="slew" , - }, - {/* end of list */ } +static GlobalProperty slew_lost_ticks = { + .driver ="mc146818rtc" , + .property ="lost_tick_policy" , + .value ="slew" , }; -qdev_prop_register_global_list (slew_lost_ticks); +qdev_prop_register_global (&slew_lost_ticks);break ; }case QEMU_OPTION_acpitable:
@@ -3682,18 +3676,15 @@ int main(int argc, char **argv, char **envp)break ; }case QEMU_OPTION_no_kvm_pit_reinjection: { -static GlobalProperty kvm_pit_lost_tick_policy[] = { - { - .driver ="kvm-pit" , - .property ="lost_tick_policy" , - .value ="discard" , - }, - {/* end of list */ } +static GlobalProperty kvm_pit_lost_tick_policy = { + .driver ="kvm-pit" , + .property ="lost_tick_policy" , + .value ="discard" , };error_report ("warning: deprecated, replaced by " "-global kvm-pit.lost_tick_policy=discard" ); -qdev_prop_register_global_list (kvm_pit_lost_tick_policy); +qdev_prop_register_global (&kvm_pit_lost_tick_policy);break ; }case QEMU_OPTION_usb:
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 11/21] spice: Initialization stubs on qemu-spice.h
In reply to Eduardo HabkostThis reduces the number of CONFIG_SPICE #ifdefs in vl.c.
--- include/ui/qemu-spice.h | 13 +++++++++++++ vl.c | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-)
include/ui/qemu-spice.h +13 -0
@@ -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)
vl.c +0 -4
@@ -4360,10 +4360,8 @@ int main(int argc, char **argv, char **envp)os_set_line_buffering (); -#ifdef CONFIG_SPICE /* spice needs the timers to be initialized by this point */ qemu_spice_init (); -#endif cpu_ticks_init ();if (icount_opts) {
@@ -4564,11 +4562,9 @@ int main(int argc, char **argv, char **envp)g_free (ret); } -#ifdef CONFIG_SPICE if (using_spice) {qemu_spice_display_init (); } -#endif if (foreach_device_config (DEV_GDB , gdbserver_start) <0 ) {exit (1 );
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 16/21] vl: Make display_remote a local variable
In reply to Eduardo HabkostThe variable is used only inside main(), so it can be local.
--- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
vl.c +1 -1
@@ -131,7 +131,6 @@ const char *bios_name = NULL;enum vga_retrace_method vga_retrace_method =VGA_RETRACE_DUMB ;int request_opengl =-1 ;int display_opengl; -static int display_remote;const char * keyboard_layout =NULL ;ram_addr_t ram_size;const char *mem_path =NULL ;
@@ -2972,6 +2971,7 @@ int main(int argc, char **argv, char **envp)bool userconfig = true;bool nographic = false;DisplayType display_type =DT_DEFAULT ; +int display_remote =0 ;const char *log_mask =NULL ;const char *log_file =NULL ;char *trace_file =NULL ;
Signature · 1 line
2.5.5
[Qemu-devel] [PULL 05/21] vl: Add DT_COCOA DisplayType value
In reply to Eduardo HabkostInstead 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.
--- include/sysemu/sysemu.h | 1 + vl.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)
include/sysemu/sysemu.h +1 -0
@@ -136,6 +136,7 @@ typedef enum DisplayTypeDT_DEFAULT ,DT_CURSES ,DT_SDL , +DT_COCOA ,DT_GTK ,DT_NOGRAPHIC , DT_NONE,
vl.c +4 -2
@@ -4237,8 +4237,10 @@ int main(int argc, char **argv, char **envp)if (display_type ==DT_DEFAULT && !display_remote) {#if defined(CONFIG_GTK ) display_type =DT_GTK ; -#elif defined(CONFIG_SDL ) || defined(CONFIG_COCOA ) +#elif defined(CONFIG_SDL ) display_type =DT_SDL ; +#elif defined(CONFIG_COCOA ) + display_type =DT_COCOA ;#elif defined(CONFIG_VNC )vnc_parse ("localhost:0,to=99,id=default" , &error_abort); show_vnc_port =1 ;
@@ -4560,7 +4562,7 @@ int main(int argc, char **argv, char **envp)sdl_display_init (ds, full_screen, no_frame);break ;#elif defined(CONFIG_COCOA ) -case DT_SDL : +case DT_COCOA :cocoa_display_init (ds, full_screen);break ;#endif
Signature · 1 line
2.5.5
Peter Maydell
AppliedQuoted 8 lines · Eduardo Habkost
The following changes since commit
65603e2fc18b48e6e55a3dd693669413141694ec:tci: do not include
exec/exec-all.h(2016-05-20 15:07:46 +0100)are available in the git repository at:
git://github.com/ehabkost/qemu.gittags/machine-pull-request
Quoted 8 lines
for you to fetch changes up to
e8f2d2722eb84a809697e82c762d39c8c13f22f6:Use
&error_fatalwhen initializing crypto on qemu-{img,io,nbd} (2016-05-20 14:28:55 -0300)----------------------------------------------------------------
Machine Core queue, 2016-05-20----------------------------------------------------------------
Applied, thanks.
-- PMM