Pino Toscano
2016-Apr-18 12:49 UTC
[Libguestfs] [PATCH] launch: direct: specify format for appliance drive
The drive used for the appliance is a raw (sparse) disk: specify that explicitly in its -drive qemu command line options, so qemu can skip the autodetection of its format and save a tiny bit of time. --- src/launch-direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/launch-direct.c b/src/launch-direct.c index ee0a855..8521e5a 100644 --- a/src/launch-direct.c +++ b/src/launch-direct.c @@ -563,7 +563,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) /* Add the ext2 appliance drive (after all the drives). */ if (has_appliance_drive) { ADD_CMDLINE ("-drive"); - ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none", + ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw", appliance); if (virtio_scsi) { -- 2.5.5
Richard W.M. Jones
2016-Apr-18 16:49 UTC
Re: [Libguestfs] [PATCH] launch: direct: specify format for appliance drive
On Mon, Apr 18, 2016 at 02:49:07PM +0200, Pino Toscano wrote:> The drive used for the appliance is a raw (sparse) disk: specify that > explicitly in its -drive qemu command line options, so qemu can skip the > autodetection of its format and save a tiny bit of time. > --- > src/launch-direct.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/launch-direct.c b/src/launch-direct.c > index ee0a855..8521e5a 100644 > --- a/src/launch-direct.c > +++ b/src/launch-direct.c > @@ -563,7 +563,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) > /* Add the ext2 appliance drive (after all the drives). */ > if (has_appliance_drive) { > ADD_CMDLINE ("-drive"); > - ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none", > + ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw", > appliance);ACK. If I'm right, it seems we don't need any change in src/launch-libvirt.c, because we specify the backing file format ("raw") when creating the overlay in make_qcow2_overlay, and we set the overlay format ("qcow2") when adding the disk XML in construct_libvirt_xml_appliance. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Pino Toscano
2016-Apr-18 16:51 UTC
Re: [Libguestfs] [PATCH] launch: direct: specify format for appliance drive
On Monday 18 April 2016 17:49:22 Richard W.M. Jones wrote:> On Mon, Apr 18, 2016 at 02:49:07PM +0200, Pino Toscano wrote: > > The drive used for the appliance is a raw (sparse) disk: specify that > > explicitly in its -drive qemu command line options, so qemu can skip the > > autodetection of its format and save a tiny bit of time. > > --- > > src/launch-direct.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/launch-direct.c b/src/launch-direct.c > > index ee0a855..8521e5a 100644 > > --- a/src/launch-direct.c > > +++ b/src/launch-direct.c > > @@ -563,7 +563,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) > > /* Add the ext2 appliance drive (after all the drives). */ > > if (has_appliance_drive) { > > ADD_CMDLINE ("-drive"); > > - ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none", > > + ADD_CMDLINE_PRINTF ("file=%s,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw", > > appliance); > > ACK. > > If I'm right, it seems we don't need any change in > src/launch-libvirt.c, because we specify the backing file format > ("raw") when creating the overlay in make_qcow2_overlay, and we set > the overlay format ("qcow2") when adding the disk XML in > construct_libvirt_xml_appliance.Yup, that's why only the direct backend was patched. -- Pino Toscano
Reasonably Related Threads
- Re: [PATCH] launch: direct: specify format for appliance drive
- [PATCH v3] launch: direct: Add DAX root filesystem support.
- [PATCH v2] launch: direct: Add DAX root filesystem support.
- [PATCH 0/4] common: Add a simple mini-library for handling qemu command and config files.
- [PATCH 0/2] Don't use snapshot=on