display: stop using DT_NOGRAPHIC, use DT_NONE
PATCH 1/1 display: stop using DT_NOGRAPHIC, use DT_NONE
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for DT_NOGRAPHIC and does not work well with -display none. Make DT_NOGRAPHIC an internal version which selects DT_NONE, and check for that in all other places where previously we checked for DT_NOGRAPHIC.
While at it, rename two private variants of display (DT_DEFAULT and DT_NOGRAPHIC) to use two underscores and make them negative, and set DT_NONE to 0.
This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
I'm not still sure we really want to check for display type in qemu-char.c where we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense.
If the fix is correct, it is a stable material.
--- hw/lm32/milkymist-hw.h | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/sparc/sun4m.c | 2 +- include/sysemu/sysemu.h | 6 +++--- qemu-char.c | 4 ++-- vl.c | 15 +++++++-------- 6 files changed, 15 insertions(+), 16 deletions(-)
hw/lm32/milkymist-hw.h +1 -1
@@ -107,7 +107,7 @@ static inline DeviceState *milkymist_tmu2_create(hwaddr base,int nelements;int ver_major, ver_minor; -if (display_type ==DT_NOGRAPHIC ) { +if (display_type ==DT_NONE ) {return NULL ; }
hw/nvram/fw_cfg.c +1 -1
@@ -510,7 +510,7 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, }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 )(display_type ==DT_NONE ));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
@@ -919,7 +919,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,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 ); + display_type ==DT_NONE ,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/sysemu/sysemu.h +3 -3
@@ -87,12 +87,12 @@ void do_info_slirp(Monitor *mon);typedef enum DisplayType { -DT_DEFAULT , +DT__DEFAULT =-1 ,/* private */ +DT__NOGRAPHIC =-2 ,/* private */ +DT_NONE =0 ,DT_CURSES ,DT_SDL ,DT_GTK , -DT_NOGRAPHIC , -DT_NONE , }DisplayType ;extern int autostart;
qemu-char.c +2 -2
@@ -955,7 +955,7 @@ static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts) chr =qemu_chr_open_fd (0 ,1 ); chr->chr_close = qemu_chr_close_stdio; chr->chr_set_echo = qemu_chr_set_echo_stdio; - stdio_allow_signal = display_type !=DT_NOGRAPHIC ; + stdio_allow_signal = display_type !=DT_NONE ;if (opts->has_signal) { stdio_allow_signal = opts->signal; }
@@ -3066,7 +3066,7 @@ static void qemu_chr_parse_stdio(QemuOpts *opts, ChardevBackend *backend, backend->stdio =g_new0 (ChardevStdio,1 ); backend->stdio->has_signal = true; backend->stdio->signal = -qemu_opt_get_bool (opts,"signal" , display_type !=DT_NOGRAPHIC ); +qemu_opt_get_bool (opts,"signal" , display_type !=DT_NONE ); } static void qemu_chr_parse_serial(QemuOpts *opts, ChardevBackend *backend,
vl.c +7 -8
@@ -183,7 +183,7 @@ 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 ; +DisplayType display_type =DT__DEFAULT ;static int display_remote;const char * keyboard_layout =NULL ;ram_addr_t ram_size;
@@ -2152,7 +2152,7 @@ static void select_vgahw (const char *p)static DisplayType select_display (const char *p) {const char *opts; -DisplayType display =DT_DEFAULT ; +DisplayType display =DT__DEFAULT ;if (strstart (p,"sdl" , &opts)) {#ifdef CONFIG_SDL
@@ -3093,7 +3093,7 @@ int main(int argc, char **argv, char **envp) display_type =select_display (optarg);break ;case QEMU_OPTION_nographic: - display_type =DT_NOGRAPHIC ; + display_type =DT__NOGRAPHIC ;break ;case QEMU_OPTION_curses:#ifdef CONFIG_CURSES
@@ -4018,7 +4018,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 (display_type ==DT__NOGRAPHIC && (default_parallel || default_serial || default_monitor || default_virtcon)) {fprintf (stderr,"-nographic can not be used with -daemonize\n" );
@@ -4032,7 +4032,8 @@ int main(int argc, char **argv, char **envp)#endif } -if (display_type ==DT_NOGRAPHIC ) { +if (display_type ==DT__NOGRAPHIC ) { + display_type =DT_NONE ;if (default_parallel)add_device_config (DEV_PARALLEL ,"null" );if (default_serial && default_monitor) {
@@ -4066,7 +4067,7 @@ int main(int argc, char **argv, char **envp) } } -if (display_type ==DT_DEFAULT && !display_remote) { +if (display_type ==DT__DEFAULT && !display_remote) {#if defined(CONFIG_GTK ) display_type =DT_GTK ;#elif defined(CONFIG_SDL ) || defined(CONFIG_COCOA )
@@ -4333,8 +4334,6 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) { -case DT_NOGRAPHIC : -break ;#if defined(CONFIG_CURSES )case DT_CURSES :curses_display_init (ds, full_screen);
Signature · 1 line
1.7.10.4
Ping?
Quoted 25 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.While at it, rename two private variants of display (
DT_DEFAULTandDT_NOGRAPHIC) to use two underscores and make them negative, and setDT_NONEto 0.This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
I'm not still sure we really want to check for display type in
qemu-char.cwhere we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense.If the fix is correct, it is a stable material.
Cc Todd T. Fries <[email protected]>Signed-off-by Michael Tokarev <[email protected]>
Quoted 8 lines
--- hw/lm32/milkymist-hw.h | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/sparc/sun4m.c | 2 +- include/sysemu/sysemu.h | 6 +++--- qemu-char.c | 4 ++-- vl.c | 15 +++++++-------- 6 files changed, 15 insertions(+), 16 deletions(-)
[]
Quoted 8 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.
Quoted 7 lines
While at it, rename two private variants of display (
DT_DEFAULTandDT_NOGRAPHIC) to use two underscores and make them negative, and setDT_NONEto 0.This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
Note that "-display none" and "-nographic" aren't exactly equivalent -- the latter is an option which turns on a bunch of behaviour including but not limited to "-display none".
Quoted 4 lines
I'm not still sure we really want to check for display type in
qemu-char.cwhere we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense.
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
include/sysemu/sysemu.h void do_info_slirp(Monitor *mon); · line 92
Quoted 10 lines
include/sysemu/sysemu.h +3
-1@@ -87,12 +87,12 @@ void do_info_slirp(Monitor *mon); typedef enum DisplayType { - DT_DEFAULT, + DT__DEFAULT = -1, /* private */ + DT__NOGRAPHIC = -2, /* private */ + DT_NONE = 0,
I think these could use a slightly longer comment than just "private", eg "private, used internally by vl.c only".
include/sysemu/sysemu.h void do_info_slirp(Monitor *mon); · line 96
Quoted 6 lines
include/sysemu/sysemu.h +0
-2DT_CURSES ,DT_SDL ,DT_GTK , -DT_NOGRAPHIC , -DT_NONE , } DisplayType;
thanks
-- PMM
Quoted 13 lines · Peter Maydell
Quoted 12 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.While at it, rename two private variants of display (
DT_DEFAULTandDT_NOGRAPHIC) to use two underscores and make them negative, and setDT_NONEto 0.
Quoted 7 lines
Quoted 3 lines
This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
Note that "-display none" and "-nographic" aren't exactly equivalent -- the latter is an option which turns on a bunch of behaviour including but not limited to "-display none".
Exactly. See ab51b1d568e02c80b1abf9016bda3a86dc1db389 for a bit more context of this.
Quoted 9 lines
Quoted 4 lines
I'm not still sure we really want to check for display type in
qemu-char.cwhere we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense....in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself. But "don't allow ctrl-c" which is currently bound to -nographic is equally wrong.
Quoted 3 lines
Quoted 1 line
+
DT__DEFAULT= -1, /* private */I think these could use a slightly longer comment than just "private", eg "private, used internally by
vl.conly".
Okay.
Quoted 10 lines · Michael Tokarev
Quoted 4 lines · Peter Maydell
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself. But "don't allow ctrl-c" which is currently bound to -nographic is equally wrong.
All I'm saying is that I use -display none and I like that it defaults to "ctrl-c works and kills qemu" and I don't want you to break that :-)
thanks
-- PMM
Quoted 7 lines · Peter Maydell
Quoted 6 lines · Michael Tokarev
Quoted 4 lines · Peter Maydell
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
Quoted 8 lines
Quoted 4 lines
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself. But "don't allow ctrl-c" which is currently bound to -nographic is equally wrong.
All I'm saying is that I use -display none and I like that it defaults to "ctrl-c works and kills qemu" and I don't want you to break that :-)
I'm not. Code in qemu-char.c:
static bool stdio_allow_signal;
static void qemu_chr_set_echo_stdio(CharDriverState *chr, bool echo)
{
...
/* if graphical mode, we allow Ctrl-C handling */
if (!stdio_allow_signal)
tty.c_lflag &= ~ISIG;
...
}static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts)
{
...
stdio_allow_signal = display_type != DT_NOGRAPHIC;
if (opts->has_signal) {
stdio_allow_signal = opts->signal;
}
...
}Note it is used only for stdio char device, like -serial stdio, so if you _just_ use -display none, without -serial stdio, you wont notice a change.
And note that original intention isn't exactly clear, either. How it is related with, say, curses display which needs raw keypresses?
Adding Paolo who wrote that code in bb002513.
Thanks,
/mjt
Quoted 3 lines · Michael Tokarev
Note it is used only for stdio char device, like -serial stdio, so if you _just_ use -display none, without -serial stdio, you wont notice a change.
Yes, I use "-display none -serial stdio".
-- PMM
Il 28/06/2013 13:43, Michael Tokarev ha scritto:
Quoted 32 lines
Quoted 4 lines
Quoted 4 lines
All I'm saying is that I use -display none and I like that it defaults to "ctrl-c works and kills qemu" and I don't want you to break that :-)
I'm not. Code in
qemu-char.c:static bool
stdio_allow_signal;static void
qemu_chr_set_echo_stdio(CharDriverState *chr, bool echo){ ... /* if graphical mode, we allow Ctrl-C handling */ if (!stdio_allow_signal) tty.c_lflag &= ~ISIG; ... }static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts)
{ ... stdio_allow_signal = display_type != DT_NOGRAPHIC; if (opts->has_signal) { stdio_allow_signal = opts->signal; } ... }Note it is used only for stdio char device, like -serial stdio, so if you _just_ use -display none, without -serial stdio, you wont notice a change.
Quoted 5 lines
And note that original intention isn't exactly clear, either. How it is related with, say, curses display which needs raw keypresses?
Adding Paolo who wrote that code in
bb002513.
I didn't, the code was already there:
if (!qemu_opt_get_bool(opts, "signal", display_type != DT_NOGRAPHIC))
tty.c_lflag &= ~ISIG;I just did
- if (!qemu_opt_get_bool(opts, "signal", display_type != DT_NOGRAPHIC))
+ if (!stdio_allow_signal)
tty.c_lflag &= ~ISIG;
...
+ stdio_allow_signal = qemu_opt_get_bool(opts, "signal",
+ display_type != DT_NOGRAPHIC);
I think the idea is that "-nographic" sets up "-serial mon:stdio" so in theory you do not need Ctrl-C and it is better to pass it to the VM. Which suggests this (untested) patch in turn:
-------------- 8< -----------------
From: Paolo Bonzini <[email protected]>
Subject: [PATCH] trap signals for "-serial mon:stdio"
With mon:stdio you can exit the VM by switching to the monitor and sending the "quit" command. It is then useful to pass Ctrl-C to the VM instead of exiting.
This in turn lets us stop tying the default signal handling behavior to -nographic, removing gratuitous differences between "-display none" and "-nographic".
This patch changes behavior for "-display none -serial mon:stdio", as expected, but not for "-display none -serial stdio".
qemu-char.c +5 -4
@@ -955,7 +955,6 @@ static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts) chr =qemu_chr_open_fd (0 ,1 ); chr->chr_close = qemu_chr_close_stdio; chr->chr_set_echo = qemu_chr_set_echo_stdio; - stdio_allow_signal = display_type !=DT_NOGRAPHIC ;if (opts->has_signal) { stdio_allow_signal = opts->signal; }
@@ -2929,7 +2928,10 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)if (strstart (filename,"mon:" , &p)) { filename = p; -qemu_opt_set (opts,"mux" ,"on" ); +qemu_opt_set (opts,"mux" ,"yes" ); +if (strcmp (filename,"stdio" ) ==0 ) { +qemu_opt_set (opts,"signal" ,"no" ); + } } if (strcmp(filename, "null") == 0 ||
@@ -3058,8 +3060,7 @@ static void qemu_chr_parse_stdio(QemuOpts *opts, ChardevBackend *backend, { backend->stdio =g_new0 (ChardevStdio,1 ); backend->stdio->has_signal = true; - backend->stdio->signal = -qemu_opt_get_bool (opts,"signal" , display_type !=DT_NOGRAPHIC ); + backend->stdio->signal =qemu_opt_get_bool (opts,"signal" , true); } static void qemu_chr_parse_serial(QemuOpts *opts, ChardevBackend *backend,
Am 28.06.2013 13:29, schrieb Michael Tokarev:
Quoted 35 lines
Quoted 13 lines · Peter Maydell
Quoted 12 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.While at it, rename two private variants of display (
DT_DEFAULTandDT_NOGRAPHIC) to use two underscores and make them negative, and setDT_NONEto 0.Quoted 7 lines
Quoted 3 lines
This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
Note that "-display none" and "-nographic" aren't exactly equivalent -- the latter is an option which turns on a bunch of behaviour including but not limited to "-display none".
Exactly. See
ab51b1d568e02c80b1abf9016bda3a86dc1db389for a bit more context of this.Quoted 9 lines
Quoted 4 lines
I'm not still sure we really want to check for display type in
qemu-char.cwhere we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense....in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
Quoted 6 lines
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself.
But "don't allow ctrl-c"
which is currently bound to -nographic is equally wrong.
What's wrong about that? Isn't Ctrl+C passed through to the guest in -nographic mode? I don't see how any other mode inclusing daemonize would need that.
Andreas
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
+
DT__DEFAULT= -1, /* private */I think these could use a slightly longer comment than just "private", eg "private, used internally by
vl.conly".Okay.
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
28.06.2013 15:45, Andreas Färber пишет:
Quoted 2 lines
Am 28.06.2013 13:29, schrieb Michael Tokarev:
Quoted 1 line
28.06.2013 15:24, Peter Maydell wrote:
[]
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself.
Quoted 6 lines
Quoted 2 lines
But "don't allow ctrl-c"
which is currently bound to -nographic is equally wrong.What's wrong about that? Isn't Ctrl+C passed through to the guest in -nographic mode? I don't see how any other mode inclusing daemonize would need that.
Um. With either -nographic or -display none, there's no "display" per se, and it is the "display" who relays keypresses and such into guest. Without display, the guest becomes headless completely, not only it does not have a monitor of a video card, but also does not have keyboard or mouse or other similar stuff. Or it may have these, but you can't "touch" neither keyboard nor mouse because you don't "see" them without a display. Fun thing but here we go.
This ctrl+c handling is only about when you explicitly redirected some other char device to guest, such as serial port. Which don't have much to do with display I think, hence I don't understand the logic here.
Thanks,
/mjt
Quoted 8 lines · Michael Tokarev
Um. With either -nographic or -display none, there's no "display" per se, and it is the "display" who relays keypresses and such into guest. Without display, the guest becomes headless completely, not only it does not have a monitor of a video card, but also does not have keyboard or mouse or other similar stuff. Or it may have these, but you can't "touch" neither keyboard nor mouse because you don't "see" them without a display. Fun thing but here we go.
Quoted 4 lines
This ctrl+c handling is only about when you explicitly redirected some other char device to guest, such as serial port. Which don't have much to do with display I think, hence I don't understand the logic here.
The point is that one of the things -nographic does, as well as disabling the graphics display, is to redirect the serial port (among other things) to stdio. That's why there's code in the char backend that cares about "did you say -nographic":
because -nographic means "no graphic display, serial port on terminal, send ctrl-c in terminal to guest rather than killing qemu, [some other stuff]".
It would be nice to be able to say "-nographic is equivalent to '-display none -serial stdio -disable-ctrl-c -other-things'" but I'm not sure exactly what the -other-things are or even if we can set them all on the command line specifically.
-- PMM
Quoted 7 lines · Peter Maydell
Quoted 4 lines · Michael Tokarev
This ctrl+c handling is only about when you explicitly redirected some other char device to guest, such as serial port. Which don't have much to do with display I think, hence I don't understand the logic here.
Quoted 7 lines
The point is that one of the things -nographic does, as well as disabling the graphics display, is to redirect the serial port (among other things) to stdio. That's why there's code in the char backend that cares about "did you say -nographic":
because -nographic means "no graphic display, serial port on terminal, send ctrl-c in terminal to guest rather than killing qemu, [some other stuff]".
That's exactly why I don't think looking at -nographic here in serial code is wrong. It should do the same regardless of -nographic - if, say, serial is redirected to stdio, it should always pass Ctrl+C to guest instead of killing it. So I'm not really sure we should test for -display none here, either.
Quoted 4 lines
It would be nice to be able to say "-nographic is equivalent to '-display none -serial stdio -disable-ctrl-c -other-things'" but I'm not sure exactly what the -other-things are or even if we can set them all on the command line specifically.
We have some code in sun4 which also enabled serial ports differently with and without -nographic, maybe because of the same thing (which is what this all is about!).
And there's also another place, passing this NOGRAPHIC thing to bios.
So far that's all. With chardev you can explicitly control Ctrl+C behavour using signal={on|off} attribute.
28.06.2013 15:56, Andreas Färber wrote:
[]
Quoted 7 lines
The logic is that a) -nographic does have serial I/O on stdio and b) emulated serial ports may get repurposed (change order/usage) for this to work. CC'ing Alex and Blue who might remember more details.
So in the end it boils down to whether we consider stdio a "display" and whether we may want to split this out into its own global variable to cleanly separate it from graphical DT_* options.
This is still wrong because it works differently if we explicitly redirected serial port to stdio and used -display none, or it was due to -nographic.
Thanks,
/mjt
Il 28/06/2013 14:05, Michael Tokarev ha scritto:
Quoted 5 lines
That's exactly why I don't think looking at -nographic here in serial code is wrong. It should do the same regardless of -nographic - if, say, serial is redirected to stdio, it should always pass Ctrl+C to guest instead of killing it. So I'm not really sure we should test for -display none here, either.
See the patch I just sent.
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
It would be nice to be able to say "-nographic is equivalent to '-display none -serial stdio -disable-ctrl-c -other-things'" but I'm not sure exactly what the -other-things are or even if we can set them all on the command line specifically.
We have some code in sun4 which also enabled serial ports differently with and without -nographic, maybe because of the same thing (which is what this all is about!).
Quoted 5 lines
And there's also another place, passing this NOGRAPHIC thing to bios.
So far that's all. With chardev you can explicitly control Ctrl+C behavour using signal={on|off} attribute.
Unfortunately, you cannot use -chardev for the vast majority of boards (all those that have no ISA/PCI/virtio).
Paolo
Quoted 9 lines · Michael Tokarev
Quoted 7 lines · Peter Maydell
The point is that one of the things -nographic does, as well as disabling the graphics display, is to redirect the serial port (among other things) to stdio. That's why there's code in the char backend that cares about "did you say -nographic":
because -nographic means "no graphic display, serial port on terminal, send ctrl-c in terminal to guest rather than killing qemu, [some other stuff]".
Quoted 5 lines
That's exactly why I don't think looking at -nographic here in serial code is wrong. It should do the same regardless of -nographic - if, say, serial is redirected to stdio, it should always pass Ctrl+C to guest instead of killing it. So I'm not really sure we should test for -display none here, either.
No, I do not want "-serial stdio" to mean "and also stop ctrl-c killing QEMU". If you want that you should have to specify it specifically (or if you say -nographic it should happen by the code in vl.c opening the serial backend with the right options).
-- PMM
Am 28.06.2013 13:50, schrieb Michael Tokarev:
Quoted 28 lines
28.06.2013 15:45, Andreas Färber пишет:
Quoted 2 lines
Am 28.06.2013 13:29, schrieb Michael Tokarev:
Quoted 1 line
28.06.2013 15:24, Peter Maydell wrote:
[]
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself.
Quoted 6 lines
Quoted 2 lines
But "don't allow ctrl-c"
which is currently bound to -nographic is equally wrong.What's wrong about that? Isn't Ctrl+C passed through to the guest in -nographic mode? I don't see how any other mode inclusing daemonize would need that.
Um. With either -nographic or -display none, there's no "display" per se, and it is the "display" who relays keypresses and such into guest. Without display, the guest becomes headless completely, not only it does not have a monitor of a video card, but also does not have keyboard or mouse or other similar stuff. Or it may have these, but you can't "touch" neither keyboard nor mouse because you don't "see" them without a display. Fun thing but here we go.
Quoted 4 lines
This ctrl+c handling is only about when you explicitly redirected some other char device to guest, such as serial port. Which don't have much to do with display I think, hence I don't understand the logic here.
The logic is that a) -nographic does have serial I/O on stdio and b) emulated serial ports may get repurposed (change order/usage) for this to work. CC'ing Alex and Blue who might remember more details.
So in the end it boils down to whether we consider stdio a "display" and whether we may want to split this out into its own global variable to cleanly separate it from graphical DT_* options.
Andreas
Quoted 5 lines
Thanks,
/mjt
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Am 28.06.2013 13:50, schrieb Michael Tokarev:
Quoted 20 lines
28.06.2013 15:45, Andreas Färber пишет:
Quoted 2 lines
Am 28.06.2013 13:29, schrieb Michael Tokarev:
Quoted 1 line
28.06.2013 15:24, Peter Maydell wrote:
[]
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
...in particular I don't think "-display none" should mean "don't allow ctrl-c" (though -nographic should continue to have that effect), and this patch currently introduces that behaviour change.
As Anthony said before, -nographic is legacy. So there should be some more modern way to control this. That's exactly the change which I don't like myself.
Quoted 6 lines
Quoted 2 lines
But "don't allow ctrl-c"
which is currently bound to -nographic is equally wrong.What's wrong about that? Isn't Ctrl+C passed through to the guest in -nographic mode? I don't see how any other mode inclusing daemonize would need that.
Quoted 7 lines
Um. With either -nographic or -display none, there's no "display" per se, and it is the "display" who relays keypresses and such into guest. Without display, the guest becomes headless completely, not only it does not have a monitor of a video card, but also does not have keyboard or mouse or other similar stuff. Or it may have these, but you can't "touch" neither keyboard nor mouse because you don't "see" them without a display. Fun thing but here we go.
BTW just try it out using the following to see for yourself:
$ qemu-system-ppc -nographic
should get you to an interactive OpenBIOS prompt. Same for sparc. This involves communicating to firmware that we are in -nographic mode, which then redirects its output to serial rather then VGA (think of sgabios in x86 terms).
Andreas
Quoted 10 lines
This ctrl+c handling is only about when you explicitly redirected some other char device to guest, such as serial port. Which don't have much to do with display I think, hence I don't understand the logic here.
Thanks,
/mjt
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Il 28/06/2013 14:05, Andreas Färber ha scritto:
Quoted 8 lines
BTW just try it out using the following to see for yourself:
$ qemu-system-ppc -nographicshould get you to an interactive OpenBIOS prompt. Same for sparc. This involves communicating to firmware that we are in -nographic mode, which then redirects its output to serial rather then VGA (think of sgabios in x86 terms).
Is this FW_CFG_NOGRAPHIC? This is really a good usecase for making the machine a Device, so you can control it with -global. It can be useful even if you do have a VGA attached.
Paolo
Quoted 16 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.While at it, rename two private variants of display (
DT_DEFAULTandDT_NOGRAPHIC) to use two underscores and make them negative, and setDT_NONEto 0.This should fix the issue of non-working sun serial console with the suggested replacement of -nographic which is -display none.
Quoted 6 lines
I'm not still sure we really want to check for display type in
qemu-char.cwhere we allow/disallow signals delivery from terminal, -- for other display types (CURSES) this makes no good sense.If the fix is correct, it is a stable material.
Breaks make check:
main-loop: WARNING: I/O thread spun for 1000 iterations
**
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC) == 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043b
Regards,
Anthony Liguori
Quoted 163 lines
Cc Todd T. Fries <[email protected]>Signed-off-by Michael Tokarev <[email protected]>--- hw/lm32/milkymist-hw.h | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/sparc/sun4m.c | 2 +- include/sysemu/sysemu.h | 6 +++--- qemu-char.c | 4 ++-- vl.c | 15 +++++++-------- 6 files changed, 15 insertions(+), 16 deletions(-)hw/lm32/milkymist-hw.h +1
-1@@ -107,7 +107,7 @@ static inline DeviceState *milkymist_tmu2_create(hwaddr base,int nelements;int ver_major, ver_minor; -if (display_type ==DT_NOGRAPHIC ) { +if (display_type ==DT_NONE ) {return NULL ; }hw/nvram/fw_cfg.c +1
-1@@ -510,7 +510,7 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, }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 )(display_type ==DT_NONE ));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@@ -919,7 +919,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,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 ); + display_type ==DT_NONE ,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/sysemu/sysemu.h +3
-3@@ -87,12 +87,12 @@ void do_info_slirp(Monitor *mon);typedef enum DisplayType { -DT_DEFAULT , +DT__DEFAULT =-1 ,/* private */ +DT__NOGRAPHIC =-2 ,/* private */ +DT_NONE =0 ,DT_CURSES ,DT_SDL ,DT_GTK , -DT_NOGRAPHIC , -DT_NONE , }DisplayType ;extern int autostart;qemu-char.c +2
-2@@ -955,7 +955,7 @@ static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts) chr =qemu_chr_open_fd (0 ,1 ); chr->chr_close = qemu_chr_close_stdio; chr->chr_set_echo = qemu_chr_set_echo_stdio; - stdio_allow_signal = display_type !=DT_NOGRAPHIC ; + stdio_allow_signal = display_type !=DT_NONE ;if (opts->has_signal) { stdio_allow_signal = opts->signal; }@@ -3066,7 +3066,7 @@ static void qemu_chr_parse_stdio(QemuOpts *opts, ChardevBackend *backend, backend->stdio =g_new0 (ChardevStdio,1 ); backend->stdio->has_signal = true; backend->stdio->signal = -qemu_opt_get_bool (opts,"signal" , display_type !=DT_NOGRAPHIC ); +qemu_opt_get_bool (opts,"signal" , display_type !=DT_NONE ); } static void qemu_chr_parse_serial(QemuOpts *opts, ChardevBackend *backend,vl.c +7
-8@@ -183,7 +183,7 @@ 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 ; +DisplayType display_type =DT__DEFAULT ;static int display_remote;const char * keyboard_layout =NULL ;ram_addr_t ram_size;@@ -2152,7 +2152,7 @@ static void select_vgahw (const char *p)static DisplayType select_display (const char *p) {const char *opts; -DisplayType display =DT_DEFAULT ; +DisplayType display =DT__DEFAULT ;if (strstart (p,"sdl" , &opts)) {#ifdef CONFIG_SDL @@ -3093,7 +3093,7 @@ int main(int argc, char **argv, char **envp) display_type =select_display (optarg);break ;case QEMU_OPTION_nographic: - display_type =DT_NOGRAPHIC ; + display_type =DT__NOGRAPHIC ;break ;case QEMU_OPTION_curses:#ifdef CONFIG_CURSES @@ -4018,7 +4018,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 (display_type ==DT__NOGRAPHIC && (default_parallel || default_serial || default_monitor || default_virtcon)) {fprintf (stderr,"-nographic can not be used with -daemonize\n" );@@ -4032,7 +4032,8 @@ int main(int argc, char **argv, char **envp)#endif } -if (display_type ==DT_NOGRAPHIC ) { +if (display_type ==DT__NOGRAPHIC ) { + display_type =DT_NONE ;if (default_parallel)add_device_config (DEV_PARALLEL ,"null" );if (default_serial && default_monitor) {@@ -4066,7 +4067,7 @@ int main(int argc, char **argv, char **envp) } } -if (display_type ==DT_DEFAULT && !display_remote) { +if (display_type ==DT__DEFAULT && !display_remote) {#if defined(CONFIG_GTK ) display_type =DT_GTK ;#elif defined(CONFIG_SDL ) || defined(CONFIG_COCOA )@@ -4333,8 +4334,6 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) { -case DT_NOGRAPHIC : -break ;#if defined(CONFIG_CURSES )case DT_CURSES :curses_display_init (ds, full_screen);Signature · 1 line
1.7.10.4
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.
[]
Quoted 6 lines
Breaks make check:
main-loop: WARNING: I/O thread spun for 1000 iterations
**
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043b
Sure, because the test is bogus. Should I remove this bogus test?
Thanks,
/mjt
Quoted 11 lines · Michael Tokarev
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.[]
Quoted 8 lines
Quoted 6 lines
Breaks make check:
main-loop: WARNING: I/O thread spun for 1000 iterations
**
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043bSure, because the test is bogus.
No, it's a guest ABI. You cannot change the guest ABI.
-display none != -nographic.
nographic gives you -display none plus a stdio serial port (with muxing magic).
-display none should not imply stdio serial port. The vc goes to a dummy display. That's a major semantic difference.
Regards,
Anthony Liguori
Quoted 5 lines
Should I remove this bogus test?
Thanks,
/mjt
Quoted 8 lines · Anthony Liguori
Quoted 5 lines · Michael Tokarev
Quoted 2 lines · Anthony Liguori
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (
qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043bSure, because the test is bogus.
No, it's a guest ABI. You cannot change the guest ABI.
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
Quoted 7 lines
-display none != -nographic.
nographic gives you -display none plus a stdio serial port (with muxing magic).
-display none should not imply stdio serial port. The vc goes to a dummy display. That's a major semantic difference.
None of these semantics have changed AFAICT.
-- PMM
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Anthony Liguori
Quoted 4 lines · Michael Tokarev
Quoted 2 lines · Anthony Liguori
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (
qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043b
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Sure, because the test is bogus.
No, it's a guest ABI. You cannot change the guest ABI.
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
I believe OpenBIOS uses this to determine if it should display messages on serial or on the graphic display.
It's actually a useful ABI in that regard.
Regards,
Anthony Liguori
Quoted 11 lines
Quoted 7 lines
-display none != -nographic.
nographic gives you -display none plus a stdio serial port (with muxing magic).
-display none should not imply stdio serial port. The vc goes to a dummy display. That's a major semantic difference.
None of these semantics have changed AFAICT.
-- PMM
Quoted 8 lines · Anthony Liguori
Quoted 2 lines · Peter Maydell
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
I believe OpenBIOS uses this to determine if it should display messages on serial or on the graphic display.
It's actually a useful ABI in that regard.
OK, I might go for "useful but misnamed"; we should presumably have a command line option to set it cleanly (ie independently of display type), and add that to the list of random things -nographic does...
-- PMM
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Anthony Liguori
Quoted 2 lines · Peter Maydell
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
I believe OpenBIOS uses this to determine if it should display messages on serial or on the graphic display.
Quoted 6 lines
Quoted 1 line
It's actually a useful ABI in that regard.
OK, I might go for "useful but misnamed"; we should presumably have a command line option to set it cleanly (ie independently of display type), and add that to the list of random things -nographic does...
I wouldn't be opposed to that but whatever we do, it should be documented and should not break 'make check'.
Regards,
Anthony Liguori
Quoted 2 lines
-- PMM
Quoted 12 lines · Anthony Liguori
Quoted 10 lines · Peter Maydell
Quoted 8 lines · Anthony Liguori
Quoted 2 lines · Peter Maydell
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
I believe OpenBIOS uses this to determine if it should display messages on serial or on the graphic display.
It's actually a useful ABI in that regard.
Quoted 7 lines
Quoted 4 lines
OK, I might go for "useful but misnamed"; we should presumably have a command line option to set it cleanly (ie independently of display type), and add that to the list of random things -nographic does...
I wouldn't be opposed to that but whatever we do, it should be documented and should not break 'make check'.
So, what do we do now? Ping:
http://git.corpit.ru/?p=qemu.git;a=shortlog;h=refs/heads/mjt-dt-nographic
/mjt
Quoted 10 lines · Anthony Liguori
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Anthony Liguori
Quoted 5 lines · Michael Tokarev
Quoted 2 lines · Anthony Liguori
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (
qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043bSure, because the test is bogus.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
No, it's a guest ABI. You cannot change the guest ABI.
Why the heck are we telling the guest that the user specified -nographic anyhow? It's a dumb guest ABI...
I believe OpenBIOS uses this to determine if it should display messages on serial or on the graphic display.
This is actually exactly the thing this very patch changes: it stops relying on -nographics and passes -display none to the bios/firmware instead. And the documentation has been updated accordingly, also in this very patch:
hw/nvram/fw_cfg.c
- fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC));
+ fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NONE));
hw/sparc/sun4m.c
slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[14],
- display_type == DT_NOGRAPHIC, ESCC_CLOCK, 1);
+ display_type == DT_NONE, ESCC_CLOCK, 1);
qemu-options.hx
@item none
Do not display video output. The guest will still see an emulated graphics card, but its output will not be displayed to the QEMU
-user. This option differs from the -nographic option in that it +user. The fact that we have no display is passed to firmware and +affects a few other places depending on the target architecture, +like switching console output to serial console or disabling keyboard +input.
+
+This option differs from the -nographic option in that it
only affects what is done with video output; -nographic also changes the destination of the serial and parallel port data.
Besides, -- I just noticed -- we're discussing a V1 of this patch, while I already sent a v3, -- it has a much more appropriate logic for the Ctrl+C handling. The only issue I see with it is the make check breakage which is easy to fix by s/==0/==1/.
Thanks,
/mjt
10.07.2013 08:45, Michael Tokarev wrote:
[]
Quoted 4 lines
Besides, -- I just noticed -- we're discussing a V1 of this patch, while I already sent a v3, -- it has a much more appropriate logic for the Ctrl+C handling. The only issue I see with it is the make check breakage which is easy to fix by s/==0/==1/.
I updated the git branch on my site --
http://git.corpit.ru/?p=qemu.git;a=shortlog;h=refs/heads/mjt-dt-nographic
(two patches on the top). This now includes the `make check' fix by flipping the check (FW_CFG_NOGRAPHIC==1 vs ==0), more documentation rewording (suggested by Peter) and Reviewed-by tags.
And yes, I dislike this mess too -- neither -nographic nor -display none should be tied with guest serial port. Better approach for the Ctrl+C handling has been proposed by pbonzini. Better suggestions for FW_CFG_NOGRAPHIC welcome. Maybe something like -serial-console (linux has console=ttyS0,tty1) which will be turned on by -nographic and which will be passed to firmware as FW_CFG_NOGRAPHIC, and which can be used in -serial none case to check for sanity. But actually, -display none isn't that bad of a choice here (and maybe we may also enforce non-none serial in case of -display none).
Thanks,
/mjt
Quoted 8 lines · Michael Tokarev
I updated the git branch on my site --
http://git.corpit.ru/?p=qemu.git;a=shortlog;h=refs/heads/mjt-dt-nographic
(two patches on the top). This now includes the `make check' fix by flipping the check (FW_CFG_NOGRAPHIC==1 vs ==0), more documentation rewording (suggested by Peter) and Reviewed-by tags.
Quoted 8 lines
And yes, I dislike this mess too -- neither -nographic nor -display none should be tied with guest serial port. Better approach for the Ctrl+C handling has been proposed by pbonzini. Better suggestions for
FW_CFG_NOGRAPHICwelcome. Maybe something like -serial-console (linux has console=ttyS0,tty1) which will be turned on by -nographic and which will be passed to firmware asFW_CFG_NOGRAPHIC, and which can be used in -serial none case to check for sanity. But actually, -display none isn't that bad of a choice here (and maybe we may also enforce non-none serial in case of -display none).
I think "-display none" should just mean "I didn't plug the monitor in":
it should have no effect at all on the guest (or on the way we emulate or configure any other of our devices) -- it's just that graphics output doesn't go anywhere. So the test case is correct (the test was started with '-display none' and this shouldn't result in the FW_CFG_NOGRAPHIC bit being set) and we need to make QEMU behave correctly (ie by tying that FW_CFG_ setting to something other than display=none).
On a similar line of thought:
* milkymist_tmu2_create() should definitely not be doing the X probing if DT_NONE, but it should ideally still create the milkymist-tmu2 device. This is hard though because the device itself basically assumes it can use all the OpenGL APIs. So I think the change in your patch is as good as we're going to get.
* I'm not convinced we should need to disable the sparc keyboard if DT_NONE -- shouldn't this just work as if you had a physical keyboard plugged in but never typed anything on it? (Or does real hardware use "keyboard plugged in" to decide something?)
thanks
-- PMM
Quoted 24 lines · Anthony Liguori
Quoted 11 lines · Michael Tokarev
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Michael Tokarev
It looks like initially there was -nographic option to turn off display, now there's another option of the same sort, -display none. But code in other places of qemu checks for
DT_NOGRAPHICand does not work well with -display none. MakeDT_NOGRAPHICan internal version which selectsDT_NONE, and check for that in all other places where previously we checked forDT_NOGRAPHIC.[]
Quoted 8 lines
Quoted 6 lines
Breaks make check:
main-loop: WARNING: I/O thread spun for 1000 iterations
**
ERROR:/home/aliguori/git/qemu/tests/fw_cfg-test.c:63:test_fw_cfg_nographic: assertion failed (qfw_cfg_get_u16(fw_cfg, FW_CFG_NOGRAPHIC)== 0): (1 == 0)
GTester: last random seed: R02S25031265f05e4d41efcf758c9ef6043bSure, because the test is bogus.
No, it's a guest ABI. You cannot change the guest ABI.
Quoted 7 lines
-display none != -nographic.
nographic gives you -display none plus a stdio serial port (with muxing magic).
-display none should not imply stdio serial port. The vc goes to a dummy display. That's a major semantic difference.
So we're back to the original bugreport by Todd Fries -- apparently all my attempts to describe the proposed ways to change it failed.
Note that -nographics does NOT imply a serial port either, because it can be redirected elsewhere.
/mjt