mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
13
lib/create.c
13
lib/create.c
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user