WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Add option to xm create to skip DTD check

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Add option to xm create to skip DTD checks.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Mar 2007 16:10:12 -0700
Delivery-date: Tue, 27 Mar 2007 16:10:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tom Wilkie <tom.wilkie@xxxxxxxxx>
# Date 1174918164 -3600
# Node ID 3b2efc3cf6b60837f3ac527fce34bfd07dedf9e0
# Parent  d01e7ace9d2c27d652d624a313fe9d3224aae1b1
Add option to xm create to skip DTD checks.

signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xm/create.py        |   11 +++++++++--
 tools/python/xen/xm/xenapi_create.py |   11 ++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff -r d01e7ace9d2c -r 3b2efc3cf6b6 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Mon Mar 26 14:57:12 2007 +0100
+++ b/tools/python/xen/xm/create.py     Mon Mar 26 15:09:24 2007 +0100
@@ -103,6 +103,11 @@ gopts.opt('xmldryrun', short='x',
           fn=set_true, default=0,
           use="XML dry run - prints the resulting configuration in XML but "
           "does not create the domain.")
+
+gopts.opt('skipdtd', short='s',
+          fn=set_true, default=0,
+          use="Skip DTD checking - skips checks on XML before creating. "
+          " Experimental.  Can decreate create time." )
 
 gopts.opt('paused', short='p',
           fn=set_true, default=0,
@@ -1279,9 +1284,11 @@ def main(argv):
         from xen.xm.xenapi_create import xenapi_create
         xenapi_create_inst = xenapi_create()
         if opts.is_xml:
-            vm_refs = xenapi_create_inst.create(filename = config)
+            vm_refs = xenapi_create_inst.create(filename = config,
+                                                skipdtd = opts.vals.skipdtd)
         else:
-            vm_refs = xenapi_create_inst.create(document = doc)
+            vm_refs = xenapi_create_inst.create(document = doc,
+                                                skipdtd = opts.vals.skipdtd)
 
         map(lambda vm_ref: server.xenapi.VM.start(vm_ref, 0), vm_refs)
     elif not opts.is_xml:
diff -r d01e7ace9d2c -r 3b2efc3cf6b6 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Mon Mar 26 14:57:12 2007 +0100
+++ b/tools/python/xen/xm/xenapi_create.py      Mon Mar 26 15:09:24 2007 +0100
@@ -75,15 +75,20 @@ class xenapi_create:
 
         self.dtd = "/usr/lib/python/xen/xm/create.dtd"
 
-    def create(self, filename=None, document=None):
+    def create(self, filename=None, document=None, skipdtd=False):
         """
         Create a domain from an XML file or DOM tree
         """
+        if skipdtd:
+            print "Skipping DTD checks.  Dangerous!"
+        
         if filename is not None:
-            self.check_dtd(filename)
+            if not skipdtd:
+                self.check_dtd(filename)
             document = parse(filename)
         elif document is not None:
-            self.check_dom_against_dtd(document)
+            if not skipdtd:
+                self.check_dom_against_dtd(document)
 
         self.check_doc(document)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Add option to xm create to skip DTD checks., Xen patchbot-unstable <=