diff options
author | Michael Marineau <marineam@gentoo.org> | 2008-12-02 03:38:10 +0000 |
---|---|---|
committer | Michael Marineau <marineam@gentoo.org> | 2008-12-02 03:38:10 +0000 |
commit | 0221874f0ba925700d9a782e4c78d5827a3fe20f (patch) | |
tree | 63784e4344278d34340869b65ed03b32319b5e33 /app-emulation/virt-manager | |
parent | Stable for HPPA too. (diff) | |
download | gentoo-2-0221874f0ba925700d9a782e4c78d5827a3fe20f.tar.gz gentoo-2-0221874f0ba925700d9a782e4c78d5827a3fe20f.tar.bz2 gentoo-2-0221874f0ba925700d9a782e4c78d5827a3fe20f.zip |
Allow user access without policykit
(Portage version: 2.1.4.5)
Diffstat (limited to 'app-emulation/virt-manager')
-rw-r--r-- | app-emulation/virt-manager/ChangeLog | 9 | ||||
-rw-r--r-- | app-emulation/virt-manager/files/virt-manager-0.6.0-read-only-fallback.patch | 77 | ||||
-rw-r--r-- | app-emulation/virt-manager/virt-manager-0.6.0-r1.ebuild (renamed from app-emulation/virt-manager/virt-manager-0.6.0.ebuild) | 8 |
3 files changed, 92 insertions, 2 deletions
diff --git a/app-emulation/virt-manager/ChangeLog b/app-emulation/virt-manager/ChangeLog index 33085a7d09fd..5389d8ca8c99 100644 --- a/app-emulation/virt-manager/ChangeLog +++ b/app-emulation/virt-manager/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-emulation/virt-manager # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/virt-manager/ChangeLog,v 1.9 2008/11/25 05:06:50 marineam Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/virt-manager/ChangeLog,v 1.10 2008/12/02 03:38:10 marineam Exp $ + +*virt-manager-0.6.0-r1 (02 Dec 2008) + + 02 Dec 2008; Michael Marineau <marineam@gentoo.org> + +files/virt-manager-0.6.0-read-only-fallback.patch, + -virt-manager-0.6.0.ebuild, +virt-manager-0.6.0-r1.ebuild: + Add patch to allow user access without policykit. 25 Nov 2008; Michael Marineau <marineam@gentoo.org> virt-manager-0.6.0.ebuild: diff --git a/app-emulation/virt-manager/files/virt-manager-0.6.0-read-only-fallback.patch b/app-emulation/virt-manager/files/virt-manager-0.6.0-read-only-fallback.patch new file mode 100644 index 000000000000..f270810dd27a --- /dev/null +++ b/app-emulation/virt-manager/files/virt-manager-0.6.0-read-only-fallback.patch @@ -0,0 +1,77 @@ +--- virt-manager-0.6.0/src/virtManager/connection.py.orig 2008-09-10 15:37:12.000000000 -0400 ++++ virt-manager-0.6.0/src/virtManager/connection.py 2008-12-01 22:33:34.000000000 -0500 +@@ -38,11 +38,6 @@ + from virtManager.netdev import vmmNetDevice + from virtManager.storagepool import vmmStoragePool + +-LIBVIRT_POLICY_FILES = [ +- "/usr/share/PolicyKit/policy/libvirtd.policy", +- "/usr/share/PolicyKit/policy/org.libvirt.unix.policy" +-] +- + def get_local_hostname(): + try: + (host, aliases, ipaddrs) = gethostbyaddr(gethostname()) +@@ -139,15 +134,6 @@ + self.uri = "xen:///" + + self.readOnly = readOnly +- if not self.is_remote() and os.getuid() != 0 and self.uri != "qemu:///session": +- hasPolkit = False +- for f in LIBVIRT_POLICY_FILES: +- if os.path.exists(f): +- hasPolkit = True +- +- if not hasPolkit: +- self.readOnly = True +- + self.state = self.STATE_DISCONNECTED + self.vmm = None + self.storage_capable = None +@@ -464,8 +450,7 @@ + logging.error(self.connectError) + return -1 + +- def _open_thread(self): +- logging.debug("Background thread is running") ++ def _try_open(self): + try: + flags = 0 + if self.readOnly: +@@ -478,12 +463,34 @@ + libvirt.VIR_CRED_EXTERNAL], + self._do_creds, + None], flags) ++ except: ++ exc_info = sys.exc_info() ++ ++ # If the previous attempt was read/write try to fall back ++ # on read-only connection, otherwise report the error. ++ if not self.readOnly: ++ try: ++ self.vmm = libvirt.openReadOnly(self.uri) ++ self.readOnly = True ++ logging.info("Read/write connection failed to %s," ++ "falling back on read-only." % self.uri) ++ return ++ except: ++ pass ++ ++ return exc_info + ++ def _open_thread(self): ++ logging.debug("Background thread is running") ++ ++ open_error = self._try_open() ++ ++ if not open_error: + self.state = self.STATE_ACTIVE +- except: ++ else: + self.state = self.STATE_DISCONNECTED + +- (type, value, stacktrace) = sys.exc_info () ++ (type, value, stacktrace) = open_error + # Detailed error message, in English so it can be Googled. + self.connectError = \ + ("Unable to open connection to hypervisor URI '%s':\n" % diff --git a/app-emulation/virt-manager/virt-manager-0.6.0.ebuild b/app-emulation/virt-manager/virt-manager-0.6.0-r1.ebuild index 31fc812c388e..a4b22a8a39f3 100644 --- a/app-emulation/virt-manager/virt-manager-0.6.0.ebuild +++ b/app-emulation/virt-manager/virt-manager-0.6.0-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/virt-manager/virt-manager-0.6.0.ebuild,v 1.2 2008/11/25 05:06:50 marineam Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/virt-manager/virt-manager-0.6.0-r1.ebuild,v 1.1 2008/12/02 03:38:10 marineam Exp $ # Stop gnome2.eclass from doing stuff on USE=debug GCONF_DEBUG="no" @@ -46,3 +46,9 @@ pkg_setup() { die "$msg" fi } + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${P}-read-only-fallback.patch" +} |