rpms/python-virtinst/F-8 virtinst-0.300.2-acpi.patch, NONE, 1.1 virtinst-0.300.2-force-option.patch, NONE, 1.1 virtinst-0.300.2-install-f9.patch, NONE, 1.1 virtinst-0.300.2-noreboot.patch, NONE, 1.1 virtinst-0.300.2-remove-file-exist-check.patch, NONE, 1.1 virtinst-0.300.2-satellite-distro-fix.patch, NONE, 1.1 virtinst-0.300.2-satellite-distro.patch, NONE, 1.1 virtinst-0.300.2-virt-clone-disk.patch, NONE, 1.1 python-virtinst.spec, 1.35, 1.36

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Wed Mar 19 19:02:19 UTC 2008


Author: berrange

Update of /cvs/pkgs/rpms/python-virtinst/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31168

Modified Files:
	python-virtinst.spec 
Added Files:
	virtinst-0.300.2-acpi.patch 
	virtinst-0.300.2-force-option.patch 
	virtinst-0.300.2-install-f9.patch 
	virtinst-0.300.2-noreboot.patch 
	virtinst-0.300.2-remove-file-exist-check.patch 
	virtinst-0.300.2-satellite-distro-fix.patch 
	virtinst-0.300.2-satellite-distro.patch 
	virtinst-0.300.2-virt-clone-disk.patch 
Log Message:
Sync patches from RHEL5 tree

virtinst-0.300.2-acpi.patch:

--- NEW FILE virtinst-0.300.2-acpi.patch ---
changeset:   255:b931aaa079cd
tag:         tip
user:        "Daniel P. Berrange <berrange at redhat.com>"
date:        Mon Feb 18 11:48:24 2008 -0500
files:       virtinst/FullVirtGuest.py
description:
Default  acpi & apic to be enabled as per previous releases


diff -r b33e850305be -r b931aaa079cd virtinst/FullVirtGuest.py
--- a/virtinst/FullVirtGuest.py	Tue Aug 21 17:46:58 2007 -0400
+++ b/virtinst/FullVirtGuest.py	Mon Feb 18 11:48:24 2008 -0500
@@ -152,6 +152,9 @@ class FullVirtGuest(Guest.XenGuest):
                     features[f] = FullVirtGuest.OS_TYPES[os_type]["variants"][os_variant][f]
                 else:
                     features[f] = FullVirtGuest.OS_TYPES[os_type][f]
+            else:
+                if features[f] is None:
+                    features[f] = True
         return features
 
     def get_os_distro(self):


virtinst-0.300.2-force-option.patch:

--- NEW FILE virtinst-0.300.2-force-option.patch ---
# HG changeset patch
# User "Cole Robinson <crobinso at redhat.com>"
# Date 1203011013 18000
# Node ID d5c41f1ff597cb74b9f4da8521972ca35f9aed7d
# Parent  71ebde48210c8dd642afddac6cf5629cd93f7955
Add simpler prompt for yes or no

diff -r 71ebde48210c -r d5c41f1ff597 virtinst/cli.py
--- a/virtinst/cli.py	Wed Feb 06 09:41:07 2008 -0500
+++ b/virtinst/cli.py	Thu Feb 14 12:43:33 2008 -0500
@@ -91,6 +91,18 @@ def yes_or_no(s):
     elif s in ("n", "no", "0", "false", "f"):
         return False
     raise ValueError, "A yes or no response is required"
+
+def prompt_for_yes_or_no(prompt):
+    """catches yes_or_no errors and ensures a valid bool return"""
+    while 1:
+        input = prompt_for_input(prompt, None)
+        try:
+            res = yes_or_no(input)
+            break
+        except ValueError, e:
+            print _("ERROR: "), e
+            continue
+    return res
 
 #
 # Ask for attributes
# HG changeset patch
# User "Cole Robinson <crobinso at redhat.com>"
# Date 1203011236 18000
# Node ID 07091304b75962460fd01c419a358e1a30fecb65
# Parent  d5c41f1ff597cb74b9f4da8521972ca35f9aed7d
Use new cli yes or no function for install tools. Remove prompting from
CloneManager. Fix virt-clone bug where full qualified paths weren't being
written to the config. Fix lack of prompt issue when just running 'virt-clone'

diff -r d5c41f1ff597 -r 07091304b759 virt-clone
--- a/virt-clone	Thu Feb 14 12:43:33 2008 -0500
+++ b/virt-clone	Thu Feb 14 12:47:16 2008 -0500
@@ -71,11 +71,40 @@ def get_clone_uuid(new_uuid, design):
     if new_uuid is not None:
         design.set_clone_uuid(new_uuid)
 
-def get_clone_diskfile(new_diskfile, design):
-    if new_diskfile is None:
-        raise ValueError, _("A new disk image file for the cloned guest is required")
-    for i in new_diskfile:
-        design.set_clone_devices(i) 
+def get_clone_diskfile(new_diskfiles, design, conn):
+    if new_diskfiles is None:
+        new_diskfiles = [None]
+
+    for i in range(0, len(new_diskfiles)):
+        disk = new_diskfiles[i]
+        while 1:
+            disk = cli.prompt_for_input(_("What would you like to use as the cloned disk (file path)?"), disk)
+
+            # Build disk object for validation
+            try:
+                d = virtinst.VirtualDisk(path=disk, size=0)
+            except ValueError, e:
+                print _("ERROR: "), e
+                disk = None
+                continue
+
+            # Check disk conflicts
+            if d.is_conflict_disk(conn) is True:
+                warnmsg = _("Disk %s is already in use by another guest!\n") % d.path
+                if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the disk (yes or no)? ")):
+                    disk = None
+                    continue
+            # Overwrite disk?
+            elif os.path.exists(d.path) and os.path.isfile(d.path):
+                warnmsg = _("You are going to overwrite file '%s'!\n") % d.path
+                if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the file (yes or no)? ")):
+                    disk = None
+                    continue
+            new_diskfiles[i] = d.path
+            break
+
+    for i in new_diskfiles:
+        design.set_clone_devices(i)
 
 def get_clone_sparse(sparse, design):
     design.set_clone_sparse(sparse)
@@ -161,8 +190,8 @@ def main():
     conn = cli.getConnection(options.connect)
     design = clmgr.CloneDesign(connection=conn)
 
-    try:    
-        get_clone_diskfile(options.new_diskfile, design)
+    try:
+        get_clone_diskfile(options.new_diskfile, design, conn)
         get_clone_macaddr(options.new_mac, design)
         get_original_guest(options.original_guest, design)
         get_clone_name(options.new_name, design)
diff -r d5c41f1ff597 -r 07091304b759 virt-install
--- a/virt-install	Thu Feb 14 12:43:33 2008 -0500
+++ b/virt-install	Thu Feb 14 12:47:16 2008 -0500
@@ -43,11 +43,7 @@ gettext.install(virtinst.gettext_app, vi
 ### General input gathering functions
 def get_full_virt():
     while 1:
-        res = cli.prompt_for_input(_("Would you like a fully virtualized guest (yes or no)?  This will allow you to run unmodified operating systems."))
-        try:
-            return cli.yes_or_no(res)
-        except ValueError, e:
-            print _("ERROR: "), e
+        return cli.prompt_for_yes_or_no(_("Would you like a fully virtualized guest (yes or no)?  This will allow you to run unmodified operating systems."))
 
 
 def get_disk(disk, size, sparse, guest, hvm, conn):
@@ -56,23 +52,8 @@ def get_disk(disk, size, sparse, guest, 
         if not size is None:
             msg = _("Please enter the path to the file you would like to use for storage. It will have size %sGB.") %(size,)
         disk = cli.prompt_for_input(msg, disk)
-        if os.path.exists(disk) and os.path.isfile(disk):
-            while 1:
-                retryFlg = False
-                warnmsg = _("You are going to overwrite file '%s'!\n") % disk
-                res = cli.prompt_for_input(warnmsg + _("Do you really want to use the file (yes or no)? "))
-                try:
-                    if cli.yes_or_no(res) is True:
-                        break
-                    else:
-                        retryFlg = True
-                        break
-                except ValueError, e:
-                    print _("ERROR: "), e
-                    continue
-            if retryFlg is True:
-                disk = None
-                continue
+
+        # Getting disk size
         while 1:
             if os.path.exists(disk):
                 break
@@ -84,33 +65,33 @@ def get_disk(disk, size, sparse, guest, 
                 print _("ERROR: "), e
                 size = None
 
+        # Build disk object
         try:
             d = virtinst.VirtualDisk(disk, size, sparse = sparse)
-            if d.is_conflict_disk(conn) is True:
-                while 1:
-                    retryFlg = False
-                    warnmsg = _("Disk %s is already in use by another guest!\n") % disk
-                    res = cli.prompt_for_input(warnmsg + _("Do you really want to use the disk (yes or no)? "))
-                    try:
-                        if cli.yes_or_no(res) is True:
-                            break
-                        else:
-                            retryFlg = True
-                            break
-                    except ValueError, e:
-                        print _("ERROR: "), e
-                        continue
-                if retryFlg is True:
-                    disk = size = None
-                    continue
-            if d.type == virtinst.VirtualDisk.TYPE_FILE and not(hvm) and virtinst.util.is_blktap_capable():
+            # Default file backed PV guests to tap driver
+            if d.type == virtinst.VirtualDisk.TYPE_FILE \
+               and not(hvm) and virtinst.util.is_blktap_capable():
                 d.driver_name = virtinst.VirtualDisk.DRIVER_TAP
         except ValueError, e:
             print _("ERROR: "), e
             disk = size = None
             continue
 
-        guest.disks.append(d)
+        # Check disk conflicts
+        if d.is_conflict_disk(conn) is True:
+            warnmsg = _("Disk %s is already in use by another guest!\n") \
+                         % d.path
+            if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the disk (yes or no)? ")):
+                disk = size = None
+                continue
+        # Overwrite disk?
+        elif os.path.exists(d.path) and os.path.isfile(d.path):
+            warnmsg = _("You are going to overwrite file '%s'!\n") % d.path
+            if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the file (yes or no)? ")):
+                disk = None
+                continue
+
+        guest.disks.append(disk)
         break
 
 def get_disks(disk, size, sparse, nodisks, guest, hvm, conn):
diff -r d5c41f1ff597 -r 07091304b759 virtinst/CloneManager.py
--- a/virtinst/CloneManager.py	Thu Feb 14 12:43:33 2008 -0500
+++ b/virtinst/CloneManager.py	Thu Feb 14 12:47:16 2008 -0500
@@ -29,7 +29,6 @@ import commands
 import commands
 import libvirt
 import Guest
-import cli
 from virtinst import _virtinst as _
 
 #
@@ -334,39 +333,8 @@ class CloneDesign(object):
     # ret : Use File Path
     #
     def _check_file(self, conn, disk, size):
-        retryFlg = False
-        while 1:
-            if disk == None:
-                msg = _("What would you like to use as the disk (path)?")
-                disk = cli.prompt_for_input(msg, disk)
-
-            try:
-                d = Guest.VirtualDisk(disk, size)
-                if d.is_conflict_disk(conn) is True:
-                    while 1:
-                        retryFlg = False
-                        warnmsg = _("Disk %s is already in use by another guest!\n") % disk
-                        res = cli.prompt_for_input(warnmsg + _("Do you really want to use the disk (yes or no)? "))
-                        try:
-                            if cli.yes_or_no(res) is True:
-                                break
-                            else:
-                                retryFlg = True
-                                break
-                        except ValueError, e:
-                            print _("ERROR: "), e
-                            continue
-                    if retryFlg is True:
-                        disk = None
-                        continue
-            except ValueError, e:
-                print _("ERROR: "), e
-                disk = None
-                continue
-
-            break
-
-        return disk
+        d = Guest.VirtualDisk(disk, size)
+        return d.path
 
     #
     # check used mac func
# HG changeset patch
# User Mark McLoughlin <markmc at redhat.com>
# Date 1203068244 0
# Node ID fd6a7fa855d11ca890f3c60f669c1830b9874f25
# Parent  07091304b75962460fd01c419a358e1a30fecb65
Fix virt-install disks typo

Fixes this traceback:

    Traceback (most recent call last):
      File "./virt-install", line 498, in <module>
        main()
      File "./virt-install", line 462, in main
        dom = guest.start_install(conscb,progresscb)
      File "/home/markmc/projects/virt/virtinst--devel/virtinst/Guest.py", line 813, in start_install
        return self._do_install(consolecb, meter)
      File "/home/markmc/projects/virt/virtinst--devel/virtinst/Guest.py", line 829, in _do_install
        self._create_devices(meter)
      File "/home/markmc/projects/virt/virtinst--devel/virtinst/Guest.py", line 725, in _create_devices
        disk.setup(progresscb)
    AttributeError: 'str' object has no attribute 'setup'

Looks to have been introduced by cset 351:07091304b759

Signed-off-by: Mark McLoughlin <markmc at redhat.com>

diff -r 07091304b759 -r fd6a7fa855d1 virt-install
--- a/virt-install	Thu Feb 14 12:47:16 2008 -0500
+++ b/virt-install	Fri Feb 15 09:37:24 2008 +0000
@@ -91,7 +91,7 @@ def get_disk(disk, size, sparse, guest, 
                 disk = None
                 continue
 
-        guest.disks.append(disk)
+        guest.disks.append(d)
         break
 
 def get_disks(disk, size, sparse, nodisks, guest, hvm, conn):
# HG changeset patch
# User "Cole Robinson <crobinso at redhat.com>"
# Date 1204823953 18000
# Node ID 507a70e9ed103090ae773adecd11adb672fb65b5
# Parent  f162e1a34ed1cb2ecf3487a01b624c61c06aa0f8
Add --force option to all cmdline utilities.

Option forces a yes answer where applicable, bails out on any prompt that requires non boolean input.

diff -r f162e1a34ed1 -r 507a70e9ed10 virt-clone
--- a/virt-clone	Thu Mar 06 10:16:36 2008 -0500
+++ b/virt-clone	Thu Mar 06 12:19:13 2008 -0500
@@ -164,6 +164,9 @@ def parse_args():
     # Misc options
     parser.add_option("-d", "--debug", action="store_true", dest="debug",
                       help=_("Print debugging information"))
+    parser.add_option("", "--force", action="store_true", dest="force",
+                      help=_("Do not prompt for input. Answers yes where applicable, terminates for all other prompts"),
+                      default=False)
 
     (options,args) = parser.parse_args()
     return options
@@ -173,6 +176,7 @@ def main():
     options = parse_args()
 
     cli.setupLogging("virt-clone", options.debug)
+    cli.set_force(options.force)
 
     logging.debug("start clone with HV " + options.connect)
 
diff -r f162e1a34ed1 -r 507a70e9ed10 virt-image
--- a/virt-image	Thu Mar 06 10:16:36 2008 -0500
+++ b/virt-image	Thu Mar 06 12:19:13 2008 -0500
@@ -139,6 +139,9 @@ def parse_args():
                       help=_("Print the libvirt XML, but do not start the domain"))
     parser.add_option("", "--boot", type="int", dest="boot",
                       help=_("The zero-based index of the boot record to use"))
+    parser.add_option("", "--force", action="store_true", dest="force",
+                      help=_("Do not prompt for input. Answers yes where applicable, terminates for all other prompts"),
+                      default=False)
 
     (options,args) = parser.parse_args()
     if len(args) < 1:
@@ -162,6 +165,7 @@ def main():
     options = parse_args()
 
     cli.setupLogging("virt-image", options.debug)
+    cli.set_force(options.force)
 
     conn = cli.getConnection(options.connect)
     type = None
diff -r f162e1a34ed1 -r 507a70e9ed10 virt-install
--- a/virt-install	Thu Mar 06 10:16:36 2008 -0500
+++ b/virt-install	Thu Mar 06 12:19:13 2008 -0500
@@ -273,6 +273,9 @@ def parse_args():
                       help=_("Print debugging information"))
     parser.add_option("", "--noreboot", action="store_true", dest="noreboot",
                       help=_("Disables the automatic rebooting when the installation is complete."))
+    parser.add_option("", "--force", action="store_true", dest="force",
+                      help=_("Do not prompt for input. Answers yes where applicable, terminates for all other prompts"),
+                      default=False)
 
 
     (options,args) = parser.parse_args()
@@ -338,6 +341,7 @@ def main():
     options = parse_args()
 
     cli.setupLogging("virt-install", options.debug)
+    cli.set_force(options.force)
     conn = cli.getConnection(options.connect)
     capabilities = virtinst.CapabilitiesParser.parse(conn.getCapabilities())
 
diff -r f162e1a34ed1 -r 507a70e9ed10 virtinst/cli.py
--- a/virtinst/cli.py	Thu Mar 06 10:16:36 2008 -0500
+++ b/virtinst/cli.py	Thu Mar 06 12:19:13 2008 -0500
@@ -29,6 +29,7 @@ import Guest
 import Guest
 
 MIN_RAM = 256
+force = False
 
 #
 # Setup helpers
@@ -94,9 +95,15 @@ def getConnection(connect):
 # Prompting
 #
 
+def set_force(val=True):
+    global force
+    force = val
+
 def prompt_for_input(prompt = "", val = None):
     if val is not None:
         return val
+    if force:
+        raise RuntimeError(_("Force flag is set but input was required. Prompt was: %s" % prompt))
     print prompt + " ",
     return sys.stdin.readline().strip()
 
@@ -110,6 +117,10 @@ def yes_or_no(s):
 
 def prompt_for_yes_or_no(prompt):
     """catches yes_or_no errors and ensures a valid bool return"""
+    if force:
+        logging.debug("Forcing return value of True to prompt '%s'")
+        return True
+
     while 1:
         input = prompt_for_input(prompt, None)
         try:

virtinst-0.300.2-install-f9.patch:

--- NEW FILE virtinst-0.300.2-install-f9.patch ---
diff -rup virtinst-0.300.2.old/virtinst/OSDistro.py virtinst-0.300.2/virtinst/OSDistro.py
--- virtinst-0.300.2.old/virtinst/OSDistro.py	2008-03-17 09:48:58.000000000 -0400
+++ virtinst-0.300.2/virtinst/OSDistro.py	2008-03-17 09:49:21.000000000 -0400
@@ -80,6 +80,9 @@ class RedHatDistro(Distro):
 # Fedora distro check
 class FedoraDistro(RedHatDistro):
     def isValidStore(self, fetcher, progresscb):
+        if fetcher.hasFile(".treeinfo", progresscb):
+            logging.debug("Detected a Fedora distro")
+            return True
         if fetcher.hasFile("fedora.css", progresscb):
             logging.debug("Detected a Fedora distro")
             return True

virtinst-0.300.2-noreboot.patch:

--- NEW FILE virtinst-0.300.2-noreboot.patch ---
diff -rup virtinst-0.300.2/virt-install virtinst-0.300.2.new/virt-install
--- virtinst-0.300.2/virt-install	2008-01-07 09:46:01.000000000 -0500
+++ virtinst-0.300.2.new/virt-install	2008-02-19 12:23:55.000000000 -0500
@@ -296,6 +296,8 @@ def parse_args():
     # Misc options
     parser.add_option("-d", "--debug", action="store_true", dest="debug", 
                       help=_("Print debugging information"))
+    parser.add_option("", "--noreboot", action="store_true", dest="noreboot",
+                      help=_("Disables the automatic rebooting when the installation is complete."))
 
 
     (options,args) = parser.parse_args()
@@ -499,9 +501,13 @@ def main():
                     print _("Domain installation does not appear to have been\n successful.  If it was, you can restart your domain\n by running 'virsh start %s'; otherwise, please\n restart your installation.") %(guest.name,)
                     sys.exit(0)
 
-        print _("Guest installation complete... restarting guest.")
-        dom.create()
-        guest.connect_console(conscb)
+        if options.noreboot:
+            print _("Guest installation complete... you can restart your domain\n"
+                    "by running 'virsh start %s'") %(guest.name,)
+        else:
+            print _("Guest installation complete... restarting guest.")
+            dom.create()
+            guest.connect_console(conscb)
     except RuntimeError, e:
         print >> sys.stderr, _("ERROR: "), e
         sys.exit(1)

virtinst-0.300.2-remove-file-exist-check.patch:

--- NEW FILE virtinst-0.300.2-remove-file-exist-check.patch ---
# HG changeset patch
# User "Daniel P. Berrange <berrange at redhat.com>"
# Date 1204082966 18000
# Node ID 52f657ebcb4d73d2cc6d3e2777c0acd7b49fc1bf
# Parent  96a8994ff871ab67c1cdb551f915b35de45240d9
Remove check for local file existance since it doesn't work remotely & is causing needless interactive prompts

diff -r 96a8994ff871 -r 52f657ebcb4d virt-clone
--- a/virt-clone	Tue Feb 26 20:41:05 2008 -0500
+++ b/virt-clone	Tue Feb 26 22:29:26 2008 -0500
@@ -92,12 +92,6 @@ def get_clone_diskfile(new_diskfiles, de
             if d.is_conflict_disk(conn) is True:
                 warnmsg = _("Disk %s is already in use by another guest!\n") % d.path
                 if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the disk (yes or no)? ")):
-                    disk = None
-                    continue
-            # Overwrite disk?
-            elif os.path.exists(d.path) and os.path.isfile(d.path):
-                warnmsg = _("You are going to overwrite file '%s'!\n") % d.path
-                if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the file (yes or no)? ")):
                     disk = None
                     continue
             new_diskfiles[i] = d.path
diff -r 96a8994ff871 -r 52f657ebcb4d virt-install
--- a/virt-install	Tue Feb 26 20:41:05 2008 -0500
+++ b/virt-install	Tue Feb 26 22:29:26 2008 -0500
@@ -84,12 +84,6 @@ def get_disk(disk, size, sparse, guest, 
                          % d.path
             if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the disk (yes or no)? ")):
                 disk = size = None
-                continue
-        # Overwrite disk?
-        elif os.path.exists(d.path) and os.path.isfile(d.path):
-            warnmsg = _("You are going to overwrite file '%s'!\n") % d.path
-            if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the file (yes or no)? ")):
-                disk = None
                 continue
 
         guest.disks.append(d)

virtinst-0.300.2-satellite-distro-fix.patch:

--- NEW FILE virtinst-0.300.2-satellite-distro-fix.patch ---
diff -rup virtinst-0.300.2.orig/virtinst/DistroManager.py virtinst-0.300.2/virtinst/DistroManager.py
--- virtinst-0.300.2.orig/virtinst/DistroManager.py	2008-02-21 11:33:41.000000000 -0500
+++ virtinst-0.300.2/virtinst/DistroManager.py	2008-02-21 11:34:49.000000000 -0500
@@ -57,22 +57,22 @@ def _fetcherForURI(uri, scratchdir=None)
 # Used as a workaround for Satellite issue 
 def _checkRHDistro(fetcher, baseuri, type, progresscb, distro=None, scratchdir=None):
     # Check for fedora distro
-    store = FedoraImageStore(baseuri, type, scratchdir)
+    store = FedoraDistro(baseuri, type, scratchdir)
     if store.isValidStore(fetcher, progresscb):
         return store
     # Check for CentOS?
     if fetcher.hasFile("centosdocs-man.css", progresscb):
         logging.debug("Detected a CentOS distro")
-        return CentOSImageStore(baseuri, type, scratchdir)
+        return CentOSDistro(baseuri, type, scratchdir)
     # Check for RHEL-5
     if fetcher.hasFile("RPM-GPG-KEY-redhat-release", progresscb):
         logging.debug("Detected a RHEL-5 distro")
-        return RHELImageStore(baseuri, type, scratchdir)
+        return RHELDistro(baseuri, type, scratchdir)
     # Check for RHEL-4
     if fetcher.hasFile("autorun", progresscb) and \
        fetcher.hasFile("RPM-GPG-KEY", progresscb):
         logging.debug("Detected a RHEL-4 distro")
-        return RHELImageStore(baseuri, type, scratchdir)
+        return RHELDistro(baseuri, type, scratchdir)
     return False
 
 def _storeForDistro(fetcher, baseuri, type, progresscb, distro=None, scratchdir=None):

virtinst-0.300.2-satellite-distro.patch:

--- NEW FILE virtinst-0.300.2-satellite-distro.patch ---
diff -rup virtinst-0.300.2.orig/virtinst/DistroManager.py virtinst-0.300.2.new/virtinst/DistroManager.py
--- virtinst-0.300.2.orig/virtinst/DistroManager.py	2008-01-10 20:33:34.000000000 -0500
+++ virtinst-0.300.2.new/virtinst/DistroManager.py	2008-01-15 16:14:59.000000000 -0500
@@ -54,6 +54,27 @@ def _fetcherForURI(uri, scratchdir=None)
         else:
             return MountedImageFetcher(uri, scratchdir)
 
+# Used as a workaround for Satellite issue 
+def _checkRHDistro(fetcher, baseuri, type, progresscb, distro=None, scratchdir=None):
+    # Check for fedora distro
+    store = FedoraImageStore(baseuri, type, scratchdir)
+    if store.isValidStore(fetcher, progresscb):
+        return store
+    # Check for CentOS?
+    if fetcher.hasFile("centosdocs-man.css", progresscb):
+        logging.debug("Detected a CentOS distro")
+        return CentOSImageStore(baseuri, type, scratchdir)
+    # Check for RHEL-5
+    if fetcher.hasFile("RPM-GPG-KEY-redhat-release", progresscb):
+        logging.debug("Detected a RHEL-5 distro")
+        return RHELImageStore(baseuri, type, scratchdir)
+    # Check for RHEL-4
+    if fetcher.hasFile("autorun", progresscb) and \
+       fetcher.hasFile("RPM-GPG-KEY", progresscb):
+        logging.debug("Detected a RHEL-4 distro")
+        return RHELImageStore(baseuri, type, scratchdir)
+    return False
+
 def _storeForDistro(fetcher, baseuri, type, progresscb, distro=None, scratchdir=None):
     stores = []
     if distro == "fedora" or distro is None:
@@ -84,14 +105,21 @@ def _storeForDistro(fetcher, baseuri, ty
 def acquireKernel(baseuri, progresscb, scratchdir="/var/tmp", type=None, distro=None):
     fetcher = _fetcherForURI(baseuri, scratchdir)
     
+    store = None
     try:
         fetcher.prepareLocation(progresscb)
     except ValueError, e:
-        raise ValueError, _("Invalid install location: ") + str(e)
+        logging.debug("Tree URL could not be opened. Checking ahead for valid RH distro.")
+        store = _checkRHDistro(fetcher=fetcher, baseuri=baseuri, type=type,
+                               progresscb=progresscb, distro=distro,
+                               scratchdir=scratchdir)
+        if not store:
+            raise ValueError, _("Invalid install location: ") + str(e)
 
     try:
-        store = _storeForDistro(fetcher=fetcher, baseuri=baseuri, type=type, \
-                                progresscb=progresscb, distro=distro, scratchdir=scratchdir)
+        if store is None:
+            store = _storeForDistro(fetcher=fetcher, baseuri=baseuri, type=type, \
+                                        progresscb=progresscb, distro=distro, scratchdir=scratchdir)
         return store.acquireKernel(fetcher, progresscb)
     finally:
         fetcher.cleanupLocation()
@@ -100,14 +128,21 @@ def acquireKernel(baseuri, progresscb, s
 def acquireBootDisk(baseuri, progresscb, scratchdir="/var/tmp", type=None, distro=None):
     fetcher = _fetcherForURI(baseuri, scratchdir)
 
+    store = None
     try:
         fetcher.prepareLocation(progresscb)
     except ValueError, e:
-        raise ValueError, _("Invalid install location: ") + str(e)
+        logging.debug("Tree URL could not be opened. Checking ahead for valid RH distro.")
+        store = _checkRHDistro(fetcher=fetcher, baseuri=baseuri, type=type,
+                               progresscb=progresscb, distro=distro,
+                               scratchdir=scratchdir)
+        if not store:
+            raise ValueError, _("Invalid install location: ") + str(e)
 
     try:
-        store = _storeForDistro(fetcher=fetcher, baseuri=baseuri, type=type, \
-                                progresscb=progresscb, distro=distro, scratchdir=scratchdir)
+        if store is None:
+            store = _storeForDistro(fetcher=fetcher, baseuri=baseuri, type=type, \
+                                        progresscb=progresscb, distro=distro, scratchdir=scratchdir)
         return store.acquireBootDisk(fetcher, progresscb)
     finally:
         fetcher.cleanupLocation()

virtinst-0.300.2-virt-clone-disk.patch:

--- NEW FILE virtinst-0.300.2-virt-clone-disk.patch ---
# HG changeset patch
# User "Cole Robinson <crobinso at redhat.com>"
# Date 1201726148 18000
# Node ID 611782118e768bf63ee2af3b7a8e0602d65b3ce5
# Parent  da82ae52bc47c8308bca134cc860c4f756fe7267
virt-clone: fix specifying non-existent disk on the command line. rhbz 430757

diff -r da82ae52bc47 -r 611782118e76 virtinst/CloneManager.py
--- a/virtinst/CloneManager.py	Wed Jan 30 12:13:53 2008 -0500
+++ b/virtinst/CloneManager.py	Wed Jan 30 15:49:08 2008 -0500
@@ -113,7 +113,7 @@ class CloneDesign(object):
         cdev.append(devices)
         cdev_size,\
         cdev_type = self._get_clone_devices_info(cdev)
-        devices = self._check_file(self._hyper_conn, devices, cdev_size)
+        devices = self._check_file(self._hyper_conn, devices, cdev_size[0])
         self._clone_devices.append(devices)
     def get_clone_devices(self):
         return self._clone_devices


Index: python-virtinst.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-virtinst/F-8/python-virtinst.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- python-virtinst.spec	31 Jan 2008 17:05:36 -0000	1.35
+++ python-virtinst.spec	19 Mar 2008 19:01:39 -0000	1.36
@@ -11,8 +11,18 @@
 Summary: Python modules for starting Xen guest installations
 Name: python-%{appname}
 Version: 0.300.2
-Release: 3%{_extra_release}
+Release: 4%{_extra_release}
 Source0: http://virt-manager.org/download/sources/%{appname}/%{appname}-%{version}.tar.gz
+
+Patch1: %{appname}-%{version}-satellite-distro.patch
+Patch2: %{appname}-%{version}-virt-clone-disk.patch
+Patch3: %{appname}-%{version}-acpi.patch
+Patch4: %{appname}-%{version}-noreboot.patch
+Patch5: %{appname}-%{version}-satellite-distro-fix.patch
+Patch6: %{appname}-%{version}-force-option.patch
+Patch7: %{appname}-%{version}-remove-file-exist-check.patch
+Patch8: %{appname}-%{version}-install-f9.patch
+
 License: GPLv2+
 Group: Development/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -42,6 +52,14 @@
 
 %prep
 %setup -q -n %{appname}-%{version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 
 %build
 python setup.py build
@@ -71,6 +89,15 @@
 %{_bindir}/virt-image
 
 %changelog
+* Wed Mar 19 2008 Daniel P. Berrange <berrange at redhat.com> - 0.300.2-4.fc8
+- Fix file check to allow installing rawhide/f9 guests
+- Add --force option to cli utils to not prompt for input.
+- Remove check for file existence in cli utils, breaks scripts.
+- Bring satellite distro patch up to speed with current internal API
+- Add --noreboot option accidentally lost
+- Fix ACPI default value to be enabled
+- Fix virt-clone disk validation from breaking all use of the tool.
+
 * Thu Jan 31 2008 Daniel P. Berrange <berrange at redhat.com> - 0.300.2-3.fc8
 - Disable virt-viewer dep to allow non-X installs (rhbz #387971)
 




More information about the fedora-extras-commits mailing list