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] Fix the parsing of the is_a_template and

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix the parsing of the is_a_template and auto_power_on flags. Don't try to
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Mar 2007 14:10:18 -0700
Delivery-date: Thu, 22 Mar 2007 14:09:45 -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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174588875 0
# Node ID 2d918219f234705158c194f866a20e9fba6b68a9
# Parent  1fc6efdab399f6e421c1f8980edf83c7f857b543
Fix the parsing of the is_a_template and auto_power_on flags.  Don't try to
read the disk size on create -- just pass -1 instead -- as the filename may
be munged on the server-side.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/xenapi_create.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff -r 1fc6efdab399 -r 2d918219f234 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Thu Mar 22 18:40:20 2007 +0000
+++ b/tools/python/xen/xm/xenapi_create.py      Thu Mar 22 18:41:15 2007 +0000
@@ -242,9 +242,9 @@ class xenapi_create:
             "user_version":
                 get_text_in_child_node(vm, "version"),
             "is_a_template":
-                vm.attributes["is_a_template"].value,
+                vm.attributes["is_a_template"].value == 'true',
             "auto_power_on":
-                vm.attributes["auto_power_on"].value,
+                vm.attributes["auto_power_on"].value == 'true',
             "memory_static_max":
                 get_child_node_attribute(vm, "memory", "static_max"),
             "memory_static_min":
@@ -591,7 +591,6 @@ class sxp2xml:
     def extract_vdi(self, vbd_sxp, document):
         src = get_child_by_name(vbd_sxp, "uname")
         name = "vdi" + str(src.__hash__())
-        path = src[src.find(":")+1:]
 
         vdi = document.createElement("vdi")
 
@@ -599,8 +598,7 @@ class sxp2xml:
         vdi.attributes["read_only"] \
             = (get_child_by_name(vbd_sxp, "mode") != "w") \
                and "true" or "false"
-        vdi.attributes["size"] \
-            = str(os.path.getsize(path))
+        vdi.attributes["size"] = '-1'
         vdi.attributes["type"] = "system"
         vdi.attributes["shareable"] = "false"
         vdi.attributes["name"] = name

_______________________________________________
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] Fix the parsing of the is_a_template and auto_power_on flags. Don't try to, Xen patchbot-unstable <=