mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
virt-make-fs: Provide a clearer error message when mkfs fails (RHBZ#823883).
This commit is contained in:
@@ -456,7 +456,19 @@ eval {
|
||||
|
||||
# Create the filesystem.
|
||||
if ($type ne "btrfs") {
|
||||
$g->mkfs ($type, $dev);
|
||||
eval {
|
||||
$g->mkfs ($type, $dev);
|
||||
};
|
||||
if ($@) {
|
||||
# Provide more guidance in the error message (RHBZ#823883).
|
||||
print STDERR "'mkfs' (create filesystem) operation failed.\n";
|
||||
if ($type eq "fat") {
|
||||
print STDERR "Instead of 'fat', try 'vfat' (long filenames) or 'msdos' (short filenames).\n";
|
||||
} else {
|
||||
print STDERR "Is '$type' a correct filesystem type?\n";
|
||||
}
|
||||
die
|
||||
}
|
||||
} else {
|
||||
$g->mkfs_btrfs ([$dev], datatype => "single", metadata => "single");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user