Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 82

libvirt-0.8.2-29.el5.src.rpm

From 19924f047d55ba9ea259bcb6183e578586a17683 Mon Sep 17 00:00:00 2001
Message-Id: <19924f047d55ba9ea259bcb6183e578586a17683.1284409900.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Tue, 27 Jul 2010 14:21:51 +0200
Subject: [PATCH] libvirt-guests: Don't throw errors if libvirtd is not installed

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=630622

When only client parts of libvirt are installed (i.e., no libvirtd
daemon), libvirt-guests init script in its default configuration would
throw seriously looking errors during host shutdown:

Running guests on default URI: error: unable to connect to
'/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No
such file or directory
error: failed to connect to the hypervisor

This patch changes the script to print rather harmless message in that
situation:

Running guests on default URI: libvirtd not installed; skipping this
URI.

(backported from commit d1018b1bdea5048ee7ae6f66bea89853b02e4702 which
conflicted with libvirt-Disable-libvirt-guests-on-xen-host.patch)
---
 daemon/libvirt-guests.init.in |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/daemon/libvirt-guests.init.in b/daemon/libvirt-guests.init.in
index 6f73987..f57b2a4 100644
--- a/daemon/libvirt-guests.init.in
+++ b/daemon/libvirt-guests.init.in
@@ -25,6 +25,7 @@
 
 sysconfdir=@sysconfdir@
 localstatedir=@localstatedir@
+libvirtd=@sbindir@/libvirtd
 
 # Source function library.
 . "$sysconfdir"/rc.d/init.d/functions
@@ -238,6 +239,11 @@ stop() {
             continue
         fi
 
+        if [ "x$uri" = xdefault ] && [ ! -x "$libvirtd" ]; then
+            echo $"libvirtd not installed; skipping this URI."
+            continue
+        fi
+
         list=$(list_guests $uri)
         if [ $? -eq 0 ]; then
             empty=true
-- 
1.7.2.2