File libvirt-virsh-Obey-pool-or-uuid-spec-when-creating-volumes.patch of Package libvirt

From e4fc12408b89c5b5888701e50e44ebf3aae551d6 Mon Sep 17 00:00:00 2001
Message-Id: <e4fc12408b89c5b5888701e50e44ebf3aae551d6.1373271643.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Tue, 4 Jun 2013 10:16:02 +0200
Subject: [PATCH] virsh: Obey pool-or-uuid spec when creating volumes

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

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.
(cherry picked from commit 634096536cb19ffdec5e255fa5f4419bf2c567d6)

Conflicts:
	tools/virsh-volume.c -- context
---
 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 1102d93..5b0abeb 100644
--- a/tools/virsh-volume.c
+++ b/tools/virsh-volume.c
@@ -147,8 +147,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
     unsigned long long capacity, allocation = 0;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
 
-    if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
-                                     VSH_BYNAME)))
+    if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
         return false;
 
     if (vshCommandOptString(cmd, "name", &name) <= 0)
@@ -299,8 +298,7 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
     bool ret = true;
     char *buffer;
 
-    if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
-                                           VSH_BYNAME)))
+    if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
         return false;
 
     if (vshCommandOptString(cmd, "file", &from) <= 0) {
-- 
1.8.2.1

openSUSE Build Service is sponsored by