~ubuntu-branches/ubuntu/precise/virt-manager/precise-proposed

« back to all changes in this revision

Viewing changes to src/virtManager/connection.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-05-18 14:11:16 UTC
  • mfrom: (2.1.24 sid)
  • Revision ID: james.westby@ubuntu.com-20110518141116-3457j7twra3zlpve
Tags: 0.8.7-1ubuntu1
* Merge from debian unstable. Remaining changes: (LP: #747078)
  - debian/control: Depend on python-appindicator for appindicator
    support.
  - Add a /usr/share/pixmaps/virt-manager-icon.svg symlink to link icon to
    where the Application Indicator can find it.
  - debian/patches/more_helpful_error_message.patch: explain to the user
    why he can't connect to qemu:///system and what he can do fix it.
  - debian/control: lower libvirt-bin from Recommends to Suggests; seems
    some users (like netbooks) want to manage VMs, but not host them; see
    meta packages (ubuntu-virt, ubuntu-virt-server, ubuntu-virt-mgmt) for
    group installation of virt package sets.
  - debian/patches/use_ubuntu_package_names.patch: Suggest installing the
    packages that are actually available in Ubuntu.
  - debian/rules: Set qemu user to libvirt-qemu so appropriate
    permissions get set.
  - debian/rules: Set Ubuntu as the preferred distro so we appear first
    in the list.
  - debian/rules: disable TUI for now, since the required dependencies
    are not available (Newt Syrup).
  - debian/rules: Drop patchsys-quilt include since dpkg-source does the
    quilt dance for us.
  - debian/patches/fork_before_using_gconf.patch: fork earlier to resolve
    cpu usage issue and appindicator issue.
  - Removed python-ipy dependency as it is in universe:
    - debian/control: remove python-ipy from Depends
    - debian/series: disable 0002-Use-IPy-from-python-ipy.patch patch so
      we use the one that's included in the virt-manager source.
    - debian/rules: don't delete the IPy file.
* Removed patches:
  - debian/patches/dont-always-launch-consoles.patch: Upstream
  - debian/patches/fix_apparmor_details.patch: Upstream
  - debian/patches/fix-cpu-wrong-types.patch: Upstream
  - debian/patches/no_hal_traceback.patch: Upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
748
748
 
749
749
        return net
750
750
 
 
751
    def rename_vm(self, domainobj, origxml, newxml):
 
752
        # Undefine old domain
 
753
        domainobj.delete()
 
754
        domainobj.release_handle()
 
755
 
 
756
        newobj = None
 
757
        try:
 
758
            try:
 
759
                # Redefine new domain
 
760
                newobj = self.define_domain(newxml)
 
761
            except Exception, renameerr:
 
762
                try:
 
763
                    logging.exception("Error defining new name XML")
 
764
                    newobj = self.define_domain(origxml)
 
765
                except Exception, fixerr:
 
766
                    logging.exception("Failed to redefine original domain!")
 
767
                    raise RuntimeError(
 
768
                        _("Domain rename failed. Attempting to recover also "
 
769
                          "failed.\n\n"
 
770
                          "Original error: %s\n\n"
 
771
                          "Recover error: %s" %
 
772
                          (str(renameerr), str(fixerr))))
 
773
                raise
 
774
        finally:
 
775
            if newobj:
 
776
                # Reinsert handle into new domain
 
777
                domainobj.change_name_backend(newobj)
 
778
 
751
779
    def define_domain(self, xml):
752
 
        self.vmm.defineXML(xml)
 
780
        return self.vmm.defineXML(xml)
753
781
    def define_interface(self, xml):
754
782
        self.vmm.interfaceDefineXML(xml, 0)
755
783
 
833
861
            return
834
862
 
835
863
        self.vmm = None
 
864
        self.nodedevs = {}
 
865
        self.netdevs = {}
 
866
        self.mediadevs = {}
 
867
        self.interfaces = {}
 
868
        self.pools = {}
836
869
        self.nets = {}
837
 
        self.pools = {}
838
870
        self.vms = {}
839
871
        self.activeUUIDs = []
840
872
        self.record = []
 
873
 
841
874
        self._change_state(self.STATE_DISCONNECTED)
842
875
 
843
876
    def _open_dev_conn(self, uri):