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

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

 



From: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]