Re: [PATCH v2] virsh-edit: Make force editing usable

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

 



On Thu, Feb 19, 2015 at 05:24:22PM +0100, Martin Kletzander wrote:
When editing a domain with 'virsh edit' and failing validation, the
usual message pops up:

 Failed. Try again? [y,n,f,?]:

Turning of validation can be ussable, mainly for testing (but other
purposes too), so this patch adds support for relaxing definition in
virsh-edit and makes 'virsh edit <domain>' more usable.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
v2:
- make a special case 'v' for turning off validation

tools/virsh-domain.c |  6 ++++++
tools/virsh-edit.c   | 21 +++++++++++++++++++--
tools/virsh.c        | 28 +++++++++++++++++++++-------
tools/virsh.h        |  4 ++--
4 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2506b89..b4761c6 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11265,7 +11265,13 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd)
    } while (0)
#define EDIT_DEFINE \
    (dom_edited = vshDomainDefine(ctl->conn, doc_edited, define_flags))
+#define EDIT_RELAX                                      \
+    do {                                                \
+        define_flags &= ~VIR_DOMAIN_DEFINE_VALIDATE;    \
+    } while (0);
+
#include "virsh-edit.c"
+#undefine EDIT_RELAX

I did s/undefine/undef/ here, but forgot to squash it in before
sending, but my local commit is fixed, don't worry.

Attachment: pgpikTBi5y6kF.pgp
Description: PGP signature

--
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]