[libvirt] [PATCH] Restart libvirtd upon RPM upgrade
by Daniel P. Berrange
* libvirt.spec.in: Restart libvirtd in %post
---
libvirt.spec.in | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0157eee..8d4c8cc 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -471,6 +471,9 @@ fi
%endif
/sbin/chkconfig --add libvirtd
+if [ "$1" -ge "1" ]; then
+ /sbin/service libvirtd condrestart > /dev/null 2>&1
+fi
%endif
%preun
--
1.6.2.5
15 years, 2 months
[libvirt][qemu] unable to start guest under kvm
by Anton Protopopov
Hi, all.
I have the following problem: when I creating a guest, libvirt resolves
<type ... machine="pc" ...>
to
<type ... machine="pc-0.11" ...>
as provided by
http://www.mail-archive.com/libvir-list@redhat.com/msg15014.html
When <type ... machine="pc-0.11" ...> or <type ... machine="pc-0.10" ...> is
set, I get
two following errors (which would happend is unpredictable)
# virsh -c qemu:///system start $d
error: Failed to start domain Desktop
error: internal error unable to start guest: Supported machines are:
pc Standard PC (default)
isapc ISA-only PC
and
# virsh -c qemu:///system start $d
error: Failed to start domain Desktop
error: monitor socket did not show up.: Connection refused
When <type ... machine="pc" ...> is set, this guest starts successfully.
The domain type of this machine is "kvm". But I have
# qemu --version && kvm --help | head -1
QEMU PC emulator version 0.11.50, Copyright (c) 2003-2008 Fabrice Bellard
QEMU PC emulator version 0.10.0 (kvm-devel), Copyright (c) 2003-2008
Fabrice Bellard
on that HN.
- why does libvirt sets machine to "pc-0.11" even if kvm qemu version is
0.10?
- why does an error occure if I set <type ... machine="pc-0.10 ... ">
15 years, 2 months
[libvirt] [PATCH] Fix use of dlopen modules
by Daniel P. Berrange
Remove the bogus dependancy between node_device.c & storage_backend.c
by moving the virWaitForDevices into util.h where it can be shared
safely
* src/storage_backend_disk.c, src/storage_backend_logical.c,
src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace
virStorageBackendWaitForDevices with virFileWaitForDevices
* src/storage_backend.c, src/storage_backend.h: Remove
virStorageBackendWaitForDevices, virWaitForDevices
* src/util.h, src/util.c: Add virFileWaitForDevices
* configure.in: Move xmlrpc check further down after pkgconfig
is detected
* src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula
* src/libvirt_private.syms: Add many missing exports
---
configure.in | 6 +++---
src/Makefile.am | 4 ++--
src/libvirt_private.syms | 14 +++++++++++++-
src/node_device.c | 4 ++--
src/storage_backend.c | 31 -------------------------------
src/storage_backend.h | 2 --
src/storage_backend_disk.c | 4 ++--
src/storage_backend_logical.c | 2 +-
src/storage_backend_mpath.c | 2 +-
src/storage_backend_scsi.c | 4 ++--
src/util.c | 27 +++++++++++++++++++++++++++
src/util.h | 2 ++
12 files changed, 55 insertions(+), 47 deletions(-)
diff --git a/configure.in b/configure.in
index 060eb50..120f7e7 100644
--- a/configure.in
+++ b/configure.in
@@ -463,6 +463,9 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
fi
+dnl Need to test if pkg-config exists
+PKG_PROG_PKG_CONFIG
+
dnl OpenNebula driver Compilation setting
dnl
@@ -491,9 +494,6 @@ AC_SUBST([XMLRPC_CFLAGS])
AC_SUBST([XMLRPC_LIBS])
-dnl Need to test if pkg-config exists
-PKG_PROG_PKG_CONFIG
-
dnl ==========================================================================
dnl find libxml2 library, borrowed from xmlsec
dnl ==========================================================================
diff --git a/src/Makefile.am b/src/Makefile.am
index 628edc5..02c1f74 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -396,8 +396,8 @@ noinst_LTLIBRARIES += libvirt_driver_one.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_one.la
endif
-libvirt_driver_one_la_CFLAGS = $(ONE_LIBS)
-libvirt_driver_one_la_LDFLAGS = $(ONE_LIBS)
+libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS)
+libvirt_driver_one_la_LDFLAGS = $(XMLRPC_LIBS)
#libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
if WITH_DRIVER_MODULES
libvirt_driver_one_la_LDFLAGS += -module -avoid-version
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8dd279d..06192fc 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -10,6 +10,7 @@ virBufferAdd;
virBufferAddChar;
virBufferContentAndReset;
virBufferError;
+virBufferURIEncodeString;
# caps.h
@@ -167,7 +168,16 @@ virHashSize;
virInterfaceDefFormat;
virInterfaceDefParseFile;
virInterfaceDefParseString;
+virInterfaceDefParseNode;
virInterfaceDefFree;
+virInterfaceFindByName;
+virInterfaceFindByMACString;
+virInterfaceAssignDef;
+virInterfaceRemove;
+virInterfaceObjLock;
+virInterfaceObjUnlock;
+virInterfaceObjListFree;
+
# interface_driver.h
interfaceRegister;
@@ -214,6 +224,7 @@ virRegisterNetworkDriver;
virRegisterStateDriver;
virRegisterStorageDriver;
virRegisterDeviceMonitor;
+virRegisterSecretDriver;
# logging.h
@@ -410,6 +421,7 @@ virGetUserName;
virGetUserID;
virGetGroupID;
virFileFindMountPoint;
+virFileWaitForDevices;
# uuid.h
@@ -421,7 +433,7 @@ virUUIDParse;
# virterror_internal.h
virReportErrorHelper;
virErrorMsg;
-virRaiseError;
+virRaiseErrorFull;
virReportSystemErrorFull;
virReportOOMErrorFull;
virStrerror;
diff --git a/src/node_device.c b/src/node_device.c
index ded203f..69e15b6 100644
--- a/src/node_device.c
+++ b/src/node_device.c
@@ -35,7 +35,7 @@
#include "node_device_conf.h"
#include "node_device_hal.h"
#include "node_device.h"
-#include "storage_backend.h" /* For virWaitForDevices */
+#include "util.h"
#define VIR_FROM_THIS VIR_FROM_NODEDEV
@@ -599,7 +599,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
- virWaitForDevices(conn);
+ virFileWaitForDevices(conn);
dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn);
diff --git a/src/storage_backend.c b/src/storage_backend.c
index 5e04f35..0a20255 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -630,31 +630,6 @@ virStorageBackendGetBuildVolFromFunction(virConnectPtr conn,
return virStorageBackendCreateRaw;
}
-#if defined(UDEVADM) || defined(UDEVSETTLE)
-void virWaitForDevices(virConnectPtr conn)
-{
-#ifdef UDEVADM
- const char *const settleprog[] = { UDEVADM, "settle", NULL };
-#else
- const char *const settleprog[] = { UDEVSETTLE, NULL };
-#endif
- int exitstatus;
-
- if (access(settleprog[0], X_OK) != 0)
- return;
-
- /*
- * NOTE: we ignore errors here; this is just to make sure that any device
- * nodes that are being created finish before we try to scan them.
- * If this fails for any reason, we still have the backup of polling for
- * 5 seconds for device nodes.
- */
- virRun(conn, settleprog, &exitstatus);
-}
-#else
-void virWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {}
-#endif
-
virStorageBackendPtr
virStorageBackendForType(int type) {
@@ -893,12 +868,6 @@ virStorageBackendUpdateVolTargetFormatFD(virConnectPtr conn,
}
-void virStorageBackendWaitForDevices(virConnectPtr conn)
-{
- virWaitForDevices(conn);
- return;
-}
-
/*
* Given a volume path directly in /dev/XXX, iterate over the
* entries in the directory pool->def->target.path and find the
diff --git a/src/storage_backend.h b/src/storage_backend.h
index eb5bf87..88c6161 100644
--- a/src/storage_backend.h
+++ b/src/storage_backend.h
@@ -95,7 +95,6 @@ int
virStorageBackendUpdateVolTargetFormatFD(virConnectPtr conn,
virStorageVolTargetPtr target,
int fd);
-void virStorageBackendWaitForDevices(virConnectPtr conn);
char *virStorageBackendStablePath(virConnectPtr conn,
virStoragePoolObjPtr pool,
@@ -128,6 +127,5 @@ int virStorageBackendRunProgNul(virConnectPtr conn,
virStorageBackendListVolNulFunc func,
void *data);
-void virWaitForDevices(virConnectPtr conn);
#endif /* __VIR_STORAGE_BACKEND_H__ */
diff --git a/src/storage_backend_disk.c b/src/storage_backend_disk.c
index 6fdb566..e82959c 100644
--- a/src/storage_backend_disk.c
+++ b/src/storage_backend_disk.c
@@ -325,7 +325,7 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn,
VIR_FREE(pool->def->source.devices[0].freeExtents);
pool->def->source.devices[0].nfreeExtent = 0;
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
if (virStorageBackendDiskReadGeometry(conn, pool) != 0) {
return -1;
@@ -583,7 +583,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn,
return -1;
/* wait for device node to show up */
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
/* Blow away free extent info, as we're about to re-populate it */
VIR_FREE(pool->def->source.devices[0].freeExtents);
diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c
index 43117e8..4389120 100644
--- a/src/storage_backend_logical.c
+++ b/src/storage_backend_logical.c
@@ -478,7 +478,7 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn,
};
int exitstatus;
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
/* Get list of all logical volumes */
if (virStorageBackendLogicalFindLVs(conn, pool, NULL) < 0) {
diff --git a/src/storage_backend_mpath.c b/src/storage_backend_mpath.c
index ae02aac..fcc38ba 100644
--- a/src/storage_backend_mpath.c
+++ b/src/storage_backend_mpath.c
@@ -332,7 +332,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn,
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
virStorageBackendGetMaps(conn, pool);
diff --git a/src/storage_backend_scsi.c b/src/storage_backend_scsi.c
index a09103f..c70b1ed 100644
--- a/src/storage_backend_scsi.c
+++ b/src/storage_backend_scsi.c
@@ -494,7 +494,7 @@ virStorageBackendSCSIFindLUs(virConnectPtr conn,
VIR_DEBUG(_("Discovering LUs on host %u"), scanhost);
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
if (virAsprintf(&device_path, "/sys/bus/scsi/devices") < 0) {
virReportOOMError(conn);
@@ -542,7 +542,7 @@ virStorageBackendSCSIGetHostNumber(virConnectPtr conn,
VIR_DEBUG(_("Finding host number from '%s'"), sysfs_path);
- virStorageBackendWaitForDevices(conn);
+ virFileWaitForDevices(conn);
sysdir = opendir(sysfs_path);
diff --git a/src/util.c b/src/util.c
index af50028..1878e33 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2019,3 +2019,30 @@ cleanup:
return ret;
}
#endif
+
+#ifndef PROXY
+#if defined(UDEVADM) || defined(UDEVSETTLE)
+void virFileWaitForDevices(virConnectPtr conn)
+{
+#ifdef UDEVADM
+ const char *const settleprog[] = { UDEVADM, "settle", NULL };
+#else
+ const char *const settleprog[] = { UDEVSETTLE, NULL };
+#endif
+ int exitstatus;
+
+ if (access(settleprog[0], X_OK) != 0)
+ return;
+
+ /*
+ * NOTE: we ignore errors here; this is just to make sure that any device
+ * nodes that are being created finish before we try to scan them.
+ * If this fails for any reason, we still have the backup of polling for
+ * 5 seconds for device nodes.
+ */
+ virRun(conn, settleprog, &exitstatus);
+}
+#else
+void virFileWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {}
+#endif
+#endif
diff --git a/src/util.h b/src/util.h
index 896e1b4..f9715ab 100644
--- a/src/util.h
+++ b/src/util.h
@@ -237,4 +237,6 @@ int virRandom(int max);
char *virFileFindMountPoint(const char *type);
#endif
+void virFileWaitForDevices(virConnectPtr conn);
+
#endif /* __VIR_UTIL_H__ */
--
1.6.2.5
15 years, 2 months
[libvirt] libvir: QEMU error : remoteDomainProcessEvent: unmarshalling msg
by Kenneth Nagin
I am monitoring events using the example event monitor, event-test, but
remoteDomainProcessEvent is outputing an "unmarshalling msg" error
when creating a VM.
I've installed libvirt 0.6.5. It is configured without XEN; otherwise it
is the default configuration.
Any suggestions on how to overcome the problem?
Kenneth Nagin
15 years, 2 months
[libvirt] [PATCH 1/5] Add esx and tcp migration uri transports to capabilities schema
by Mark McLoughlin
* docs/schemas/capabilities.rng: include esx and tcp uri_transport
---
docs/schemas/capability.rng | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 1e3c5f3..dbfe1c5 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -79,6 +79,8 @@
<oneOrMore>
<element name='uri_transport'>
<choice>
+ <value>esx</value>
+ <value>tcp</value>
<value>xenmigr</value>
</choice>
</element>
--
1.6.2.5
15 years, 2 months
[libvirt] [PATCH] Fix regression from "Avoid polling on FDs with no events"
by Chris Lalancette
After the mentioned patch was applied, I noticed that
shutting down a kvm guest from inside (i.e. poweroff) caused
the guest to shutdown, but not removed from the list of
active guests. DanB pointed out that the problem is that
the virEventAddHandle() call in the qemu driver was asking
to watch for 0 events, not HANGUP | ERROR as it should. Add
these events so that shutdown works again.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/qemu_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 683fe20..996bfff 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -979,7 +979,8 @@ qemudOpenMonitorCommon(virConnectPtr conn,
if (ret != 0)
return ret;
- if ((vm->monitorWatch = virEventAddHandle(vm->monitor, 0,
+ if ((vm->monitorWatch = virEventAddHandle(vm->monitor,
+ VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR,
qemudDispatchVMEvent,
driver, NULL)) < 0)
return -1;
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Close logfile fd after spawning qemu
by Ryota Ozaki
Hi,
This patch closes logfile fd after spawing qemu in qemudStartVMDaemon.
The fd seems to be closed in the error path, but not in the normal path.
The fd is passed to virExecDaemonize though, but looks not being closed
inside it. Eventually, the fd is never closed during libvirtd lifetime.
Thanks,
ozaki-r
>From b3d3e0f24c5df5c7677e539bbc2598f2d7fbc3b8 Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <ozaki.ryota(a)gmail.com>
Date: Thu, 10 Sep 2009 12:53:56 +0900
Subject: [PATCH] Close logfile fd after spawning qemu
---
src/qemu_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 8f16e72..f2182c4 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2187,6 +2187,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
VIR_EXEC_NONBLOCK | VIR_EXEC_CLEAR_CAPS,
qemudSecurityHook, &hookData,
pidfile);
+ close(logfile);
VIR_FREE(pidfile);
/* wait for qemu process to to show up */
--
1.6.0.6
15 years, 2 months