search for: get_source_format_or_autodetect

Displaying 4 results from an estimated 4 matches for "get_source_format_or_autodetect".

2016 Aug 02
0
[PATCH] launch: libvirt: Autodetect backing format for drive overlays (RHBZ#1354335).
...pass that to + * libvirt. + * + * This can still be a security issue, so in most cases it is + * recommended the users pass the format to libguestfs which will + * faithfully pass that to libvirt and this function won't be used. + * + * Caller must free the returned string. + */ +static char * +get_source_format_or_autodetect (guestfs_h *g, struct drive *drv) +{ + if (drv->src.format) + return safe_strdup (g, drv->src.format); + + if (drv->src.protocol == drive_protocol_file) { + char *format; + + format = guestfs_disk_format (g, drv->src.u.path); + if (!format) + return NULL; + + if (S...
2018 Apr 30
0
[PATCH 2/4] launch: libvirt: free format string
...isk_format() is not known, free the string before returning an error. --- lib/launch-libvirt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index e4961f201..844023b80 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -197,6 +197,7 @@ get_source_format_or_autodetect (guestfs_h *g, struct drive *drv) error (g, _("could not auto-detect the format.\n" "If the format is known, pass the format to libguestfs, eg. using the\n" "‘--format’ option, or via the optional ‘format’ argument to ‘add-drive’...
2020 Feb 06
1
Re: [PATCH v2] launch: add support for autodetection of appliance image format
...} end_list (); > start_list ("-device") { > append_list ("scsi-hd"); > diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c > index 4adb2cfb3..030ea6911 100644 > --- a/lib/launch-libvirt.c > +++ b/lib/launch-libvirt.c > @@ -212,9 +212,10 @@ get_source_format_or_autodetect (guestfs_h *g, struct drive *drv) > > /** > * Create a qcow2 format overlay, with the given C<backing_drive> > - * (file). The C<format> parameter, which must be non-NULL, is the > - * backing file format. This is used to create the appliance overlay, > - * and...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...-size' key")); + error (g, _("qemu-img info: JSON output did not contain ‘virtual-size’ key")); return -1; } diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index 168bba6ac..261b09cda 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -196,7 +196,7 @@ get_source_format_or_autodetect (guestfs_h *g, struct drive *drv) if (STREQ (format, "unknown")) { error (g, _("could not auto-detect the format.\n" "If the format is known, pass the format to libguestfs, eg. using the\n" - "'--format' opti...