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 683558 - Make sure 'QEMU Session' exists at startup
Make sure 'QEMU Session' exists at startup
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-09-07 09:47 UTC by Christophe Fergeau
Modified: 2016-03-31 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make sure 'QEMU Session' exists at startup (1.16 KB, patch)
2012-09-07 09:47 UTC, Christophe Fergeau
accepted-commit_now Details | Review
Make sure 'QEMU Session' exists at startup (1.30 KB, patch)
2012-09-07 10:09 UTC, Christophe Fergeau
committed Details | Review
Add missing '\n' to error message (830 bytes, patch)
2012-09-07 10:09 UTC, Christophe Fergeau
committed Details | Review
Simplify and robustify Util::keyfile_save (1.66 KB, patch)
2012-09-07 10:09 UTC, Christophe Fergeau
committed Details | Review

Description Christophe Fergeau 2012-09-07 09:47:22 UTC
Without it, Boxes fails to start. At startup, Boxes creates it
if ~/.config/gnome-boxes/sources/ does not exist. It's better to
directly check for the file we are interested in. Reason for this
patch is that while testing other patches, this file went missing...
Comment 1 Christophe Fergeau 2012-09-07 09:47:23 UTC
Created attachment 223735 [details] [review]
Make sure 'QEMU Session' exists at startup
Comment 2 Marc-Andre Lureau 2012-09-07 09:50:58 UTC
Review of attachment 223735 [details] [review]:

What happen when it is missing?

ideally, I would prefer Boxes not to depend explicitely on it. But it's not really supported yet, so ack..
Comment 3 Christophe Fergeau 2012-09-07 10:09:34 UTC
Created attachment 223738 [details] [review]
Make sure 'QEMU Session' exists at startup

Without it, Boxes fails to start:

(gnome-boxes:19000): Boxes-WARNING **: app.vala:322: No such file or directory
error: missing or failing default libvirt connection
$

At startup, Boxes creates this file if ~/.config/gnome-boxes/sources/
does not exist. It's better to directly check for the file we are
interested in. Reason for this patch is that while testing other patches,
this file went missing...
Comment 4 Christophe Fergeau 2012-09-07 10:09:45 UTC
Created attachment 223739 [details] [review]
Add missing '\n' to error message
Comment 5 Christophe Fergeau 2012-09-07 10:09:57 UTC
Created attachment 223740 [details] [review]
Simplify and robustify Util::keyfile_save

The previous implementation was deleting the keyfile and then
trying to write to it. This means we can endup with an empty/partial
keyfile if an error occurs during the writing. g_file_set_contents
will write to a temporary file and then atomatically replace the
existing file which is much better. This also makes this function
shorter.
Comment 6 Marc-Andre Lureau 2012-09-07 10:19:28 UTC
Review of attachment 223740 [details] [review]:

ack
Comment 7 Marc-Andre Lureau 2012-09-07 10:20:41 UTC
Review of attachment 223739 [details] [review]:

ack