Revert "lib: Autodetect backing format and specify it explicitly."

This reverts commit 92fd5d5d40.

See discussion here:
https://www.redhat.com/archives/libguestfs/2020-March/thread.html#00041
This commit is contained in:
Richard W.M. Jones
2020-03-09 12:52:34 +00:00
parent 7a534669ae
commit 786dba91d1

View File

@@ -255,7 +255,6 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
const struct guestfs_disk_create_argv *optargs)
{
const char *backingformat = NULL;
CLEANUP_FREE char *backingformat_free = NULL;
const char *preallocation = NULL;
const char *compat = NULL;
int clustersize = -1;
@@ -303,18 +302,6 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
}
}
/* With libvirt >= 6.0 the backing format must be specified. */
if (backingfile != NULL && backingformat == NULL) {
backingformat = backingformat_free = guestfs_disk_format (g, backingfile);
if (!backingformat)
return -1;
if (STREQ (backingformat, "unknown")) {
error (g, _("could not auto-detect the format of the backing file %s"),
backingfile);
return -1;
}
}
/* Assemble the qemu-img command line. */
guestfs_int_cmd_add_arg (cmd, "qemu-img");
guestfs_int_cmd_add_arg (cmd, "create");