[Pkg-libvirt-commits] [SCM] Virt Installer packaging branch, master, updated. debian/0.400.3-2-1-ga548e37

Guido Günther agx at sigxcpu.org
Fri May 15 07:09:53 UTC 2009


The following commit has been merged in the master branch:
commit a548e37f51554c6c8293569f213a40e66fb83d39
Author: Guido Günther <agx at sigxcpu.org>
Date:   Thu May 14 21:23:26 2009 +0200

    Update patches
    
    * drop 0001-Don-t-require-256MB-on-Debian-installations.patch, Upstream
      changed that to 64MB
    * new patch 0003-allow-to-pass-nic-model.patch: allow to pass the nic
      model on the command line
    * new patch 0004-parse-etc-default-console-setup-for-keymap-informat.patch
      parses /etc/default/console-setup for keymap data
    
    Closes: #528454

diff --git a/debian/patches/0001-Don-t-require-256MB-on-Debian-installations.patch b/debian/patches/0001-Don-t-require-256MB-on-Debian-installations.patch
deleted file mode 100644
index 3d74d0f..0000000
--- a/debian/patches/0001-Don-t-require-256MB-on-Debian-installations.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Guido Guenther <agx at sigxcpu.org>
-Date: Tue, 24 Jun 2008 15:26:29 +0200
-Subject: [PATCH] Don't require 256MB on Debian installations
-
-Closes: #455860
----
- virt-install    |    2 +-
- virtinst/cli.py |   10 +++++++---
- 2 files changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/virt-install b/virt-install
-index ac4da5b..141a5ac 100755
---- a/virt-install
-+++ b/virt-install
-@@ -589,7 +589,7 @@ def main():
-         ishvm = False
- 
-     cli.get_name(options.name, guest)
--    cli.get_memory(options.memory, guest)
-+    cli.get_memory(options.memory, guest, options.distro_variant)
-     cli.get_uuid(options.uuid, guest)
-     cli.get_vcpus(options.vcpus, options.check_cpu, guest, conn)
-     cli.get_cpuset(options.cpuset, guest.memory, guest, conn)
-diff --git a/virtinst/cli.py b/virtinst/cli.py
-index 12ab73b..9aeaeb6 100644
---- a/virtinst/cli.py
-+++ b/virtinst/cli.py
-@@ -192,11 +192,15 @@ def get_name(name, guest):
-     except ValueError, e:
-         fail(e)
- 
--def get_memory(memory, guest):
-+def get_memory(memory, guest, os_variant=None):
-+    if os_variant in [ 'debianLenny', 'debianEtch' ]:
-+        min_ram = 64
-+    else:
-+        min_ram = MIN_RAM
-     if memory is None:
-         fail(_("Memory amount is required for the virtual machine."))
--    if memory < MIN_RAM:
--        fail(_("Installs currently require %d megs of RAM.") % MIN_RAM)
-+    if memory < min_ram:
-+        fail(_("Installs currently require %d megs of RAM.") % min_ram)
-     try:
-         guest.memory = memory
-     except ValueError, e:
--- 
diff --git a/debian/patches/0002-fix-path-to-hvmloader.patch b/debian/patches/0001-fix-path-to-hvmloader.patch
similarity index 100%
rename from debian/patches/0002-fix-path-to-hvmloader.patch
rename to debian/patches/0001-fix-path-to-hvmloader.patch
diff --git a/debian/patches/0003-Fix-path-to-pygrub.patch b/debian/patches/0002-Fix-path-to-pygrub.patch
similarity index 100%
rename from debian/patches/0003-Fix-path-to-pygrub.patch
rename to debian/patches/0002-Fix-path-to-pygrub.patch
diff --git a/debian/patches/0003-allow-to-pass-nic-model.patch b/debian/patches/0003-allow-to-pass-nic-model.patch
new file mode 100644
index 0000000..e23ba77
--- /dev/null
+++ b/debian/patches/0003-allow-to-pass-nic-model.patch
@@ -0,0 +1,148 @@
+From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Fri, 8 May 2009 11:57:39 +0200
+Subject: [PATCH] allow to pass nic model
+
+---
+ man/en/virt-install.pod.in |   13 ++++++++++++-
+ virt-image                 |    4 ++--
+ virt-install               |    6 +++---
+ virtinst/cli.py            |   37 ++++++++++++++++++++++++++++++++-----
+ 4 files changed, 49 insertions(+), 11 deletions(-)
+
+diff --git a/man/en/virt-install.pod.in b/man/en/virt-install.pod.in
+index 6c5f38d..d908825 100644
+--- a/man/en/virt-install.pod.in
++++ b/man/en/virt-install.pod.in
+@@ -387,7 +387,7 @@ running 'Live CD' images or installing to network storage (iSCSI or NFS root).
+ 
+ =over 2
+ 
+-=item -w NETWORK, --network=NETWORK
++=item -w NETWORK, --network=NETWORK,opt1=val1,opt2=val2
+ 
+ Connect the guest to the host network. The value for C<NETWORK> can take
+ one of 3 formats:
+@@ -423,6 +423,17 @@ that will be used for connectivity. Failing that, the virtual network
+ called C<default> will be used. This option can be specified multiple
+ times to setup more than one NIC.
+ 
++Available options are:
++
++=over 4
++
++=item model
++
++Network device model as seen by the guest. Value can be any nic model supported
++by the hypervisor, e.g.: 'e1000', 'rtl8139' or 'virtio'.
++
++=back
++
+ =item -b BRIDGE, --bridge=BRIDGE
+ 
+ Bridge device to connect the guest NIC to. This parameter is deprecated in
+diff --git a/virt-image b/virt-image
+index a4ab352..18a4a72 100755
+--- a/virt-image
++++ b/virt-image
+@@ -57,8 +57,8 @@ def get_vcpus(vcpus, image_vcpus, check_cpu, guest, conn):
+ 
+ def get_networks(domain, macs, bridges, networks, guest):
+     nnics = domain.interface
+-    (macs, networks) = cli.digest_networks(guest.conn, macs, bridges,
+-                                           networks, nnics)
++    (macs, networks, models) = cli.digest_networks(guest.conn, macs, bridges,
++                                                   networks, nnics)
+ 
+     if len(networks) > nnics:
+         print >> sys.stderr, (_("Warning: more networks were provided [%i] then nics required [%i]. All extras are ignored") % (len(networks),  nnics))
+diff --git a/virt-install b/virt-install
+index ac4da5b..4675a0d 100755
+--- a/virt-install
++++ b/virt-install
+@@ -254,9 +254,9 @@ def get_networks(macs, bridges, networks, nonetworks, guest):
+         if networks:
+             fail(_("Cannot use --network with --nonetworks"))
+         return
+-    (macs, networks) = cli.digest_networks(guest.conn, macs, bridges,
+-                                           networks, nics=1)
+-    map(lambda m, n: cli.get_network(m, n, guest), macs, networks)
++    (macs, networks, models) = cli.digest_networks(guest.conn, macs, bridges,
++                                                   networks, nics=1)
++    map(lambda m, n, o: cli.get_network(m, n, guest, o), macs, networks, models)
+ 
+ 
+ 
+diff --git a/virtinst/cli.py b/virtinst/cli.py
+index 12ab73b..c3a6927 100644
+--- a/virtinst/cli.py
++++ b/virtinst/cli.py
+@@ -261,21 +261,46 @@ def get_cpuset(cpuset, mem, guest, conn):
+         guest.cpuset = cpustr
+     return
+ 
+-def get_network(mac, network, guest):
++def get_network(mac, network, guest, model=None):
+     if mac == "RANDOM":
+         mac = None
+     if network == "user":
+-        n = VirtualNetworkInterface(mac, type="user", conn=guest.conn)
++        n = VirtualNetworkInterface(mac, type="user", 
++                                    conn=guest.conn, model=model)
+     elif network[0:6] == "bridge":
+         n = VirtualNetworkInterface(mac, type="bridge", bridge=network[7:],
+-                                    conn=guest.conn)
++                                    conn=guest.conn, model=model)
+     elif network[0:7] == "network":
+         n = VirtualNetworkInterface(mac, type="network", network=network[8:],
+-                                    conn=guest.conn)
++                                    conn=guest.conn, model=model)
+     else:
+         fail(_("Unknown network type ") + network)
+     guest.nics.append(n)
+ 
++def parse_network_opts(networks):
++    nets = []
++    models = []
++
++    for network in networks:
++        opts = { 'model': None }
++        args = network.split(",")
++        nets.append(args[0])
++
++        for opt in args[1:]:
++            opt_type = None
++            opt_val = None
++            if opt.count("="):
++                opt_type, opt_val = opt.split("=", 1)
++                opts[opt_type.lower()] = opt_val.lower()
++
++        for opt_type in opts:
++            if opt_type == "model":
++                models.append(opts[opt_type])
++            else:
++                fail(_("Unknown '%s' value '%s'") % (opt_type, opt_val))
++
++    return (nets, models)
++
+ def digest_networks(conn, macs, bridges, networks, nics = 0):
+     def listify(l):
+         if l is None:
+@@ -295,6 +320,8 @@ def digest_networks(conn, macs, bridges, networks, nics = 0):
+     if bridges:
+         networks = map(lambda b: "bridge:" + b, bridges)
+     
++    (networks, models) = parse_network_opts(networks)
++
+     # With just one mac, create a default network if one is not
+     # specified.
+     if len(macs) == 1 and len(networks) == 0:
+@@ -323,7 +350,7 @@ def digest_networks(conn, macs, bridges, networks, nics = 0):
+                 networks.append("user")
+             macs.append(None)
+             
+-    return (macs, networks)
++    return (macs, networks, models)
+ 
+ def get_graphics(vnc, vncport, nographics, sdl, keymap, guest):
+     if (vnc and nographics) or \
+-- 
diff --git a/debian/patches/0004-parse-etc-default-console-setup-for-keymap-informat.patch b/debian/patches/0004-parse-etc-default-console-setup-for-keymap-informat.patch
new file mode 100644
index 0000000..73b1995
--- /dev/null
+++ b/debian/patches/0004-parse-etc-default-console-setup-for-keymap-informat.patch
@@ -0,0 +1,59 @@
+From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Thu, 14 May 2009 21:16:53 +0200
+Subject: [PATCH] parse /etc/default/console-setup for keymap information
+
+Closes: #528454
+---
+ virtinst/util.py |   24 ++++++++++++++++++++++++
+ 1 files changed, 24 insertions(+), 0 deletions(-)
+
+diff --git a/virtinst/util.py b/virtinst/util.py
+index 17dcc14..2698b59 100644
+--- a/virtinst/util.py
++++ b/virtinst/util.py
+@@ -43,6 +43,7 @@ from User import User
+ 
+ KEYBOARD_DIR = "/etc/sysconfig/keyboard"
+ XORG_CONF = "/etc/X11/xorg.conf"
++CONSOLE_SETUP_CONF = "/etc/default/console-setup"
+ 
+ def default_route(nic = None):
+     if platform.system() == 'SunOS':
+@@ -354,6 +355,27 @@ def _xorg_keymap():
+         f.close()
+     return kt
+ 
++def _console_setup_keymap():
++    """Look in /etc/default/console-setup for the host machine's keymap, and attempt to
++       map it to a keymap supported by qemu"""
++
++    kt = None
++    try:
++        f = open(CONSOLE_SETUP_CONF, "r")
++    except IOError, e:
++        logging.debug('Could not open "%s": %s ' % (CONSOLE_SETUP_CONF, str(e)))
++    else:
++        keymap_re = re.compile(r'\s*XKBLAYOUT="(?P<kt>[a-z-]+)"')
++        for line in f:
++            m = keymap_re.match(line)
++            if m:
++                kt = m.group('kt')
++                break
++        else:
++            logging.debug("Didn't find keymap in '%s'!" % XORG_CONF)
++        f.close()
++    return kt
++
+ def default_keymap():
+     """Look in /etc/sysconfig for the host machine's keymap, and attempt to
+        map it to a keymap supported by qemu"""
+@@ -369,6 +391,8 @@ def default_keymap():
+     except IOError, e:
+         logging.debug('Could not open "/etc/sysconfig/keyboard" ' + str(e))
+         kt = _xorg_keymap()
++        if not kt:
++            kt = _console_setup_keymap()
+     else:
+         while 1:
+             s = f.readline()
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 34aba7f..b89f189 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
-0001-Don-t-require-256MB-on-Debian-installations.patch
-0002-fix-path-to-hvmloader.patch
-0003-Fix-path-to-pygrub.patch
+0001-fix-path-to-hvmloader.patch
+0002-Fix-path-to-pygrub.patch
+0003-allow-to-pass-nic-model.patch
+0004-parse-etc-default-console-setup-for-keymap-informat.patch

-- 
Virt Installer packaging



More information about the Pkg-libvirt-commits mailing list