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

[Xen-devel] Create command fail if giving an empty disk file path, such

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Create command fail if giving an empty disk file path, such as ', hdc:cdrom, r'
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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. 
Actually 
it is also same to xenU, if not giving disk image file path.

I have located the issue is adding unify_resname function in 
tools/python/xen/util/security.py 

This function doesn't judge whether "resource" is empty string. If "resource" 
is 
empty string, following line will generate "ValueError" exception and capture 
by 
main.py.
                (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 
that 
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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>