[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] implement --pool option for virsh vol-path

This patch fixes the problem reported in:


The bug reporter says that vol-delete does not support the --pool option, but that's not the case in the current head. This patch makes vol-path behave the same way as vol-delete.

>From 97199f44caeeeb38e64079c88fb02fcef35eadaa Mon Sep 17 00:00:00 2001
From: David Allan <dallan redhat com>
Date: Thu, 10 Dec 2009 15:22:20 -0500
Subject: [PATCH 1/1] Add --pool option to vol-path

* Modified vol-path to use the same logic as vol-delete, allowing the syntax:

virsh vol-path --pool testdirpool testvol0
 tools/virsh.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 94a99e9..7d81c68 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5275,12 +5275,14 @@ static int
 cmdVolPath(vshControl *ctl, const vshCmd *cmd)
     virStorageVolPtr vol;
+    char *name = NULL;

     if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
         return FALSE;
-    if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
-                                   VSH_BYUUID)))
+    if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", &name))) {
         return FALSE;
+    }

     vshPrint(ctl, "%s\n", virStorageVolGetPath(vol));

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]