diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 1c0fa6cb4f..9d977dd337 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -465,6 +465,8 @@ def main(argv): else: opts.load_defconfig() preprocess(opts, opts.vals) + if not opts.getopt('name') and opts.getopt('defconfig'): + opts.setopt('name', os.path.basename(opts.getopt('defconfig'))) config = make_config(opts.vals) if opts.vals.dryrun: PrettyPrint.prettyprint(config) diff --git a/tools/python/xen/xm/opts.py b/tools/python/xen/xm/opts.py index 0dfee0b7c9..f92c82dfe6 100644 --- a/tools/python/xen/xm/opts.py +++ b/tools/python/xen/xm/opts.py @@ -313,6 +313,9 @@ class Opts: print >>sys.stderr, "Error: Unknown option:", k self.usage() + if not args: + break + # then process the 1st arg (arg,args) = (args[0], args[1:])