summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-12 18:50:22 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-12 21:16:35 +0100
commit62c5b6db58911a5e51f59965619355437b7a7214 (patch)
tree1e7f79353f5f97d8bad38f4c975aec54aadb9a0f /daemon
parent0c0a7d0d868d153adf0600189f771459e1068b0a (diff)
downloadlibguestfs-62c5b6db58911a5e51f59965619355437b7a7214.tar.gz
libguestfs-62c5b6db58911a5e51f59965619355437b7a7214.tar.xz
libguestfs-62c5b6db58911a5e51f59965619355437b7a7214.zip
daemon: Always pass -F option to mke2fs.
Apparently e2fsprogs only knows that "/dev/sda" is a whole device, but doesn't think that "/dev/vda" is. On switching the default device over to virtio-scsi, that causes mke2fs without -F option to complain and ask for an interactive prompt. Adding -F forces it to go ahead anyway. This caused several less-used APIs to break with virtio-scsi.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/ext2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c
index 68247523..7876e664 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -377,7 +377,7 @@ do_mke2journal (int blocksize, const char *device)
snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
r = command (NULL, &err,
- prog, "-O", "journal_dev", "-b", blocksize_s,
+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s,
device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
@@ -409,7 +409,7 @@ do_mke2journal_L (int blocksize, const char *label, const char *device)
snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
r = command (NULL, &err,
- prog, "-O", "journal_dev", "-b", blocksize_s,
+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s,
"-L", label,
device, NULL);
if (r == -1) {
@@ -436,7 +436,7 @@ do_mke2journal_U (int blocksize, const char *uuid, const char *device)
snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
r = command (NULL, &err,
- prog, "-O", "journal_dev", "-b", blocksize_s,
+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s,
"-U", uuid,
device, NULL);
if (r == -1) {
@@ -468,7 +468,7 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device,
snprintf (jdev, len+32, "device=%s", journal);
r = command (NULL, &err,
- prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
@@ -505,7 +505,7 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device,
snprintf (jdev, len+32, "device=LABEL=%s", label);
r = command (NULL, &err,
- prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
@@ -536,7 +536,7 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device,
snprintf (jdev, len+32, "device=UUID=%s", uuid);
r = command (NULL, &err,
- prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
reply_with_error ("%s", err);