Skip to contentSkip to conversation

ui/gtk: fix "Copy" menu item segfault

PATCH In review Stefan Hajnoczi 9 participants 25 messages Dec 14, 2016 – Dec 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/gtk: fix "Copy" menu item segfault

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 ui/gtk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Gerd, Michael: if you post Reviewed-by I can merge this directly without requiring you to send a pull request. It's a user interface segfault so it would be nice to resolve it in QEMU 2.8.

ui/gtk.c +8 -0
index e816428..a216216 100644
@@ -1581,6 +1581,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                                        TRUE);
     }
     gtk_widget_set_sensitive(s->grab_item, on_vga);
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item, vc->type == GD_VC_VTE);
+#endif
 
     gd_update_windowsize(vc);
     gd_update_cursor(vc);
@@ -2246,6 +2249,11 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     }
 #endif
 
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item,
+                             gd_vc_find_current(s)->type == GD_VC_VTE);
+#endif
+
     if (full_screen) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
     }
Signature · 1 line
2.9.3
Tested-by on v1 1/1
#1 lore raw

Am 14.12.2016 um 15:25 schrieb Stefan Hajnoczi:

Quoted 13 lines

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 8 lines
---
 ui/gtk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Gerd, Michael: if you post Reviewed-by I can merge this directly without requiring you to send a pull request. It's a user interface segfault so it would be nice to resolve it in QEMU 2.8.

CC'ing QEMU-stable because I think that 2.7 needs that fix, too.

Stefan

Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 8 lines · Stefan Hajnoczi

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Quoted 39 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 ui/gtk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Gerd, Michael: if you post Reviewed-by I can merge this directly without requiring you to send a pull request. It's a user interface segfault so it would be nice to resolve it in QEMU 2.8.

ui/gtk.c +8 -0
index e816428..a216216 100644
@@ -1581,6 +1581,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                                        TRUE);
     }
     gtk_widget_set_sensitive(s->grab_item, on_vga);
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item, vc->type == GD_VC_VTE);
+#endif
 
     gd_update_windowsize(vc);
     gd_update_cursor(vc);
@@ -2246,6 +2249,11 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     }
 #endif
 
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item,
+                             gd_vc_find_current(s)->type == GD_VC_VTE);
+#endif
+
     if (full_screen) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
     }
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 6 lines · Stefan Hajnoczi

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

Quoted 7 lines

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

I don't think it's 2.8 personally, patch just disables an illegal action. Similar to the hotplug crash fix I have queued. Just document this as a known issue.

BTW - any idea how to make paste work?

Quoted 36 lines
---
 ui/gtk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Gerd, Michael: if you post Reviewed-by I can merge this directly without requiring you to send a pull request. It's a user interface segfault so it would be nice to resolve it in QEMU 2.8.

ui/gtk.c +8 -0
index e816428..a216216 100644
@@ -1581,6 +1581,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                                        TRUE);
     }
     gtk_widget_set_sensitive(s->grab_item, on_vga);
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item, vc->type == GD_VC_VTE);
+#endif
 
     gd_update_windowsize(vc);
     gd_update_cursor(vc);
@@ -2246,6 +2249,11 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     }
 #endif
 
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item,
+                             gd_vc_find_current(s)->type == GD_VC_VTE);
+#endif
+
     if (full_screen) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
     }
Signature · 1 line
2.9.3
#8 lore raw

[Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Stefan Hajnoczi

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Note:
- had to exit to another VT and kill qemu
- why was I able to do that?
should not ctrl-alt-Fn be captured too?

Signature · 1 line
MST
#4 lore raw
In reply to Michael S. Tsirkin
Quoted 15 lines · Michael S. Tsirkin
Quoted 6 lines · Stefan Hajnoczi

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

Quoted 7 lines

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 7 lines

I don't think it's 2.8 personally, patch just disables an illegal action. Similar to the hotplug crash fix I have queued. Just document this as a known issue.

BTW - any idea how to make paste work?

Maybe Gerd has a recommendation. I have never touched GTK or VTE before this patch.

Stefan

#5 lore raw
In reply to Michael S. Tsirkin
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Stefan Hajnoczi

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Quoted 8 lines
Quoted 4 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

I don't think it's 2.8 personally, patch just disables an illegal action. Similar to the hotplug crash fix I have queued. Just document this as a known issue.

I mistakenly thought this bug was introduced in QEMU 2.8, but now that I look back at git log I realize it already existed.

Stefan

#9 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin
Quoted 11 lines · Michael S. Tsirkin

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Note:
- had to exit to another VT and kill qemu
- why was I able to do that?
should not ctrl-alt-Fn be captured too?

Sounds related to:

commit 56f289f383a871e871f944c7226920b35794efe6

Author: Cole Robinson <[email protected]>
Date:   Fri May 6 14:03:06 2016 -0400

ui: sdl2: Release grab before opening console window

Stefan

#6 lore raw
In reply to Michael S. Tsirkin

Am 14.12.2016 um 23:49 hat Michael S. Tsirkin geschrieben:

Quoted 10 lines · Stefan Hajnoczi
Quoted 9 lines

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Quoted 8 lines
Quoted 4 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

I don't think it's 2.8 personally, patch just disables an illegal action. Similar to the hotplug crash fix I have queued. Just document this as a known issue.

This is an immediate crash for selecting a menu entry in the default view (which means killing a VM accidentally), we know the patch to fix it, and it is really small. Why would we not merge something like this? Are we making intentionally shitty releases these days?

I don't know your hotplug problem, but if it's a crash that isn't a real corner case, that suggests that it should have been fixed. I mean, fixing bugs is exactly what the freeze is for.

Kevin

#10 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Stefan Hajnoczi
Quoted 15 lines · Stefan Hajnoczi
Quoted 11 lines · Michael S. Tsirkin

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Note:
- had to exit to another VT and kill qemu
- why was I able to do that?
should not ctrl-alt-Fn be captured too?

Sounds related to:

Quoted 7 lines

commit 56f289f383a871e871f944c7226920b35794efe6

Author: Cole Robinson <[email protected]>
Date:   Fri May 6 14:03:06 2016 -0400

ui: sdl2: Release grab before opening console window

Stefan

Doesn't look related to me, also this is in the v2.7 release already. There are no SDL updates in 2.8. Hmm. /me looks a bit puzzled.

What is the known-good setup?

cheers,
Gerd

#7 lore raw
In reply to Kevin Wolf
Quoted 20 lines · Kevin Wolf

Am 14.12.2016 um 23:49 hat Michael S. Tsirkin geschrieben:

Quoted 10 lines · Stefan Hajnoczi
Quoted 9 lines

The "Copy" menu item copies VTE terminal text to the clipboard. This only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE terminal.

This patch fixes a segfault. Reproducer: Start QEMU and click the Copy menu item when the guest display is visible.

Quoted 8 lines
Quoted 4 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

I don't think it's 2.8 personally, patch just disables an illegal action. Similar to the hotplug crash fix I have queued. Just document this as a known issue.

Quoted 8 lines

This is an immediate crash for selecting a menu entry in the default view (which means killing a VM accidentally), we know the patch to fix it, and it is really small. Why would we not merge something like this? Are we making intentionally shitty releases these days?

I don't know your hotplug problem, but if it's a crash that isn't a real corner case, that suggests that it should have been fixed. I mean, fixing bugs is exactly what the freeze is for.

A lot of patches are queued waiting for the 2.9 development cycle, including bug fixes. The reason these bug fixes aren't merged for 2.8 is because they are not release blockers and they risk introducing new regressions.

A line must be drawn somewhere since we cannot keep delaying the release another week while possibly introducing new regressions.

I have asked everyone, including Michael, to send only clear release blockers (i.e. regressions, build failures, critical bugs) even if they wanted to include more bug fixes. I can understand that he's now wondering why I merged this patch in -rc4.

Is this patch a regression fix? No
Is it a build fix? No
Is it a critical bug? Probably not since no one noticed it in 2.7.

I merged it because I misinterpreted git log output and thought it was a regression :).

In any case, we've reached the point where nothing more goes into the tree so that QEMU 2.8.0 can be released.

Stefan

#11 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Gerd Hoffmann
Quoted 24 lines · Gerd Hoffmann
Quoted 15 lines · Stefan Hajnoczi
Quoted 11 lines · Michael S. Tsirkin

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Note:
- had to exit to another VT and kill qemu
- why was I able to do that?
should not ctrl-alt-Fn be captured too?

Sounds related to:

Quoted 7 lines

commit 56f289f383a871e871f944c7226920b35794efe6

Author: Cole Robinson <[email protected]>
Date:   Fri May 6 14:03:06 2016 -0400

ui: sdl2: Release grab before opening console window

Stefan

Quoted 7 lines

Doesn't look related to me, also this is in the v2.7 release already. There are no SDL updates in 2.8. Hmm. /me looks a bit puzzled.

What is the known-good setup?

cheers,
Gerd

Testing it now.

BTW I note that on f23, build of 2.7 fails since it uses deprecated APIs from gtk. Easy to work around with --disable-werror, but I wonder whether we should add --disable-werror in release tarballs generally.

Signature · 1 line
MST
#13 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Gerd Hoffmann
Quoted 24 lines · Gerd Hoffmann
Quoted 15 lines · Stefan Hajnoczi
Quoted 11 lines · Michael S. Tsirkin

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Note:
- had to exit to another VT and kill qemu
- why was I able to do that?
should not ctrl-alt-Fn be captured too?

Sounds related to:

Quoted 7 lines

commit 56f289f383a871e871f944c7226920b35794efe6

Author: Cole Robinson <[email protected]>
Date:   Fri May 6 14:03:06 2016 -0400

ui: sdl2: Release grab before opening console window

Stefan

Quoted 7 lines

Doesn't look related to me, also this is in the v2.7 release already. There are no SDL updates in 2.8. Hmm. /me looks a bit puzzled.

What is the known-good setup?

cheers,
Gerd

2.7 has the same bug (requires --disable-werror to build). 2.6 works fine (requires --with-sdlabi=2.0 to build).

I only tested --target-list=x86_64-softmmu .

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Signature · 1 line
MST
#12 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin

Hi,

Quoted 4 lines

BTW I note that on f23, build of 2.7 fails since it uses deprecated APIs from gtk. Easy to work around with --disable-werror, but I wonder whether we should add --disable-werror in release tarballs generally.

That is the case already. configure checks you are building from a git tree or not, and only for git tree builds werror is enabled by default.

cheers,
Gerd

#14 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

It doesn't reproduce here. There must be some other factor which is needed to trigger this. What desktop you are using? gnome? kde? something else? Xorg or wayland?

Can you try to bisect it?

cheers,
Gerd

#15 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

Quoted 9 lines · Gerd Hoffmann

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Quoted 8 lines

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

That's what I'm saying, maybe no one uses SDL anymore.

Quoted 1 line

It doesn't reproduce here.

Are you on Fedora 25 too?

Quoted 3 lines

There must be some other factor which is
needed to trigger this. What desktop you are using? gnome? kde? something else?

XFCE

Quoted 1 line

Xorg or wayland?

Xorg

Quoted 4 lines

Can you try to bisect it?

cheers,
Gerd

Trying to.

#16 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

Quoted 35 lines · Michael S. Tsirkin
Quoted 9 lines · Gerd Hoffmann

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

Quoted 8 lines

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

That's what I'm saying, maybe no one uses SDL anymore.

Quoted 1 line

It doesn't reproduce here.

Are you on Fedora 25 too?

Quoted 3 lines

There must be some other factor which is
needed to trigger this. What desktop you are using? gnome? kde? something else?

XFCE

Quoted 1 line

Xorg or wayland?

Xorg

Quoted 7 lines
Quoted 4 lines

Can you try to bisect it?

cheers,
Gerd

Trying to.

One strange thing - I only see it when guest is in graphical mode. If guest is in text mode it works ok.
Command line:

./x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 1000 -cpu host -smp 2 /home/mst/images/f20-x64.qcow2 -netdev user,id=foo -redir tcp:8022::22 -device virtio-net,netdev=foo -kernel /boot/vmlinuz-${release} -initrd /boot/initramfs-${release}.img -append 'root=/dev/sda3 ro vconsole.font=latarcyrheb-sun16 rhgb noquiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8,9600n8' -sdl

so nothing special.

#22 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Gerd Hoffmann
Quoted 18 lines · Gerd Hoffmann

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

Quoted 8 lines

It doesn't reproduce here. There must be some other factor which is needed to trigger this. What desktop you are using? gnome? kde? something else? Xorg or wayland?

Can you try to bisect it?

cheers,
Gerd

Looks like 2.6 does not work either :( Gerd, are you using F25? Steps
- launch fedora guest with kvm, default pc graphics and SDL ui
- wait until graphical login prompt starts
- click within window

afterwards, clicking Ctrl-Alt exits and immediately restarts grab.

Signature · 1 line
MST
#17 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

That's what I'm saying, maybe no one uses SDL anymore.

It's maybe not as common as the GTK interface, but as far as I know people still use the SDL interface. For example here:

https://bugs.launchpad.net/qemu/+bug/922076

... so I would recommend to keep the SDL code in QEMU.

Thomas

#18 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

Quoted 4 lines · Thomas Huth

... so I would recommend to keep the SDL code in QEMU.

SDL 1.2 is largely deprecated now, when I upgraded to macOS 10.12 I suddenly started to have various problems. so I decided to upgrade GNU ARM Eclipse to SDL 2.

if all graphic calls are performed on the main thread, SDL2 is fine. if not, it crashes.

regards,

Liviu

#19 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Thomas Huth

Am 16.12.2016 um 09:26 hat Thomas Huth geschrieben:

Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Gerd Hoffmann
Quoted 4 lines
Quoted 1 line

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

That's what I'm saying, maybe no one uses SDL anymore.

It's maybe not as common as the GTK interface, but as far as I know people still use the SDL interface. For example here:

https://bugs.launchpad.net/qemu/+bug/922076

... so I would recommend to keep the SDL code in QEMU.

When I actualy use qemu rather than just doing a quick test, I generally prefer SDL, too, because the GTK frontend still grabs some keys like F10 for itself instead of passing them to the guest. And using HMP for something as simple as that - no, thanks.

Kevin

#20 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

Quoted 16 lines · Kevin Wolf

Am 16.12.2016 um 09:26 hat Thomas Huth geschrieben:

Quoted 15 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Gerd Hoffmann
Quoted 4 lines
Quoted 1 line

Do we fix this or disable SDL altogether?

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

That's what I'm saying, maybe no one uses SDL anymore.

It's maybe not as common as the GTK interface, but as far as I know people still use the SDL interface. For example here:

https://bugs.launchpad.net/qemu/+bug/922076

Quoted 9 lines
Quoted 1 line

... so I would recommend to keep the SDL code in QEMU.

When I actualy use qemu rather than just doing a quick test, I generally prefer SDL, too, because the GTK frontend still grabs some keys like F10 for itself instead of passing them to the guest. And using HMP for something as simple as that - no, thanks.

Kevin

I'd like to also point to the recent status report by Stefan Weil concerning UI support in Windows builds:
http://lists.nongnu.org/archive/html/qemu-devel/2016-12/msg01383.html

At least for PPC Mac OS/OSX guests only the SDL1.2 UI is somewhat usable, GTK2/3, SDL2 and VNC are all problematic.

Best,
Howard

#23 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin

Am 15.12.2016 um 23:30 hat Michael S. Tsirkin geschrieben:

Quoted 25 lines · Gerd Hoffmann
Quoted 15 lines

Hi,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The problem always reproduces for me:
- start qemu with -sdl
- wait for guest to boot
- click anywhere within guest screen
- message "press ctrl+alt to exit capture" appears on screen, but pressing that immediately restarts capture again

[ 2.6 good, 2.7, 2.8 bad ]

Quoted 3 lines

I'd say SDL is mostly useless with this bug.

Do we fix this or disable SDL altogether?

Quoted 8 lines

Well, it can't be *that* bad, otherwise it would not went unnoticed for a whole release cycle.

It doesn't reproduce here. There must be some other factor which is needed to trigger this. What desktop you are using? gnome? kde? something else? Xorg or wayland?

Can you try to bisect it?

Quoted 7 lines

Looks like 2.6 does not work either :( Gerd, are you using F25? Steps
- launch fedora guest with kvm, default pc graphics and SDL ui
- wait until graphical login prompt starts
- click within window

afterwards, clicking Ctrl-Alt exits and immediately restarts grab.

I'm seeing two different behaviours depending on the guest:

The first is the traditional behaviour where you click in the window, it grabs and you control the guest's mouse cursor, and here ctrl+alt works fine to ungrab.

The second one is much like with the tablet in that it shared the mouse cursor between host and guest. In this one, when I ungrab with ctrl+alt, it automatically grabs again as soon as I move the mouse cursor (i.e. it is actually ungrabbed if I only use the keyboard). But as the mouse cursor is shared with the host, I can simply move it out of the VM window and then the capture ends, so that's fine.

So for me that's exactly what I want it to do (RHEL 7 host with qemu.git master). Is what you got the second behaviour, but without the shared mouse cursor?

Kevin

#24 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin
Quoted 6 lines
Quoted 6 lines

[ 2.6 good, 2.7, 2.8 bad ]

It doesn't reproduce here. There must be some other factor which is needed to trigger this. What desktop you are using? gnome? kde? something else? Xorg or wayland?

Quoted 7 lines
Quoted 4 lines

Can you try to bisect it?

cheers,
Gerd

Looks like 2.6 does not work either :(

That is in line with my assumption that there must be something else needed in addition to trigger it. Maybe it happens on F25 only and F24 used to work fine for you?

Quoted 1 line

Gerd, are you using F25?

RHEL-7 with gnome here.

cheers,
Gerd

#21 lore raw

Re: [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode

In reply to Michael S. Tsirkin

Hi,

Quoted 2 lines

One strange thing - I only see it when guest is in graphical mode. If guest is in text mode it works ok.

grabbing works slightly different depending on whenever the mouse is in absolute or relative mode, which is probably the reason for that.

With absolute mouse mode being active (using vmmouse or usb-tablet or virtio-tablet) SDL grabs the keyboard if the mouse is within the qemu window, and ungrabs if the mouse leaves the window. Ungrab keyboard via Ctrl-Alt still works for me, until you wiggle the mouse next time. But that is good enough to send specific keys to the host, i.e. just pressing the window key sends it to the guest, and I see the gnome window overview in the guest. Pressing Ctrl-Alt, then the window key shows the host gnome window overview.

cheers,
Gerd