Always pass mkswap -f parameter.
[libguestfs.git] / daemon / swap.c
index db93e57..3ebdef6 100644 (file)
@@ -34,9 +34,9 @@ mkswap (char *device, const char *flag, const char *value)
   int r;
 
   if (!flag)
-    r = command (NULL, &err, "/sbin/mkswap", device, NULL);
+    r = command (NULL, &err, "/sbin/mkswap", "-f", device, NULL);
   else
-    r = command (NULL, &err, "/sbin/mkswap", flag, value, device, NULL);
+    r = command (NULL, &err, "/sbin/mkswap", "-f", flag, value, device, NULL);
 
   if (r == -1) {
     reply_with_error ("mkswap: %s", err);