[et-mgmt-tools] [PATCH 1 of 5] Make --arch optional

john.levon at sun.com john.levon at sun.com
Wed Jul 9 18:29:35 UTC 2008


# HG changeset patch
# User john.levon at sun.com
# Date 1215627958 25200
# Node ID c6d2254702a49d9674d6c549bd57cb87ac920e87
# Parent  a2be1263c2f5d3f346cfc3501682073fce2e8966
Make --arch optional.

Default to the current system arch.

Signed-off-by: John Levon <john.levon at sun.com>

diff --git a/man/en/virt-convert.1 b/man/en/virt-convert.1
--- a/man/en/virt-convert.1
+++ b/man/en/virt-convert.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "VIRT-CONVERT 1"
-.TH VIRT-CONVERT 1 "2008-07-01" "perl v5.8.8" "Virtual Machine Install Tools"
+.TH VIRT-CONVERT 1 "2008-07-04" "perl v5.8.8" "Virtual Machine Install Tools"
 .SH "NAME"
 virt\-convert \- convert virtual machines between formats
 .SH "SYNOPSIS"
@@ -161,7 +161,8 @@
 Show the help message and exit
 .IP "\-a \s-1ARCH\s0, \-\-arch=ARCH" 4
 .IX Item "-a ARCH, --arch=ARCH"
-Architecture of the virtual machine (i686, x86_64, ppc)
+Architecture of the virtual machine (i686, x86_64, ppc). Defaults to
+that of the host machine.
 .IP "\-v, \-\-hvm      Create  a fully virtualized guest image" 4
 .IX Item "-v, --hvm      Create  a fully virtualized guest image"
 Convert machine to a hvm/qemu based image (this is the default if paravirt is not specified)
diff --git a/man/en/virt-convert.pod b/man/en/virt-convert.pod
--- a/man/en/virt-convert.pod
+++ b/man/en/virt-convert.pod
@@ -39,7 +39,8 @@
 
 =item -a ARCH, --arch=ARCH
 
-Architecture of the virtual machine (i686, x86_64, ppc)
+Architecture of the virtual machine (i686, x86_64, ppc). Defaults to
+that of the host machine.
 
 =item  -v, --hvm      Create  a fully virtualized guest image
 
diff --git a/virt-convert b/virt-convert
--- a/virt-convert
+++ b/virt-convert
@@ -27,6 +27,7 @@
 from optparse import OptionParser
 
 import virtinst.cli as cli
+import virtinst.util as util
 import virtconv
 import virtconv.vmconfig as vmconfig
 
@@ -35,6 +36,7 @@
     opts.set_usage("%prog [options] inputdir|input.vmx "
         "[outputdir|output.xml]")
     opts.add_option("-a", "--arch", type="string", dest="arch",
+                    default=util.get_default_arch(),
                     help=("Machine Architecture Type (i686/x86_64/ppc)"))
     opts.add_option("-t", "--type", type="string", dest="type",
                     help=("Output virtualization type (hvm, paravirt"))
@@ -57,10 +59,6 @@
     if len(args) > 2:
         opts.error(("Too many arguments provided"))
     
-    if (options.arch is None):
-        opts.error(("Missing option value \n\nArchitecture: " +
-       str(options.arch)))
-
     # hard-code for now
     if options.inputformat != "vmx":
         opts.error(("Unsupported input format \"%s\"" % options.inputformat))




More information about the et-mgmt-tools mailing list