Fix use of dlopen modules
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
This commit is contained in:
parent
7ec20935bd
commit
fcd4e26943
@ -463,6 +463,9 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
dnl Need to test if pkg-config exists
|
||||||
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
dnl OpenNebula driver Compilation setting
|
dnl OpenNebula driver Compilation setting
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
@ -491,9 +494,6 @@ AC_SUBST([XMLRPC_CFLAGS])
|
|||||||
AC_SUBST([XMLRPC_LIBS])
|
AC_SUBST([XMLRPC_LIBS])
|
||||||
|
|
||||||
|
|
||||||
dnl Need to test if pkg-config exists
|
|
||||||
PKG_PROG_PKG_CONFIG
|
|
||||||
|
|
||||||
dnl ==========================================================================
|
dnl ==========================================================================
|
||||||
dnl find libxml2 library, borrowed from xmlsec
|
dnl find libxml2 library, borrowed from xmlsec
|
||||||
dnl ==========================================================================
|
dnl ==========================================================================
|
||||||
|
@ -397,8 +397,8 @@ noinst_LTLIBRARIES += libvirt_driver_one.la
|
|||||||
# Stateful, so linked to daemon instead
|
# Stateful, so linked to daemon instead
|
||||||
#libvirt_la_LIBADD += libvirt_driver_one.la
|
#libvirt_la_LIBADD += libvirt_driver_one.la
|
||||||
endif
|
endif
|
||||||
libvirt_driver_one_la_CFLAGS = $(ONE_LIBS)
|
libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS)
|
||||||
libvirt_driver_one_la_LDFLAGS = $(ONE_LIBS)
|
libvirt_driver_one_la_LDFLAGS = $(XMLRPC_LIBS)
|
||||||
#libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
|
#libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
|
||||||
if WITH_DRIVER_MODULES
|
if WITH_DRIVER_MODULES
|
||||||
libvirt_driver_one_la_LDFLAGS += -module -avoid-version
|
libvirt_driver_one_la_LDFLAGS += -module -avoid-version
|
||||||
|
@ -10,6 +10,7 @@ virBufferAdd;
|
|||||||
virBufferAddChar;
|
virBufferAddChar;
|
||||||
virBufferContentAndReset;
|
virBufferContentAndReset;
|
||||||
virBufferError;
|
virBufferError;
|
||||||
|
virBufferURIEncodeString;
|
||||||
|
|
||||||
|
|
||||||
# caps.h
|
# caps.h
|
||||||
@ -167,7 +168,16 @@ virHashSize;
|
|||||||
virInterfaceDefFormat;
|
virInterfaceDefFormat;
|
||||||
virInterfaceDefParseFile;
|
virInterfaceDefParseFile;
|
||||||
virInterfaceDefParseString;
|
virInterfaceDefParseString;
|
||||||
|
virInterfaceDefParseNode;
|
||||||
virInterfaceDefFree;
|
virInterfaceDefFree;
|
||||||
|
virInterfaceFindByName;
|
||||||
|
virInterfaceFindByMACString;
|
||||||
|
virInterfaceAssignDef;
|
||||||
|
virInterfaceRemove;
|
||||||
|
virInterfaceObjLock;
|
||||||
|
virInterfaceObjUnlock;
|
||||||
|
virInterfaceObjListFree;
|
||||||
|
|
||||||
|
|
||||||
# interface_driver.h
|
# interface_driver.h
|
||||||
interfaceRegister;
|
interfaceRegister;
|
||||||
@ -214,6 +224,7 @@ virRegisterNetworkDriver;
|
|||||||
virRegisterStateDriver;
|
virRegisterStateDriver;
|
||||||
virRegisterStorageDriver;
|
virRegisterStorageDriver;
|
||||||
virRegisterDeviceMonitor;
|
virRegisterDeviceMonitor;
|
||||||
|
virRegisterSecretDriver;
|
||||||
|
|
||||||
|
|
||||||
# logging.h
|
# logging.h
|
||||||
@ -412,6 +423,7 @@ virGetUserName;
|
|||||||
virGetUserID;
|
virGetUserID;
|
||||||
virGetGroupID;
|
virGetGroupID;
|
||||||
virFileFindMountPoint;
|
virFileFindMountPoint;
|
||||||
|
virFileWaitForDevices;
|
||||||
|
|
||||||
# usb.h
|
# usb.h
|
||||||
usbGetDevice;
|
usbGetDevice;
|
||||||
@ -427,7 +439,7 @@ virUUIDParse;
|
|||||||
# virterror_internal.h
|
# virterror_internal.h
|
||||||
virReportErrorHelper;
|
virReportErrorHelper;
|
||||||
virErrorMsg;
|
virErrorMsg;
|
||||||
virRaiseError;
|
virRaiseErrorFull;
|
||||||
virReportSystemErrorFull;
|
virReportSystemErrorFull;
|
||||||
virReportOOMErrorFull;
|
virReportOOMErrorFull;
|
||||||
virStrerror;
|
virStrerror;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "node_device_conf.h"
|
#include "node_device_conf.h"
|
||||||
#include "node_device_hal.h"
|
#include "node_device_hal.h"
|
||||||
#include "node_device.h"
|
#include "node_device.h"
|
||||||
#include "storage_backend.h" /* For virWaitForDevices */
|
#include "util.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_NODEDEV
|
#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) {
|
while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
|
||||||
|
|
||||||
virWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn);
|
dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn);
|
||||||
|
|
||||||
|
@ -630,31 +630,6 @@ virStorageBackendGetBuildVolFromFunction(virConnectPtr conn,
|
|||||||
return virStorageBackendCreateRaw;
|
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
|
virStorageBackendPtr
|
||||||
virStorageBackendForType(int type) {
|
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
|
* Given a volume path directly in /dev/XXX, iterate over the
|
||||||
* entries in the directory pool->def->target.path and find the
|
* entries in the directory pool->def->target.path and find the
|
||||||
|
@ -95,7 +95,6 @@ int
|
|||||||
virStorageBackendUpdateVolTargetFormatFD(virConnectPtr conn,
|
virStorageBackendUpdateVolTargetFormatFD(virConnectPtr conn,
|
||||||
virStorageVolTargetPtr target,
|
virStorageVolTargetPtr target,
|
||||||
int fd);
|
int fd);
|
||||||
void virStorageBackendWaitForDevices(virConnectPtr conn);
|
|
||||||
|
|
||||||
char *virStorageBackendStablePath(virConnectPtr conn,
|
char *virStorageBackendStablePath(virConnectPtr conn,
|
||||||
virStoragePoolObjPtr pool,
|
virStoragePoolObjPtr pool,
|
||||||
@ -128,6 +127,5 @@ int virStorageBackendRunProgNul(virConnectPtr conn,
|
|||||||
virStorageBackendListVolNulFunc func,
|
virStorageBackendListVolNulFunc func,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
void virWaitForDevices(virConnectPtr conn);
|
|
||||||
|
|
||||||
#endif /* __VIR_STORAGE_BACKEND_H__ */
|
#endif /* __VIR_STORAGE_BACKEND_H__ */
|
||||||
|
@ -325,7 +325,7 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn,
|
|||||||
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
||||||
pool->def->source.devices[0].nfreeExtent = 0;
|
pool->def->source.devices[0].nfreeExtent = 0;
|
||||||
|
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
if (virStorageBackendDiskReadGeometry(conn, pool) != 0) {
|
if (virStorageBackendDiskReadGeometry(conn, pool) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -583,7 +583,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* wait for device node to show up */
|
/* wait for device node to show up */
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
/* Blow away free extent info, as we're about to re-populate it */
|
/* Blow away free extent info, as we're about to re-populate it */
|
||||||
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
||||||
|
@ -478,7 +478,7 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn,
|
|||||||
};
|
};
|
||||||
int exitstatus;
|
int exitstatus;
|
||||||
|
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
/* Get list of all logical volumes */
|
/* Get list of all logical volumes */
|
||||||
if (virStorageBackendLogicalFindLVs(conn, pool, NULL) < 0) {
|
if (virStorageBackendLogicalFindLVs(conn, pool, NULL) < 0) {
|
||||||
|
@ -332,7 +332,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn,
|
|||||||
|
|
||||||
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
|
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
|
||||||
|
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
virStorageBackendGetMaps(conn, pool);
|
virStorageBackendGetMaps(conn, pool);
|
||||||
|
|
||||||
|
@ -494,7 +494,7 @@ virStorageBackendSCSIFindLUs(virConnectPtr conn,
|
|||||||
|
|
||||||
VIR_DEBUG(_("Discovering LUs on host %u"), scanhost);
|
VIR_DEBUG(_("Discovering LUs on host %u"), scanhost);
|
||||||
|
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
if (virAsprintf(&device_path, "/sys/bus/scsi/devices") < 0) {
|
if (virAsprintf(&device_path, "/sys/bus/scsi/devices") < 0) {
|
||||||
virReportOOMError(conn);
|
virReportOOMError(conn);
|
||||||
@ -542,7 +542,7 @@ virStorageBackendSCSIGetHostNumber(virConnectPtr conn,
|
|||||||
|
|
||||||
VIR_DEBUG(_("Finding host number from '%s'"), sysfs_path);
|
VIR_DEBUG(_("Finding host number from '%s'"), sysfs_path);
|
||||||
|
|
||||||
virStorageBackendWaitForDevices(conn);
|
virFileWaitForDevices(conn);
|
||||||
|
|
||||||
sysdir = opendir(sysfs_path);
|
sysdir = opendir(sysfs_path);
|
||||||
|
|
||||||
|
27
src/util.c
27
src/util.c
@ -2019,3 +2019,30 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
||||||
|
@ -237,4 +237,6 @@ int virRandom(int max);
|
|||||||
char *virFileFindMountPoint(const char *type);
|
char *virFileFindMountPoint(const char *type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void virFileWaitForDevices(virConnectPtr conn);
|
||||||
|
|
||||||
#endif /* __VIR_UTIL_H__ */
|
#endif /* __VIR_UTIL_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user