[libvirt] [PATCH 1/5]virsh: disable config readonly and shareable in virsh command

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Fri Oct 18 06:42:38 UTC 2013


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

Daneil's suggestion about flag <shareable/> and <readonly/> as follow:
- Exclusive read-write. This is the default
- Shared read-write. This is the <shareable/> flag
- Shared read-only. This is the <readonly/> flag

So we should disable config both readonly and shareable
in virsh command to solve the confliction.
For backwards compatibility we keep the code about '<shareable/>'.
In this patch, '--mode' option will have high priority.
If set, it will screen the '--shareable' option.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6d241db..2aed9f9 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -609,7 +609,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
     if (wwn)
         virBufferAsprintf(&buf, "  <wwn>%s</wwn>\n", wwn);
 
-    if (vshCommandOptBool(cmd, "shareable"))
+    if (!mode && vshCommandOptBool(cmd, "shareable"))
         virBufferAddLit(&buf, "  <shareable/>\n");
 
     if (straddr) {
-- 
1.8.2.1




More information about the libvir-list mailing list