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

[Xen-devel] Create command fail if giving an empty disk file path, such as ', hdc:cdrom, r'

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "You, Yongkang" <yongkang.you@xxxxxxxxx>
  • Date: Mon, 23 Oct 2006 16:54:47 +0800
  • Delivery-date: Mon, 23 Oct 2006 03:05:28 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acb2gOPOYZ93C0C1TB6YjcygLMyn7A==
  • Thread-topic: Create command fail if giving an empty disk file path, such as ', hdc:cdrom, r'

Hi all,

>From changeset 11814, default HVM config can not be created up. It just repot 
strange "xm create" usage error. It need to remove ',hdc:cdrom,r' option or add 
a full file path like 'file:/abc.iso,hdc:cdrom,r' to create HVM successfully. 
it is also same to xenU, if not giving disk image file path.

I have located the issue is adding unify_resname function in 

This function doesn't judge whether "resource" is empty string. If "resource" 
empty string, following line will generate "ValueError" exception and capture 
                (type, resfile) = resource.split(":")

The easiest fixing is to add judgment to resource. If so, Guests can be created 
even if not providing any disk image file, and let the boot process to tell 
user didn't give the right disk. This is also the used to be. But I am not sure 
if it is 
an acceptable fixing. Could anybody give some advice?

diff -r 8113c55a6efd tools/python/xen/util/security.py
--- a/tools/python/xen/util/security.py Sun Oct 22 16:38:59 2006
+++ b/tools/python/xen/util/security.py Mon Oct 23 16:48:46 2006
@@ -601,6 +601,9 @@
     """Makes all resource locations absolute. In case of physical
     resources, '/dev/' is added to local file names"""

+    if not resource:
+        return resource
     # sanity check on resource name
     (type, resfile) = resource.split(":")
     if type == "phy":

Best Regards,
Yongkang (Kangkang) 永康

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.