Re: [Libguestfs] [PATCH] launch: direct: specify format for appliance drive

Richard W.M. Jones
Mon, 18 Apr 2016 16:49:22 -0000

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