mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
Use the force flag for mkfs -t xfs
Without this, building an XFS pool on a formatted partition fails with --overwrite. https://bugzilla.redhat.com/show_bug.cgi?id=927172
This commit is contained in:
parent
cc7e150359
commit
904e6e906b
@ -665,11 +665,13 @@ virStorageBackendExecuteMKFS(const char *device,
|
||||
int ret = 0;
|
||||
virCommandPtr cmd = NULL;
|
||||
|
||||
cmd = virCommandNewArgList(MKFS,
|
||||
"-t",
|
||||
format,
|
||||
device,
|
||||
NULL);
|
||||
cmd = virCommandNewArgList(MKFS, "-t", format, NULL);
|
||||
|
||||
/* use the force, otherwise mkfs.xfs won't overwrite existing fs */
|
||||
if (STREQ(format, "xfs"))
|
||||
virCommandAddArg(cmd, "-f");
|
||||
|
||||
virCommandAddArg(cmd, device);
|
||||
|
||||
if (virCommandRun(cmd, NULL) < 0) {
|
||||
virReportSystemError(errno,
|
||||
|
Loading…
x
Reference in New Issue
Block a user