fish: For -N option, add drive with explicit format = "raw".

Although autodetecting is safe (we always have just created a drive),
it saves a little bit of time if we don't have to run qemu-img to
detect the disk format with the libvirt backend.

Note that for prepared drives the format is always raw and we don't
anticipate creating drives in other formats.
This commit is contained in:
Richard W.M. Jones
2013-07-23 09:42:45 +01:00
parent 7c8c6e0760
commit ccd069f859

View File

@@ -367,13 +367,10 @@ add_drives (struct drv *drv, char next_drive)
#if COMPILING_GUESTFISH
case drv_N:
/* guestfs_add_drive (ie. autodetecting) should be safe here
* since we have just created the prepared disk. At the moment
* it will always be "raw" but in a theoretical future we might
* create other formats.
*/
/* -N option is not affected by --ro */
r = guestfs_add_drive (g, drv->N.filename);
r = guestfs_add_drive_opts (g, drv->N.filename,
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
-1);
if (r == -1)
exit (EXIT_FAILURE);