mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
format, make-fs: specify the label on mkfs
If specified, pass the label for the new filesystem directly to the mkfs (or mkfs_btrfs) call. This saves one set_label call, mostly.
This commit is contained in:
@@ -434,13 +434,15 @@ do_format (void)
|
||||
}
|
||||
|
||||
if (filesystem) {
|
||||
if (guestfs_mkfs_opts (g, filesystem, dev, -1) == -1)
|
||||
exit (EXIT_FAILURE);
|
||||
struct guestfs_mkfs_opts_argv optargs = { .bitmask = 0 };
|
||||
|
||||
if (label) {
|
||||
if (guestfs_set_label (g, dev, label) == -1)
|
||||
exit (EXIT_FAILURE);
|
||||
optargs.label = label;
|
||||
optargs.bitmask |= GUESTFS_MKFS_OPTS_LABEL_BITMASK;
|
||||
}
|
||||
|
||||
if (guestfs_mkfs_opts_argv (g, filesystem, dev, &optargs) == -1)
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (free_dev)
|
||||
|
||||
Reference in New Issue
Block a user