[libvirt] [PATCH] virsh: Obey pool-or-uuid spec when creating volumes

Our documentation says a pool may be referenced by its name or UUID anywhere if it makes sense (pool-name and pool-uuid are the only exceptions). However, vol-create and vol-create-as commands did not obey this. --- tools/virsh-volume.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index e16a385..35fb762 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -177,8 +177,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptBool(cmd, "prealloc-metadata")) flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA; - if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, - VSH_BYNAME))) + if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL))) return false; if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0) @@ -345,8 +344,7 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptBool(cmd, "prealloc-metadata")) flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA; - if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, - VSH_BYNAME))) + if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL))) return false; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) -- 1.8.2.1

On 06/04/13 10:27, Jiri Denemark wrote:
Our documentation says a pool may be referenced by its name or UUID anywhere if it makes sense (pool-name and pool-uuid are the only exceptions). However, vol-create and vol-create-as commands did not obey this. --- tools/virsh-volume.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
ACK Peter

On Tue, Jun 04, 2013 at 10:41:35 +0200, Peter Krempa wrote:
On 06/04/13 10:27, Jiri Denemark wrote:
Our documentation says a pool may be referenced by its name or UUID anywhere if it makes sense (pool-name and pool-uuid are the only exceptions). However, vol-create and vol-create-as commands did not obey this. --- tools/virsh-volume.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
ACK
Thanks, pushed. Jirka
participants (2)
-
Jiri Denemark
-
Peter Krempa