daemon/btrfs.c: Ignore mkfs.btrfs allocstart option.

This was deprecated in btrfs 4.14.1 and recently removed (see
btrfs-progs commit 4bd94dba8a "btrfs-progs: mkfs: remove alloc start
options and docs").  If the option is set simply ignore it.
This commit is contained in:
Richard W.M. Jones
2021-03-22 14:25:11 +00:00
parent 1eb055bd46
commit 9108ad152d

View File

@@ -148,7 +148,6 @@ do_mkfs_btrfs (char *const *devices,
size_t i = 0, j;
int r;
CLEANUP_FREE char *err = NULL;
char allocstart_s[64];
char bytecount_s[64];
char leafsize_s[64];
char nodesize_s[64];
@@ -163,13 +162,9 @@ do_mkfs_btrfs (char *const *devices,
/* Optional arguments. */
if (optargs_bitmask & GUESTFS_MKFS_BTRFS_ALLOCSTART_BITMASK) {
if (allocstart < 0) {
reply_with_error ("allocstart must be >= 0");
return -1;
}
snprintf (allocstart_s, sizeof allocstart_s, "%" PRIi64, allocstart);
ADD_ARG (argv, i, "--alloc-start");
ADD_ARG (argv, i, allocstart_s);
/* --alloc-start was deprecated in btrfs-progs 4.14.1. Ignore
* this option if present.
*/
}
if (optargs_bitmask & GUESTFS_MKFS_BTRFS_BYTECOUNT_BITMASK) {