diff --git a/vhostmd.conf b/vhostmd.conf
index d7b73ec..271e821 100644
--- a/vhostmd.conf
+++ b/vhostmd.conf
@@ -37,6 +37,10 @@ within the vm element.
HostName
hostname
+
+ Time
+ date +%s
+
VirtualizationVendor
rpm -qi libvirt| grep Vendor: |awk '{print substr($0, index($0,$5)) }'
@@ -59,7 +63,7 @@ within the vm element.
MemoryAllocatedToVirtualServers
- virsh -r CONNECT nodeinfo | grep 'Memory size:' | gawk -F' +' '{ printf "%d\n" $3/1024 }'
+ virsh -r CONNECT nodeinfo | grep 'Memory size:' | gawk -F' +' '{ printf "%d\n", $3/1024 }'
diff --git a/vhostmd.init b/vhostmd.init
index a64d9f5..ca3c587 100644
--- a/vhostmd.init
+++ b/vhostmd.init
@@ -35,6 +35,9 @@ if [ -n "$VHOSTMD_USER" ]; then
fi
if [ -n "$VHOSTMD_URI" ]; then
ARGS="$ARGS --connect $VHOSTMD_URI"
+elif virsh uri >/dev/null 2>&1; then
+ default_uri=$(virsh uri)
+ ARGS="$ARGS --connect '$default_uri'"
fi
lockfile=/var/lock/subsys/$prog
diff --git a/vhostmd.spec b/vhostmd.spec
index c862823..33583f4 100644
--- a/vhostmd.spec
+++ b/vhostmd.spec
@@ -8,7 +8,7 @@
Summary: Virtualization host metrics daemon
Name: vhostmd
Version: 0.4
-Release: 0.8.gite9db007b%{?dist}
+Release: 0.9.gite9db007b%{?dist}
License: GPLv2+
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -184,6 +184,16 @@ exit 0
%changelog
+* Tue Nov 17 2009 Richard W.M. Jones - 0.4-0.9.gite9db007b
+- Add a timestamp to the metrics.
+- Fix a typo in MemoryAllocatedToVirtualServers metric
+ (https://bugzilla.redhat.com/show_bug.cgi?id=532070#c7)
+- %{_sysconfdir}/sysconfig/vhostmd: Use libvirt default URI
+ (https://bugzilla.redhat.com/show_bug.cgi?id=537828)
+- %{_sysconfdir}/init.d/vhostmd: If using libvirt's default URI, then pass
+ the root URI to vhostmd (the default URI changes in some circumstances
+ when vhostmd switches to the non-root user).
+
* Wed Nov 11 2009 Richard W.M. Jones - 0.4-0.8.gite9db007b
- Use fixed UID:GID 112:112 (RHBZ#534109).
diff --git a/vhostmd.sysconfig b/vhostmd.sysconfig
index 47bbd9a..f3d97c3 100644
--- a/vhostmd.sysconfig
+++ b/vhostmd.sysconfig
@@ -8,4 +8,7 @@
VHOSTMD_USER=vhostmd
# Set the libvirt URI.
-VHOSTMD_URI=qemu:///system
+# Uncomment one of these to force KVM or Xen, otherwise libvirt
+# will try to choose a suitable default.
+#VHOSTMD_URI=qemu:///system
+#VHOSTMD_URI=xen:///