You, Yongkang
2006-Oct-23 08:54 UTC
[Xen-devel] 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 repotstrange "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@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Oct-23 11:02 UTC
Re: [Xen-devel] Create command fail if giving an empty disk file path, such as '', hdc:cdrom, r''
On 23/10/06 09:54, "You, Yongkang" <yongkang.you@intel.com> wrote:> 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?Seems okay. It''d be nice not to execute that path *at all* if ACM is not being used, or at least give a useful error message if the split on '':'' fails. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel