[libvirt] [PATCH] Port library versioning to Solaris
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229369745 28800
# Node ID ce24d41d372948cd5440cf17bdb58ce33faffa84
# Parent 9e1a44b5c166b73e36d3cffc5398af0bec39ddc7
Port library versioning to Solaris
Use a more-porable comment character in the version file, and pass in
the right linker options.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -59,6 +59,11 @@ AM_PROG_LIBTOOL
AM_PROG_LIBTOOL
AM_PROG_CC_C_O
+
+VERSION_SCRIPT_FLAGS=-Wl,--version-script=
+`/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null` || \
+ VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+AC_SUBST(VERSION_SCRIPT_FLAGS)
LIBVIRT_COMPILE_WARNINGS([maximum])
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -395,7 +395,7 @@ libvirt_la_SOURCES =
libvirt_la_SOURCES =
libvirt_la_LIBADD += \
@CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
-libvirt_la_LDFLAGS = -Wl,--version-script=libvirt_sym.version \
+libvirt_la_LDFLAGS = @VERSION_SCRIPT_FLAGS(a)libvirt_sym.version \
-version-info @LIBVIRT_VERSION_INFO@ \
$(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
$(LIBXML_LIBS) $(SELINUX_LIBS) \
diff --git a/src/libvirt_sym.version.in b/src/libvirt_sym.version.in
--- a/src/libvirt_sym.version.in
+++ b/src/libvirt_sym.version.in
@@ -1,21 +1,21 @@
-/*
- * WARNING: libvirt_sym.version.in is the master file
- *
- * WARNING: libvirt_sym.version is auto-generated by configure
- */
-
-/*
- * First officially exported symbols, for which header
- * file definitions are installed in /usr/include/libvirt
- * either from libvirt.h and virterror.h
- *
- * Versions here are *fixed* to match the libvirt version
- * at which the symbol was introduced. This ensures that
- * a new client app requiring symbol foo() can't accidentally
- * run with old libvirt.so not providing foo() - the global
- * soname version info can't enforce this since we never
- * change the soname
- */
+#
+# WARNING: libvirt_sym.version.in is the master file
+#
+# WARNING: libvirt_sym.version is auto-generated by configure
+#
+
+#
+# First officially exported symbols, for which header
+# file definitions are installed in /usr/include/libvirt
+# either from libvirt.h and virterror.h
+#
+# Versions here are *fixed* to match the libvirt version
+# at which the symbol was introduced. This ensures that
+# a new client app requiring symbol foo() can't accidentally
+# run with old libvirt.so not providing foo() - the global
+# soname version info can't enforce this since we never
+# change the soname
+#/
LIBVIRT_0.0.3 {
global:
virConnectClose;
@@ -249,30 +249,30 @@ LIBVIRT_0.5.0 {
} LIBVIRT_0.4.5;
-/* .... define new API here using predicted next version number .... */
-
-
-
-
-/*
- * Finally these symbols are private and semantics may change
- * on every release, hence the version number is spliced in at
- * build time. This ensures that if libvirtd, virsh, or a driver
- * module was built against one libvirt release, it will refuse
- * to load with another where symbols may have same names but
- * different semantics.
- *
- * No header files are provided outside the source tree.
- *
- * Keep this section ordered alphabetically by header file name
- *
- * Symbols here are only for use by virsh, libvirtd and dlopen
- * driver modules
- */
+# .... define new API here using predicted next version number ....
+
+
+
+
+#
+# Finally these symbols are private and semantics may change
+# on every release, hence the version number is spliced in at
+# build time. This ensures that if libvirtd, virsh, or a driver
+# module was built against one libvirt release, it will refuse
+# to load with another where symbols may have same names but
+# different semantics.
+#
+# No header files are provided outside the source tree.
+#
+# Keep this section ordered alphabetically by header file name
+#
+# Symbols here are only for use by virsh, libvirtd and dlopen
+# driver modules
+#/
LIBVIRT_PRIVATE_@VERSION@ {
global:
- /* bridge.h */
+ # bridge.h
brAddBridge;
brAddInterface;
brAddTap;
@@ -286,7 +286,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
brShutdown;
- /* buf.h */
+ # buf.h
virBufferVSprintf;
virBufferAdd;
virBufferAddChar;
@@ -294,7 +294,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virBufferError;
- /* caps.h */
+ # caps.h
virCapabilitiesAddGuest;
virCapabilitiesAddGuestDomain;
virCapabilitiesAddGuestFeature;
@@ -310,7 +310,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virCapabilitiesSetMacPrefix;
- /* conf.h */
+ # conf.h
virConfNew;
virConfReadFile;
virConfReadMem;
@@ -322,7 +322,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virConfWriteMem;
- /* datatypes.h */
+ # datatypes.h
virGetDomain;
virGetNetwork;
virGetStoragePool;
@@ -331,7 +331,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virUnrefDomain;
- /* domain_conf.h */
+ # domain_conf.h
virDiskNameToBusDeviceIndex;
virDiskNameToIndex;
virDomainAssignDef;
@@ -375,7 +375,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainFSDefFree;
- /* domain_event.h */
+ # domain_event.h
virDomainEventCallbackListAdd;
virDomainEventCallbackListFree;
virDomainEventCallbackListRemove;
@@ -385,11 +385,11 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainEventCallbackQueuePush;
- /* driver.h */
+ # driver.h
virDriverLoadModule;
- /* event.h */
+ # event.h
virEventAddHandle;
virEventAddTimeout;
virEventRemoveHandle;
@@ -398,7 +398,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virEventUpdateTimeout;
- /* hash.h */
+ # hash.h
virHashAddEntry;
virHashCreate;
virHashForEach;
@@ -410,7 +410,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virHashSize;
- /* iptables.h */
+ # iptables.h
iptablesAddForwardAllowCross;
iptablesAddForwardAllowIn;
iptablesAddForwardAllowOut;
@@ -435,7 +435,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
iptablesSaveRules;
- /* libvirt_internal.h */
+ # libvirt_internal.h
debugFlag;
virStateInitialize;
virStateCleanup;
@@ -455,14 +455,14 @@ LIBVIRT_PRIVATE_@VERSION@ {
virRegisterDeviceMonitor;
- /* memory.h */
+ # memory.h
virAlloc;
virAllocN;
virReallocN;
virFree;
- /* network_conf.h */
+ # network_conf.h
virNetworkAssignDef;
virNetworkDefFormat;
virNetworkDefFree;
@@ -479,11 +479,11 @@ LIBVIRT_PRIVATE_@VERSION@ {
virNetworkSaveConfig;
- /* nodeinfo.h */
+ # nodeinfo.h
virNodeInfoPopulate;
- /* node_device_conf.h */
+ # node_device_conf.h
virNodeDeviceObjRemove;
virNodeDevCapTypeToString;
virNodeDeviceFindByName;
@@ -493,18 +493,18 @@ LIBVIRT_PRIVATE_@VERSION@ {
virNodeDeviceDefFormat;
- /* qparams.h */
+ # qparams.h
qparam_get_query;
qparam_query_parse;
free_qparam_set;
- /* stats_linux.h */
+ # stats_linux.h
linuxDomainInterfaceStats;
xenLinuxDomainBlockStats;
- /* storage_backend.h */
+ # storage_backend.h
virStorageBackendForType;
virStorageBackendFromString;
virStorageBackendPartTableTypeFromString;
@@ -517,7 +517,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virStorageBackendUpdateVolInfoFD;
- /* storage_conf.h */
+ # storage_conf.h
virStorageBackendPoolOptionsForType;
virStoragePoolDefFormat;
virStoragePoolDefFree;
@@ -546,7 +546,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virStoragePoolTypeFromString;
- /* util.h */
+ # util.h
virFileReadAll;
virStrToLong_i;
virStrToLong_ll;
@@ -577,26 +577,26 @@ LIBVIRT_PRIVATE_@VERSION@ {
virSkipSpaces;
- /* uuid.h */
+ # uuid.h
virUUIDFormat;
virUUIDGenerate;
virUUIDParse;
- /* virterror_internal.h */
+ # virterror_internal.h
virReportErrorHelper;
virErrorMsg;
virRaiseError;
- /* xml.h */
+ # xml.h
virXPathLong;
virXPathNodeSet;
virXPathString;
virXMLPropString;
- /* Finally everything else is totally private */
+ # Finally everything else is totally private
local:
*;
};
16 years, 3 months
[libvirt] [PATCH] Fix __sun conditional
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229369745 28800
# Node ID 9e1a44b5c166b73e36d3cffc5398af0bec39ddc7
# Parent 2bee618a0557131c383b124b2b88bd407b462df4
Fix __sun conditional
It's __sun not __sun__.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/xen_internal.c b/src/xen_internal.c
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -76,7 +76,7 @@ typedef struct v1_hypercall_struct
#define XEN_V1_IOCTL_HYPERCALL_CMD \
_IOC(_IOC_NONE, 'P', 0, sizeof(v1_hypercall_t))
typedef v1_hypercall_t hypercall_t;
-#elif defined(__sun__)
+#elif defined(__sun)
typedef privcmd_hypercall_t hypercall_t;
#else
#error "unsupported platform"
@@ -663,7 +663,7 @@ typedef struct xen_op_v2_dom xen_op_v2_d
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
#define HYPERVISOR_CAPABILITIES "/sys/hypervisor/properties/capabilities"
#define CPUINFO "/proc/cpuinfo"
-#elif defined(__sun__)
+#elif defined(__sun)
#define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd"
#define HYPERVISOR_CAPABILITIES ""
#define CPUINFO "/dev/cpu/self/cpuid"
@@ -1906,7 +1906,7 @@ xenHypervisorInit(void)
goto detect_v2;
}
-#ifndef __sun__
+#ifndef __sun
/*
* check if the old hypercall are actually working
*/
diff --git a/src/xen_unified.c b/src/xen_unified.c
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -213,7 +213,7 @@ xenUnifiedProbe (void)
if (virFileExists("/proc/xen"))
return 1;
#endif
-#ifdef __sun__
+#ifdef __sun
FILE *fh;
if (fh = fopen("/dev/xen/domcaps", "r")) {
diff --git a/src/xs_internal.c b/src/xs_internal.c
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -39,7 +39,7 @@
#ifdef __linux__
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
-#elif defined(__sun__)
+#elif defined(__sun)
#define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd"
#else
#error "unsupported platform"
16 years, 3 months
[libvirt] [PATCH] Fix statement not reached compiler error
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229369745 28800
# Node ID 2bee618a0557131c383b124b2b88bd407b462df4
# Parent 16ceb6f2e00c4639e97440723e57ec0be6d12cd9
Fix statement not reached compiler error
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -5091,25 +5091,23 @@ really_read_buf (virConnectPtr conn, str
return -1;
}
return err;
- } else {
- reread:
- err = recv (priv->sock, bytes, len, 0);
- if (err == -1) {
- if (errno == EINTR)
- goto reread;
- error (in_open ? NULL : conn,
- VIR_ERR_SYSTEM_ERROR, strerror (errno));
- return -1;
- }
- if (err == 0) {
- error (in_open ? NULL : conn,
- VIR_ERR_RPC, _("socket closed unexpectedly"));
- return -1;
- }
- return err;
- }
-
- return 0;
+ }
+
+reread:
+ err = recv (priv->sock, bytes, len, 0);
+ if (err == -1) {
+ if (errno == EINTR)
+ goto reread;
+ error (in_open ? NULL : conn,
+ VIR_ERR_SYSTEM_ERROR, strerror (errno));
+ return -1;
+ }
+ if (err == 0) {
+ error (in_open ? NULL : conn,
+ VIR_ERR_RPC, _("socket closed unexpectedly"));
+ return -1;
+ }
+ return err;
}
static int
16 years, 3 months
[libvirt] [PATCH] Fix initialization mismatch
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229369743 28800
# Node ID 16ceb6f2e00c4639e97440723e57ec0be6d12cd9
# Parent ead0d1c1d3adacf478db05ee8d6abe270c96c5da
Fix initialization mismatch
Make driver open routines correctly declare their return type.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/proxy_internal.c b/src/proxy_internal.c
--- a/src/proxy_internal.c
+++ b/src/proxy_internal.c
@@ -36,7 +36,7 @@ static int debug = 0;
static int debug = 0;
static int xenProxyClose(virConnectPtr conn);
-static int xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+static virDrvOpenStatus xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer);
static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
static char *xenProxyGetCapabilities(virConnectPtr conn);
@@ -477,7 +477,7 @@ retry:
*
* Returns 0 in case of success, and -1 in case of failure
*/
-int
+virDrvOpenStatus
xenProxyOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags)
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -851,7 +851,7 @@ doRemoteOpen (virConnectPtr conn,
goto cleanup;
}
-static int
+static virDrvOpenStatus
remoteOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags)
@@ -2633,7 +2633,7 @@ remoteDomainMemoryPeek (virDomainPtr dom
/*----------------------------------------------------------------------*/
-static int
+static virDrvOpenStatus
remoteNetworkOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags)
@@ -3033,7 +3033,7 @@ remoteNetworkSetAutostart (virNetworkPtr
/*----------------------------------------------------------------------*/
-static int
+static virDrvOpenStatus
remoteStorageOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags)
diff --git a/src/test.c b/src/test.c
--- a/src/test.c
+++ b/src/test.c
@@ -634,7 +634,7 @@ static int testOpenFromFile(virConnectPt
}
-static int testOpen(virConnectPtr conn,
+static virDrvOpenStatus testOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
diff --git a/src/xen_inotify.c b/src/xen_inotify.c
--- a/src/xen_inotify.c
+++ b/src/xen_inotify.c
@@ -347,7 +347,7 @@ reread:
*
* Returns 0 or -1 in case of error.
*/
-int
+virDrvOpenStatus
xenInotifyOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
diff --git a/src/xen_inotify.h b/src/xen_inotify.h
--- a/src/xen_inotify.h
+++ b/src/xen_inotify.h
@@ -21,10 +21,13 @@
*/
#ifndef __VIR_XEN_INOTIFY_H__
#define __VIR_XEN_INOTIFY_H__
+
#include "internal.h"
+#include "driver.h"
+
extern struct xenUnifiedDriver xenInotifyDriver;
-int xenInotifyOpen (virConnectPtr conn,
+virDrvOpenStatus xenInotifyOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags);
int xenInotifyClose (virConnectPtr conn);
diff --git a/src/xen_internal.c b/src/xen_internal.c
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -2031,7 +2031,7 @@ xenHypervisorInit(void)
*
* Returns 0 or -1 in case of error.
*/
-int
+virDrvOpenStatus
xenHypervisorOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
diff --git a/src/xen_internal.h b/src/xen_internal.h
--- a/src/xen_internal.h
+++ b/src/xen_internal.h
@@ -15,6 +15,7 @@
#include "internal.h"
#include "capabilities.h"
+#include "driver.h"
extern struct xenUnifiedDriver xenHypervisorDriver;
int xenHypervisorInit (void);
@@ -32,7 +33,8 @@ char *
char *
xenHypervisorDomainGetOSType (virDomainPtr dom);
-int xenHypervisorOpen (virConnectPtr conn,
+virDrvOpenStatus
+ xenHypervisorOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags);
int xenHypervisorClose (virConnectPtr conn);
diff --git a/src/xen_unified.c b/src/xen_unified.c
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -224,7 +224,7 @@ xenUnifiedProbe (void)
return 0;
}
-static int
+static virDrvOpenStatus
xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
{
int i, ret = VIR_DRV_OPEN_DECLINED;
diff --git a/src/xend_internal.c b/src/xend_internal.c
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -2704,7 +2704,7 @@ error:
*
* Returns 0 in case of success, -1 in case of error.
*/
-int
+virDrvOpenStatus
xenDaemonOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
diff --git a/src/xend_internal.h b/src/xend_internal.h
--- a/src/xend_internal.h
+++ b/src/xend_internal.h
@@ -24,6 +24,7 @@
#include "internal.h"
#include "capabilities.h"
#include "domain_conf.h"
+#include "driver.h"
#include "buf.h"
int
@@ -129,7 +130,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
/* refactored ones */
-int xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+virDrvOpenStatus xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
int xenDaemonClose(virConnectPtr conn);
int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
diff --git a/src/xm_internal.c b/src/xm_internal.c
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -581,7 +581,7 @@ int xenXMConfigCacheRefresh (virConnectP
* We only support a single directory, so repeated calls
* to open all end up using the same cache of files
*/
-int
+virDrvOpenStatus
xenXMOpen (virConnectPtr conn ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
diff --git a/src/xm_internal.h b/src/xm_internal.h
--- a/src/xm_internal.h
+++ b/src/xm_internal.h
@@ -26,6 +26,7 @@
#define _LIBVIRT_XM_INTERNAL_H_
#include "internal.h"
+#include "driver.h"
#include "conf.h"
#include "domain_conf.h"
@@ -38,7 +39,7 @@ int xenXMConfigCacheAddFile(virConnectPt
int xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename);
int xenXMConfigCacheRemoveFile(virConnectPtr conn, const char *filename);
-int xenXMOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+virDrvOpenStatus xenXMOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
int xenXMClose(virConnectPtr conn);
const char *xenXMGetType(virConnectPtr conn);
int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
diff --git a/src/xs_internal.c b/src/xs_internal.c
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -281,7 +281,7 @@ virDomainGetVMInfo(virDomainPtr domain,
*
* Returns 0 or -1 in case of error.
*/
-int
+virDrvOpenStatus
xenStoreOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
diff --git a/src/xs_internal.h b/src/xs_internal.h
--- a/src/xs_internal.h
+++ b/src/xs_internal.h
@@ -12,11 +12,12 @@
#define __VIR_XS_INTERNAL_H__
#include "internal.h"
+#include "driver.h"
extern struct xenUnifiedDriver xenStoreDriver;
int xenStoreInit (void);
-int xenStoreOpen (virConnectPtr conn,
+virDrvOpenStatus xenStoreOpen (virConnectPtr conn,
virConnectAuthPtr auth,
int flags);
int xenStoreClose (virConnectPtr conn);
16 years, 3 months
[libvirt] [PATCH] Cast callbacks to the correct type
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229367890 28800
# Node ID 728f90c86f2cd950463923c80fc57754d6e762eb
# Parent 6a8e82d7d2e166880fed8d7ad860a3e2e93d62be
Cast callbacks to the correct type
Avoid compiler warnings by performing the correct casts.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/libvirt.c b/src/libvirt.c
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5806,7 +5806,8 @@ virConnectDomainEventRegister(virConnect
}
if ((conn->driver) && (conn->driver->domainEventRegister))
- return conn->driver->domainEventRegister (conn, cb, opaque, freecb);
+ return conn->driver->domainEventRegister (conn, (void *)cb,
+ opaque, freecb);
return -1;
}
@@ -5835,9 +5836,9 @@ virConnectDomainEventDeregister(virConne
return (-1);
}
if ((conn->driver) && (conn->driver->domainEventDeregister))
- return conn->driver->domainEventDeregister (conn, cb);
-
- return -1;
-}
-
-
+ return conn->driver->domainEventDeregister (conn, (void *)cb);
+
+ return -1;
+}
+
+
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -4735,7 +4735,7 @@ static int remoteDomainEventRegister (vi
return -1;
}
if (virDomainEventCallbackListAdd(conn, priv->callbackList,
- callback, opaque, freecb) < 0) {
+ (virConnectDomainEventCallback)callback, opaque, freecb) < 0) {
error (conn, VIR_ERR_RPC, _("adding cb to list"));
return -1;
}
@@ -4757,7 +4757,7 @@ static int remoteDomainEventDeregister (
struct private_data *priv = conn->privateData;
if (virDomainEventCallbackListRemove(conn, priv->callbackList,
- callback) < 0) {
+ (virConnectDomainEventCallback)callback) < 0) {
error (conn, VIR_ERR_RPC, _("removing cb fron list"));
return -1;
}
diff --git a/src/xen_unified.c b/src/xen_unified.c
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -1372,7 +1372,7 @@ xenUnifiedDomainEventRegister (virConnec
conn->refs++;
return virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
- callback, opaque, freefunc);
+ (virConnectDomainEventCallback)callback, opaque, freefunc);
}
static int
@@ -1387,7 +1387,7 @@ xenUnifiedDomainEventDeregister (virConn
}
ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
- callback);
+ (virConnectDomainEventCallback)callback);
virUnrefConnect(conn);
return ret;
}
16 years, 3 months
[libvirt] [PATCH] Remove _PATH_DEVNULL usage
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229367890 28800
# Node ID c324c231c6a50be9f970f0f6c6d1629a7c09ab3b
# Parent 63174fd9f33749cb68431fd5d1ff6133ba48863b
Remove _PATH_DEVNULL usage
_PATH_DEVNULL provides no apparent advantage, and isn't available on
Solaris: replace with the string literal.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/qemud/qemud.c b/qemud/qemud.c
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -397,9 +397,9 @@ static int qemudGoDaemon(void) {
int stdoutfd = -1;
int nextpid;
- if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0)
+ if ((stdinfd = open("/dev/null", O_RDONLY)) < 0)
goto cleanup;
- if ((stdoutfd = open(_PATH_DEVNULL, O_WRONLY)) < 0)
+ if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0)
goto cleanup;
if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO)
goto cleanup;
diff --git a/src/util.c b/src/util.c
--- a/src/util.c
+++ b/src/util.c
@@ -205,10 +205,10 @@ __virExec(virConnectPtr conn,
return -1;
}
- if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) {
+ if ((null = open("/dev/null", O_RDONLY)) < 0) {
ReportError(conn, VIR_ERR_INTERNAL_ERROR,
_("cannot open %s: %s"),
- _PATH_DEVNULL, strerror(errno));
+ "/dev/null", strerror(errno));
goto cleanup;
}
diff --git a/tests/testutils.c b/tests/testutils.c
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -35,10 +35,6 @@
#ifdef HAVE_PATHS_H
#include <paths.h>
-#endif
-
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
#endif
#define GETTIMEOFDAY(T) gettimeofday(T, NULL)
@@ -157,9 +153,9 @@ void virtTestCaptureProgramExecChild(con
NULL
};
- if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0)
- goto cleanup;
- if ((stderrfd = open(_PATH_DEVNULL, O_WRONLY)) < 0)
+ if ((stdinfd = open("/dev/null", O_RDONLY)) < 0)
+ goto cleanup;
+ if ((stderrfd = open("/dev/null", O_WRONLY)) < 0)
goto cleanup;
open_max = sysconf (_SC_OPEN_MAX);
16 years, 3 months
[libvirt] [PATCH] Remove non-existent symbols from the version script
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229369745 28800
# Node ID d3e5c2e138bd794ab711cc2548c45112ba603ea2
# Parent 56d77e29bf90057791feebfa47506fc0933cd690
Remove non-existent symbols from the version script
The Solaris linker rightfully complains if a non-existent symbol is
referenced. Since these symbols don't exist in the current source, they
can have no purpose in a version script, so remove them.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/libvirt_sym.version.in b/src/libvirt_sym.version.in
--- a/src/libvirt_sym.version.in
+++ b/src/libvirt_sym.version.in
@@ -62,7 +62,6 @@ LIBVIRT_0.1.0 {
virCopyLastError;
virConnSetErrorFunc;
virResetLastError;
- virErrorFunc;
virResetError;
virConnGetLastError;
virGetLastError;
@@ -199,8 +198,6 @@ LIBVIRT_0.4.1 {
virStoragePoolNumOfVolumes;
virStoragePoolListVolumes;
- virConnectNumOfStorageVolumes;
- virConnectListStorageVolumes;
virStorageVolGetConnect;
virStorageVolLookupByName;
virStorageVolLookupByKey;
@@ -235,13 +232,9 @@ LIBVIRT_0.5.0 {
virNodeNumOfDevices;
virNodeListDevices;
- virNodeNumOfDevicesByCap;
- virNodeListDevicesByCap;
virNodeDeviceLookupByName;
virNodeDeviceFree;
virNodeDeviceGetXMLDesc;
- virNodeDeviceCreate;
- virNodeDeviceDestroy;
virNodeDeviceGetName;
virNodeDeviceGetParent;
virNodeDeviceNumOfCaps;
@@ -441,7 +434,6 @@ LIBVIRT_PRIVATE_@VERSION@ {
virStateCleanup;
virStateReload;
virStateActive;
- virStateSigDispatcher;
virDrvSupportsFeature;
virDomainMigratePrepare;
virDomainMigratePerform;
@@ -506,10 +498,6 @@ LIBVIRT_PRIVATE_@VERSION@ {
# storage_backend.h
virStorageBackendForType;
- virStorageBackendFromString;
- virStorageBackendPartTableTypeFromString;
- virStorageBackendPartTableTypeToString;
- virStorageBackendRegister;
virStorageBackendRunProgNul;
virStorageBackendRunProgRegex;
virStorageBackendStablePath;
@@ -518,7 +506,6 @@ LIBVIRT_PRIVATE_@VERSION@ {
# storage_conf.h
- virStorageBackendPoolOptionsForType;
virStoragePoolDefFormat;
virStoragePoolDefFree;
virStoragePoolDefParse;
16 years, 3 months
[libvirt] virsh save produces "unknown migration protocol: stdio"
by Richard W.M. Jones
I just want to forward this comment on from #virt so that we don't
lose it. It appears to be an incompatibility between libvirt 0.5.0
and recent KVM.
<knowinters> Hi, I'm using libvirt 0.5.0 with kvm-79, when I do virsh
save kvm replies with "unknown migration protocol: stdio". A state
file is created, but it's only 4K and when restored the vm boots from
scratch instead of starting where it was when i saved. I googled but
couldn't find a resolution. Is this a known issue?
<knowinters> nm i think i see what's happening.. it
<knowinters> 's using the exec: migration method to call dd to move
the state from stdio to a file
<knowinters> exec: isn't in kvm-79 i don't think, but i see it in git
so ill try that
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 68 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
16 years, 3 months
[libvirt] PATCH: Fix deadlock upon config file reload
by Daniel P. Berrange
Turned out there was a small locking bug when reloading domain config
files after SIGHUP. I committed the following patch to add in the missing
unlock call. This was one of the files I'm unable to do static analysis
on, hence why it was missed.
Daniel
Index: domain_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/domain_conf.c,v
retrieving revision 1.45
diff -u -p -r1.45 domain_conf.c
--- domain_conf.c 11 Dec 2008 11:44:30 -0000 1.45
+++ domain_conf.c 15 Dec 2008 10:51:11 -0000
@@ -3330,8 +3330,11 @@ virDomainObjPtr virDomainLoadConfig(virC
VIR_DOMAIN_XML_INACTIVE)))
goto error;
- if (virDomainFindByName(doms, def->name))
+ if ((dom = virDomainFindByName(doms, def->name))) {
+ virDomainObjUnlock(dom);
+ dom = NULL;
newVM = 0;
+ }
if (!(dom = virDomainAssignDef(conn, doms, def)))
goto error;
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 3 months