diff --git a/.cvsignore b/.cvsignore index 1bb9d1b..5cb39f6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -virtinst-0.103.0.tar.gz +virtinst-0.200.0.tar.gz diff --git a/python-virtinst.spec b/python-virtinst.spec index 0c44942..1aa69d7 100644 --- a/python-virtinst.spec +++ b/python-virtinst.spec @@ -1,15 +1,18 @@ %{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +# This macro is used for the continuous automated builds. It just +# allows an extra fragment based on the timestamp to be appended +# to the release. This distinguishes automated builds, from formal +# Fedora RPM builds +%define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}} + +%define appname virtinst + Summary: Python modules for starting Xen guest installations -Name: python-virtinst -Version: 0.103.0 -Release: 3%{?dist} -Source0: virtinst-%{version}.tar.gz -Patch0: virtinst-0.103.0-urlgrabber-import.patch -Patch1: virtinst-0.103.0-accelerate.patch -Patch2: virtinst-0.103.0-default-net.patch -Patch3: virtinst-0.103.0-rhel5-client.patch -Patch4: virtinst-0.103.0-features-xml.patch +Name: python-%{appname} +Version: 0.200.0 +Release: 1%{_extra_release} +Source0: http://virt-manager.et.redhat.com/download/sources/%{appname}/%{appname}-%{version}.tar.gz License: GPL Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -33,13 +36,7 @@ Also contained is a simple script virt-install which uses virtinst in a command line mode. %prep -%setup -q -n virtinst-%{version} - -%patch0 -p1 -b .urlgrabber-import -%patch1 -p1 -b .accelerate -%patch2 -p1 -b .defaultnet -%patch3 -p1 -b .rhel5client -%patch4 -p1 -b .features +%setup -q -n %{appname}-%{version} %build python setup.py build @@ -47,20 +44,32 @@ python setup.py build %install rm -rf $RPM_BUILD_ROOT python setup.py install -O1 --root=$RPM_BUILD_ROOT +# Back compat in case people hardcoded old /usr/sbin/virt-install location mkdir -p $RPM_BUILD_ROOT/%{_sbindir} -mv $RPM_BUILD_ROOT/%{_bindir}/virt-install $RPM_BUILD_ROOT/%{_sbindir}/virt-install +ln -s %{_bindir}/virt-install $RPM_BUILD_ROOT/%{_sbindir}/virt-install + +%find_lang %{appname} || echo 0 %clean rm -rf $RPM_BUILD_ROOT -%files +%files -f %{appname}.lang %defattr(-,root,root) %doc README AUTHORS NEWS ChangeLog -%dir %{python_sitelib}/virtinst -%{python_sitelib}/virtinst/* +%dir %{python_sitelib}/%{appname} +%{python_sitelib}/%{appname}/* +%{_mandir}/man1/virt-install.1* +%{_mandir}/man1/virt-clone.1* %{_sbindir}/virt-install +%{_bindir}/virt-install +%{_bindir}/virt-clone %changelog +* Tue Jul 18 2007 Daniel P. Berrange - 0.200.0-1.fc8 +- Updated to 0.200.0 +- Added virt-clone tool +- Added manual pages + * Tue May 1 2007 Daniel P. Berrange - 0.103.0-3.fc7 - Fixed module import when using --accelerate - Fixed detection of RHEL5 client distro diff --git a/sources b/sources index 757c512..a42696c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -da72ef584f2479be981716af454950f6 virtinst-0.103.0.tar.gz +b5a71282a5e0cb382749e6c1196715b5 virtinst-0.200.0.tar.gz diff --git a/virtinst-0.103.0-accelerate.patch b/virtinst-0.103.0-accelerate.patch deleted file mode 100644 index 9dbe58b..0000000 --- a/virtinst-0.103.0-accelerate.patch +++ /dev/null @@ -1,30 +0,0 @@ -changeset: 161:00984cdd0c55 -user: Mark McLoughlin -date: Mon Apr 30 11:43:24 2007 -0400 -files: virt-install -description: -[et-mgmt-tools] [patch 1/4] Typo in kvm support -Patch from David Lutterkort - -Fixes a minor type in kvm support where we reference a -non-existent module. - -Signed-off-by: Mark McLoughlin - - -diff -r 71f2046b9805 -r 00984cdd0c55 virt-install ---- a/virt-install Wed Apr 25 15:56:03 2007 -0400 -+++ b/virt-install Mon Apr 30 11:43:24 2007 -0400 -@@ -519,9 +519,9 @@ def main(): - hvm = True - type = "qemu" - if options.accelerate: -- if util.is_kvm_capable(): -+ if virtinst.util.is_kvm_capable(): - type = "kvm" -- elif util.is_kqemu_capable(): -+ elif virtinst.util.is_kqemu_capable(): - type = "kqemu" - - if hvm: - diff --git a/virtinst-0.103.0-default-net.patch b/virtinst-0.103.0-default-net.patch deleted file mode 100644 index 4f74af5..0000000 --- a/virtinst-0.103.0-default-net.patch +++ /dev/null @@ -1,137 +0,0 @@ -changeset: 165:5b37d71c88b6 -user: "Daniel P. Berrange " -date: Tue May 01 11:31:32 2007 -0400 -summary: Automatically pick sensible default networking if no arg is listed, rather than defaulting to xenbr0. Pick sensible connect URI based on host OS - -diff -r cdbbe109cf8d -r 5b37d71c88b6 virt-install ---- a/virt-install Mon Apr 30 11:44:00 2007 -0400 -+++ b/virt-install Tue May 01 11:31:32 2007 -0400 -@@ -42,11 +42,6 @@ def prompt_for_input(prompt = "", val = - print prompt + " ", - return sys.stdin.readline().strip() - -- --def check_xen(): -- if not os.path.isdir("/proc/xen"): -- print >> sys.stderr, "Can only install guests if running under a Xen kernel!" -- sys.exit(1) - - ### General input gathering functions - def get_full_virt(): -@@ -216,7 +211,8 @@ def get_networks(macs, bridges, networks - macs = [ None ] * len(networks) - else: - if os.getuid() == 0: -- networks = ["bridge:" + virtinst.util.default_bridge()] -+ net = virtinst.util.default_network() -+ networks = [net[0] + ":" + net[1]] - else: - networks = ["user"] - if macs != None: -@@ -274,9 +270,12 @@ def get_paravirt_extraargs(extra, guest) - - - ### fullvirt input gathering functions --def get_fullvirt_cdrom(cdpath, guest): -- while 1: -- cdpath = prompt_for_input("What would you like to use for the virtual CD image?", cdpath) -+def get_fullvirt_cdrom(cdpath, location, guest): -+ if cdpath is None and location is not None: -+ cdpath = location -+ -+ while 1: -+ cdpath = prompt_for_input("What is the virtual CD image, CD device or install location?", cdpath) - try: - guest.location = cdpath - break -@@ -353,7 +352,8 @@ def parse_args(): - help="Use kernel acceleration capabilities") - parser.add_option("", "--connect", type="string", dest="connect", - action="callback", callback=check_before_store, -- help="Connect to hypervisor with URI") -+ help="Connect to hypervisor with URI", -+ default=virtinst.util.default_connection()) - - # fullvirt options - parser.add_option("-v", "--hvm", action="store_true", dest="fullvirt", -@@ -484,7 +484,6 @@ def main(): - # check to ensure we're really on a xen kernel - if conn.getType() == "Xen": - type = "xen" -- check_xen() - - if os.geteuid() != 0: - print >> sys.stderr, "Must be root to install guests" -@@ -544,7 +543,7 @@ def main(): - get_paravirt_extraargs(options.extra, guest) - continue_inst = False - else: -- get_fullvirt_cdrom(options.cdrom, guest) -+ get_fullvirt_cdrom(options.cdrom, options.location, guest) - if options.noacpi: - guest.features["acpi"] = False - if options.noapic: -diff -r cdbbe109cf8d -r 5b37d71c88b6 virtinst/util.py ---- a/virtinst/util.py Mon Apr 30 11:44:00 2007 -0400 -+++ b/virtinst/util.py Tue May 01 11:31:32 2007 -0400 -@@ -16,7 +16,7 @@ import os.path - import os.path - from sys import stderr - --def default_bridge(): -+def default_route(): - route_file = "/proc/net/route" - d = file(route_file) - -@@ -30,12 +30,47 @@ def default_bridge(): - try: - route = int(info[1],16) - if route == 0: -- defn = int(info[0][-1]) -- break -+ return info[0] - except ValueError: - continue -+ return None - -- return "xenbr%d"%(defn) -+# Legacy for compat only. -+def default_bridge(): -+ rt = default_route() -+ defn = int(rt[-1]) -+ -+ if defn is None: -+ return "xenbr0" -+ else: -+ return "xenbr%d"%(defn) -+ -+def default_network(): -+ dev = default_route() -+ -+ if dev is not None: -+ # New style peth0 == phys dev, eth0 == bridge, eth0 == default route -+ if os.path.exists("/sys/class/net/%s/bridge" % dev): -+ return ["bridge", dev] -+ -+ # Old style, peth0 == phys dev, eth0 == netloop, xenbr0 == bridge, -+ # vif0.0 == netloop enslaved, eth0 == default route -+ defn = int(dev[-1]) -+ if os.path.exists("/sys/class/net/peth%d/brport" % defn) and \ -+ os.path.exists("/sys/class/net/xenbr%d/bridge" % defn): -+ return ["bridge", "xenbr%d" % defn] -+ -+ return ["network", "default"] -+ -+def default_connection(): -+ if os.path.exists("/var/lib/xend") and os.path.exists("/proc/xen"): -+ return "xen" -+ elif os.path.exists("/usr/bin/qemu"): -+ if os.getuid() == 0: -+ return "qemu:///system" -+ else: -+ return "qemu:///session" -+ return None - - def get_cpu_flags(): - f = open("/proc/cpuinfo") - diff --git a/virtinst-0.103.0-features-xml.patch b/virtinst-0.103.0-features-xml.patch deleted file mode 100644 index 68acad7..0000000 --- a/virtinst-0.103.0-features-xml.patch +++ /dev/null @@ -1,32 +0,0 @@ -changeset: 162:ba44389ce195 -user: Mark McLoughlin -date: Mon Apr 30 11:43:35 2007 -0400 -files: virtinst/FullVirtGuest.py -description: -[et-mgmt-tools] [patch 2/4] Fix typo in hvm kernel/initrd XML -Fixes a minor typo in the libvirt XML we output when booting -qemu with a kernel/initrd - the block should be -outside the block. - -Signed-off-by: Mark McLoughlin - - -diff -r 00984cdd0c55 -r ba44389ce195 virtinst/FullVirtGuest.py ---- a/virtinst/FullVirtGuest.py Mon Apr 30 11:43:24 2007 -0400 -+++ b/virtinst/FullVirtGuest.py Mon Apr 30 11:43:35 2007 -0400 -@@ -185,10 +185,10 @@ class FullVirtGuest(Guest.XenGuest): - %(kernel)s - %(initrd)s - %(extra)s -- -- %(features)s -- -- """ % \ -+ -+ -+ %(features)s -+ """ % \ - { "kernel": self.kernel, \ - "initrd": self.initrd, \ - "extra": self.extraargs, \ - diff --git a/virtinst-0.103.0-rhel5-client.patch b/virtinst-0.103.0-rhel5-client.patch deleted file mode 100644 index 9167ed6..0000000 --- a/virtinst-0.103.0-rhel5-client.patch +++ /dev/null @@ -1,22 +0,0 @@ -changeset: 166:42e9479fa521 -tag: tip -user: "Daniel P. Berrange " -date: Tue May 01 11:33:16 2007 -0400 -summary: Added logic to detect RHEL5 client distro flavour - -diff -r 5b37d71c88b6 -r 42e9479fa521 virtinst/DistroManager.py ---- a/virtinst/DistroManager.py Tue May 01 11:31:32 2007 -0400 -+++ b/virtinst/DistroManager.py Tue May 01 11:33:16 2007 -0400 -@@ -214,7 +214,10 @@ class RHELImageStore(RedHatImageStore): - class RHELImageStore(RedHatImageStore): - def isValidStore(self, fetcher, progresscb): - if fetcher.hasFile("Server", progresscb): -- logging.debug("Detected a RHEL 5 distro") -+ logging.debug("Detected a RHEL 5 Server distro") -+ return True -+ if fetcher.hasFile("Client", progresscb): -+ logging.debug("Detected a RHEL 5 Client distro") - return True - if fetcher.hasFile("RedHat", progresscb): - logging.debug("Detected a RHEL 4 distro") - diff --git a/virtinst-0.103.0-urlgrabber-import.patch b/virtinst-0.103.0-urlgrabber-import.patch deleted file mode 100644 index ad4e745..0000000 --- a/virtinst-0.103.0-urlgrabber-import.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- virtinst-0.103.0/virtinst/Guest.py.urlgrabber-import 2007-04-16 08:35:35.000000000 -0400 -+++ virtinst-0.103.0/virtinst/Guest.py 2007-04-17 12:30:41.514314000 -0400 -@@ -23,6 +23,8 @@ - - import logging - -+import urlgrabber.progress as progress -+ - class VirtualDisk: - DRIVER_FILE = "file" - DRIVER_PHY = "phy"