Richard W.M. Jones
2016-Oct-25 09:16 UTC
Re: [Libguestfs] [PATCH] p2v: Inhibit power saving during the conversion.
On Tue, Oct 25, 2016 at 11:01:08AM +0200, Pino Toscano wrote:> On Monday, 24 October 2016 18:23:26 CEST Richard W.M. Jones wrote: > > We do this by sending an Inhibit() message to logind and receiving a > > file descriptor back, which we hold open until the conversion > > completes (or fails). This is described here: > > https://www.freedesktop.org/wiki/Software/systemd/inhibit/ > > > > This adds an additional optional dependency on DBus since we use DBus > > to call the Inhibit() method. > > > > Reported-by: Chris Cowley. > > Minor nitpick: "D-Bus" is the proper spelling.OK I will change this.> The rest of the libdbus-1 implementation looks correct, checking with > the API docs (and a bit the internals). Maybe could be worth using > the glib-based interface for it (dbus glib or GDBus).Is there any particular advantage? The low level API is pretty horrible to use, but in the end it wasn't too much code. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Pino Toscano
2016-Oct-25 09:37 UTC
Re: [Libguestfs] [PATCH] p2v: Inhibit power saving during the conversion.
On Tuesday, 25 October 2016 10:16:42 CEST Richard W.M. Jones wrote:> > The rest of the libdbus-1 implementation looks correct, checking with > > the API docs (and a bit the internals). Maybe could be worth using > > the glib-based interface for it (dbus glib or GDBus). > > Is there any particular advantage? The low level API is pretty > horrible to use, but in the end it wasn't too much code.Mostly because of the above, the fact that's low-level, and that using the glib binding should integrate with the glib main loop. Not a big deal anyway, let's go with the current code for now. Thanks, -- Pino Toscano
Richard W.M. Jones
2016-Oct-25 09:57 UTC
Re: [Libguestfs] [PATCH] p2v: Inhibit power saving during the conversion.
On Tue, Oct 25, 2016 at 11:37:17AM +0200, Pino Toscano wrote:> On Tuesday, 25 October 2016 10:16:42 CEST Richard W.M. Jones wrote: > > > The rest of the libdbus-1 implementation looks correct, checking with > > > the API docs (and a bit the internals). Maybe could be worth using > > > the glib-based interface for it (dbus glib or GDBus). > > > > Is there any particular advantage? The low level API is pretty > > horrible to use, but in the end it wasn't too much code. > > Mostly because of the above, the fact that's low-level, and that using > the glib binding should integrate with the glib main loop.We don't use the glib main loop for kernel-driven conversions anyway, so seems like it's best to use the low-level API. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v