After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679751 - screenshot not properly updated on machine shutdown
screenshot not properly updated on machine shutdown
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.5.x (unsupported)
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-07-11 12:21 UTC by Christophe Fergeau
Modified: 2016-03-31 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot not properly updated on machine shutdown (759 bytes, patch)
2012-07-20 12:03 UTC, Marc-Andre Lureau
committed Details | Review

Description Christophe Fergeau 2012-07-11 12:21:24 UTC
When I shutdown a windows xp box, after it has shutdown, its thumbnail doesn't get its gray overlay to indicate it's off.  The 'stopped' event arrives after the display is disconnected, and the thumbnail is updated in Machine::disconnect_display. Since at that time the machine is still running, Machine::draw_vm doesn't add an overlay on top of the thumbnail.
Not sure what the best way to solve this is... Connect to Machine::state:stopped and set the overlay from there maybe?
Comment 1 Zeeshan Ali 2012-07-11 17:23:33 UTC
(In reply to comment #0)
> When I shutdown a windows xp box, after it has shutdown, its thumbnail doesn't
> get its gray overlay to indicate it's off.  The 'stopped' event arrives after
> the display is disconnected, and the thumbnail is updated in
> Machine::disconnect_display. Since at that time the machine is still running,
> Machine::draw_vm doesn't add an overlay on top of the thumbnail.
> Not sure what the best way to solve this is... Connect to
> Machine::state:stopped and set the overlay from there maybe?

Yeah, I thought that is how we do it already.
Comment 2 Marc-Andre Lureau 2012-07-20 12:03:07 UTC
Created attachment 219321 [details] [review]
screenshot not properly updated on machine shutdown
Comment 3 Christophe Fergeau 2012-07-20 16:58:15 UTC
Reloading blindly the screenshot from disk feels quite heavyweight as Machine::disconnect_display was changed to set it with no intermediate file in a5539fd063
Comment 4 Marc-Andre Lureau 2012-07-20 17:05:57 UTC
(In reply to comment #3)
> Reloading blindly the screenshot from disk feels quite heavyweight as
> Machine::disconnect_display was changed to set it with no intermediate file in
> a5539fd063

disconnect_display actually writes to disk, most likely the file is hot in the cache here. And nowadays, we save small files. otherwise, we need to keep the pixbuf around (which we actually probably have, but then it's convoluted code). Tbh, this is not an optimization I am interested in here. As I pointed out from the very begnining of screenshot opt., the biggest offender is still qemu & libvirt, not really boxes, even after Alex changes, and there are drawbacks to his approach. I prefer looking for the big fish. But feel free to improve the patch.  

In the meantime, it feels really broken to not have the machine state correct when shuting down, so perhaps we could keep the bug open for micro-optimization?
Comment 5 Zeeshan Ali 2012-07-28 14:49:47 UTC
Review of attachment 219321 [details] [review]:

ACK but IMO commit log summary should summarize what the patch does rather than the issue it solves:

Properly update screenshot on shutdown
Comment 6 Marc-Andre Lureau 2012-07-31 14:54:58 UTC
Attachment 219321 [details] pushed as c48d146 - screenshot not properly updated on machine shutdown