storage: create logical volume with --yes option

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>
This commit is contained in:
Kristina Hanicova 2021-07-22 11:45:52 +02:00 committed by Michal Privoznik
parent 7b8d4d99b5
commit d91a3e96c0
1 changed files with 2 additions and 0 deletions

View File

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