]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: create logical volume with --yes option
authorKristina Hanicova <khanicov@redhat.com>
Thu, 22 Jul 2021 09:45:52 +0000 (11:45 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 23 Jul 2021 09:44:38 +0000 (11:44 +0200)
If lvcreate found an existing signature when trying to create a
new logical volume (E.g. left after some deleted volume), the
action failed due to inability to answer interactive question to
wiping it (lvcreate assumed 'no' was the answer). With added
option --yes to the command line, the answer to any interactive
question is assumed to be yes. Therefore, lvcreate wipes the
signature and the new volume is created successfully.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1940413

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_backend_logical.c

index ed8e47d8803a676ee4f3cdd29ec90bdf78f78fd5..02ede74aeb0685be7ce6982556ef3f11eaa0160b 100644 (file)
@@ -863,6 +863,8 @@ virStorageBackendLogicalLVCreate(virStorageVolDef *vol,
     else
         virCommandAddArg(cmd, def->source.name);
 
+    virCommandAddArg(cmd, "--yes");
+
     return virCommandRun(cmd, NULL);
 }