client/tools/rhn-virtualization/rhn-virtualization.spec | 5 ++++- client/tools/rhn-virtualization/virtualization/domain_control.py | 2 +- client/tools/rhn-virtualization/virtualization/poller.py | 4 ++-- client/tools/rhn-virtualization/virtualization/support.py | 4 ++-- rel-eng/packages/rhn-virtualization | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-)
New commits: commit 4c035e6b60993d4589643ad41b7146dee7b2390d Author: Milan Zazrivec mzazrivec@redhat.com Date: Wed Oct 26 17:56:11 2011 +0200
Automatic commit of package [rhn-virtualization] release [5.4.28-1].
diff --git a/client/tools/rhn-virtualization/rhn-virtualization.spec b/client/tools/rhn-virtualization/rhn-virtualization.spec index 8dfb9c5..2aebabd 100644 --- a/client/tools/rhn-virtualization/rhn-virtualization.spec +++ b/client/tools/rhn-virtualization/rhn-virtualization.spec @@ -10,7 +10,7 @@ License: GPLv2 URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t...
-Version: 5.4.27 +Version: 5.4.28 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -134,6 +134,9 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE
%changelog +* Wed Oct 26 2011 Milan Zazrivec mzazrivec@redhat.com 5.4.28-1 +- 742811 - don't open RW connection to libvirt unless necessary + * Wed Oct 26 2011 Milan Zazrivec mzazrivec@redhat.com 5.4.27-1 - 742811 - RHEV: handle no-guests situation correctly
diff --git a/rel-eng/packages/rhn-virtualization b/rel-eng/packages/rhn-virtualization index d3ff2bb..0905e4c 100644 --- a/rel-eng/packages/rhn-virtualization +++ b/rel-eng/packages/rhn-virtualization @@ -1 +1 @@ -5.4.27-1 client/tools/rhn-virtualization/ +5.4.28-1 client/tools/rhn-virtualization/
commit ef1a8f4565d0460c3d58cd268ee989585571ae8a Author: Milan Zazrivec mzazrivec@redhat.com Date: Wed Oct 26 17:55:02 2011 +0200
742811 - don't open RW connection to libvirt unless necessary
diff --git a/client/tools/rhn-virtualization/virtualization/domain_control.py b/client/tools/rhn-virtualization/virtualization/domain_control.py index 535ec22..f9103d8 100755 --- a/client/tools/rhn-virtualization/virtualization/domain_control.py +++ b/client/tools/rhn-virtualization/virtualization/domain_control.py @@ -110,7 +110,7 @@ def _get_domain(uuid): """ Lookup the domain by its UUID. If not found, raise an exception. """ - conn = libvirt.open(None) + conn = libvirt.openReadOnly(None) domain = None hyphenized_uuid = hyphenize_uuid(uuid) try: diff --git a/client/tools/rhn-virtualization/virtualization/poller.py b/client/tools/rhn-virtualization/virtualization/poller.py index 9a7eea5..f94e122 100644 --- a/client/tools/rhn-virtualization/virtualization/poller.py +++ b/client/tools/rhn-virtualization/virtualization/poller.py @@ -72,7 +72,7 @@ def poll_hypervisor(): return {}
try: - conn = libvirt.open(None) + conn = libvirt.openReadOnly(None) except libvirt.libvirtError, lve: # virConnectOpen() failed sys.stderr.write(_("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n")) @@ -193,7 +193,7 @@ def poll_state(uuid): Polls just the state of the guest with the provided UUID. This state is returned. """ - conn = libvirt.open(None) + conn = libvirt.openReadOnly(None) if not conn: raise VirtualizationException, \ "Failed to open connection to hypervisor." diff --git a/client/tools/rhn-virtualization/virtualization/support.py b/client/tools/rhn-virtualization/virtualization/support.py index 160693c..547ca72 100755 --- a/client/tools/rhn-virtualization/virtualization/support.py +++ b/client/tools/rhn-virtualization/virtualization/support.py @@ -82,7 +82,7 @@ def refresh(): else: domains = poller.poll_hypervisor()
- if not len(domains) and libvirt.open(None).getType() == 'Xen': + if not len(domains) and libvirt.openReadOnly(None).getType() == 'Xen': # On a KVM/QEMU host, libvirt reports no domain entry for host itself # On a Xen host, either there were no domains or xend might not be # running. Don't proceed further. @@ -184,7 +184,7 @@ def _is_host_domain(): # No libvirt, dont bother with the rest return False try: - conn = libvirt.open(None) + conn = libvirt.openReadOnly(None) except libvirt.libvirtError: # libvirtd is not running sys.stderr.write(_("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n")) return False
spacewalk-commits@lists.fedorahosted.org