[libvirt] [PATCHv3 0/4] Add range checking for scheduler tunables
by Peter Krempa
This version improves virsh so that it doesn't update all tunables
but only those that changed (and now correctly).
This series contains a new patch that adds a helper to deal
with typed parameters.
Regarding typed parameters: Shouldn't we make the helpers to deal
with them public?
(Patches 1 and 2 didn't change to v2)
Peter Krempa (4):
qemu: clean up qemuSetSchedulerParametersFlags()
qemu: Add range checking for scheduler tunables when changed by API
util: Add helper to assign typed params from string
virsh: Update only changed scheduler tunables
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 96 ++++++++++++++++-----------
src/util/virtypedparam.c | 97 ++++++++++++++++++++++++++++
src/util/virtypedparam.h | 6 ++
tools/virsh-domain.c | 164 +++++++++++++++++++++--------------------------
5 files changed, 236 insertions(+), 128 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] RFC: APIs to manage KSM
by Osier Yang
Triggered by the requirement to control the new sys knob
/sys/kernel/mm/ksm/merge_nodes for a NUMA aware host by
patch:
http://permalink.gmane.org/gmane.linux.kernel.mm/81497
It shows there is no methods to manage the KSM in
libvirt. This proposes the new APIs like following, thanks
for suggestions/idea in advance.
== The macros and enums for the params' fields
/* virNodeKSMRunMode:
*
* Represents the modes of /sys/kernel/mm/ksm/run.
*/
typedef enum {
/* Stop ksmd from running but keep merged pages */
VIR_NODE_STOP_KSM_KEEP_MERGED_PAGES = 0,
/* Start ksmd */
VIR_NODE_START_KSM = 1,
/* Stop ksmd and and unmerge all pages currently merged */
VIR_NODE_STOP_KSM_UNMERGE_PAGES = 2,
} virNodeKSMRunMode;
/*
* VIR_NODE_KSM_PAGES_TO_SCAN:
*
* Macro for typed parameter that represents how many present pages
* to scan before ksmd goes to sleep.
*/
# define VIR_NODE_KSM_PAGES_TO_SCAN "pages_to_scan"
/*
* VIR_NODE_KSM_SLEEP_MILLISECS:
*
* Macro for typed parameter that represents how many milliseconds
* ksmd should sleep before next scan.
*/
# define VIR_NODE_KSM_SLEEP_MILLISECS "sleep_millisecs"
/*
* VIR_NODE_KSM_RUN:
*
* Macro for typed parameter that is used to control ksmd's state, as
* an int containing a virNodeKSMRunMode value.
*/
# define VIR_NODE_KSM_RUN "run"
/*
* VIR_NODE_KSM_PAGES_SHARED:
*
* Macro for typed parameter that represents how many ksm shared pages
* are being used.
*/
# define VIR_NODE_KSM_PAGES_SHARED "pages_shared"
/*
* VIR_NODE_KSM_PAGES_SHARING:
*
* Macro for typed parameter that represents how many sites are
* sharing the pages i.e. how much saved.
*/
# define VIR_NODE_KSM_PAGES_SHARING "pages_sharing"
/* VIR_NODE_KSM_PAGES_UNSHARED:
*
* Macro for typed parameter that represents how many pages unique
* but repeatedly checked for merging.
*/
# define VIR_NODE_KSM_PAGES_UNSHARED "pages_unshared"
/* VIR_NODE_KSM_PAGES_VOLATILE:
*
* Macro for typed parameter that represents how many pages changing
* too fast to be placed in a tree.
*/
# define VIR_NODE_KSM_PAGES_VOLATILE "pages_volatile"
/* VIR_NODE_KSM_FULL_SCAN:
*
* Macro for typed parameter that represents how many times all
* mergeable areas have been scanned.
*/
# define VIR_NODE_KSM_FULL_SCAN "full_scan"
== API to Get KSM parameters.
/*
* virNodeGetKSMParameters:
* @conn: pointer to the hypervisor connection
* @params: pointer to memory parameter object
* (return value, allocated by the caller)
* @nparams: pointer to number of memory parameters; input and output
* @flags: extra flags; not used yet, so callers should always pass 0
*
* ... Detailed comments ommitted ...
*
* Returns 0 in case of success, and -1 in case of failure.
*/
int
virNodeGetKSMParameters(virConnectPtr conn,
virTypedParameterPtr params,
int *nparams,
unsigned int flags);
== API to set KSM parameters.
Currently only "run", "pages_to_scan", and "sleep_millisecs"
are writable. The new boolearn sys knob "merge_nodes" could
be added once it's acceptted by kernel upstream.
/*
* virNodeSetKSMParameters:
* @conn: pointer to the hypervisor connection
* @params: pointer to scheduler parameter objects
* @naprams: number of scheduler parameter objects
* (this value can be the same or less than the returned
* value nparams of virDomainGetSchedulerType)
* @flags: extra flags; not used yet, so callers should always pass 0
*
* ... Detailed comments ommitted ...
*
* Returns 0 in case of success, -1 in case of failure.
*/
int
virNodeSetKSMParameters(virConnectPtr conn,
virTypedParameterPtr params,
int nparams,
unsigned int flags);
BTW, the other thing libvirt misses is to tell ksmtuned to retune
when a domain is started or destroyed. Which is outlined in
the Red Hat Virtualization Administration Guide doc, but it's
not true. So either we have a hole in libvirt, or lacks a fix
for the document.
<...>
The KSM tuning service
The ksmtuned service does not have any options. The ksmtuned service
loops and adjusts ksm. The ksmtuned service is notified by libvirt when
a guest is created or destroyed.
</...>
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6...
Regards,
Osier
12 years, 2 months
[libvirt] [PATCH] Refactor ESX storage driver and add iSCSI support
by Ata E Husain Bohra
Resent of
http://www.redhat.com/archives/libvir-list/2012-August/msg01353.html.
Merging recent branch updates to this patch.
Ata E Husain Bohra (1):
Refactor ESX storage driver and add iSCSI support
src/Makefile.am | 16 +-
src/esx/esx_driver.c | 4 +-
src/esx/esx_storage_backend_iscsi.c | 794 +++++++++++++++++++
src/esx/esx_storage_backend_iscsi.h | 31 +
src/esx/esx_storage_backend_vmfs.c | 1471 +++++++++++++++++++++++++++++++++++
src/esx/esx_storage_backend_vmfs.h | 31 +
src/esx/esx_storage_driver.c | 1303 +++++--------------------------
src/esx/esx_vi.c | 341 +++++++-
src/esx/esx_vi.h | 21 +-
src/esx/esx_vi_generator.input | 308 +++++++-
src/esx/esx_vi_generator.py | 19 +
11 files changed, 3218 insertions(+), 1121 deletions(-)
create mode 100644 src/esx/esx_storage_backend_iscsi.c
create mode 100644 src/esx/esx_storage_backend_iscsi.h
create mode 100644 src/esx/esx_storage_backend_vmfs.c
create mode 100644 src/esx/esx_storage_backend_vmfs.h
--
1.7.9.5
12 years, 2 months
[libvirt] [PATCH] Don't assume use of /sys/fs/cgroup
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The introduction of /sys/fs/cgroup came in fairly recent kernels.
Prior to that time distros would pick a custom directory like
/cgroup or /dev/cgroup. We need to auto-detect where this is,
rather than hardcoding it
---
src/lxc/lxc_container.c | 71 +++++++++++++++++++++++++++++++++----------------
src/util/cgroup.h | 2 --
2 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index f3a4622..9bc5610 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1307,7 +1307,8 @@ static void lxcContainerCGroupFree(struct lxcContainerCGroup *mounts,
static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
- size_t *nmountsret)
+ size_t *nmountsret,
+ char **root)
{
FILE *procmnt = NULL;
struct mntent mntent;
@@ -1321,8 +1322,9 @@ static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
*mountsret = NULL;
*nmountsret = 0;
+ *root = NULL;
- VIR_DEBUG("Finding cgroups mount points under %s", VIR_CGROUP_SYSFS_MOUNT);
+ VIR_DEBUG("Finding cgroups mount points of type cgroup");
if (!(procmnt = setmntent("/proc/mounts", "r"))) {
virReportSystemError(errno, "%s",
@@ -1332,10 +1334,24 @@ static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
while (getmntent_r(procmnt, &mntent, mntbuf, sizeof(mntbuf)) != NULL) {
VIR_DEBUG("Got %s", mntent.mnt_dir);
- if (STRNEQ(mntent.mnt_type, "cgroup") ||
- !STRPREFIX(mntent.mnt_dir, VIR_CGROUP_SYSFS_MOUNT))
+ if (STRNEQ(mntent.mnt_type, "cgroup"))
continue;
+ if (!*root) {
+ char *tmp;
+ if (!(*root = strdup(mntent.mnt_dir))) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ tmp = strrchr(*root, '/');
+ *tmp = '\0';
+ } else if (!STRPREFIX(mntent.mnt_dir, *root)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Cgroup %s is not mounted under %s"),
+ mntent.mnt_dir, *root);
+ goto cleanup;
+ }
+
/* Skip named mounts with no controller since they're
* for application use only ie systemd */
if (strstr(mntent.mnt_opts, "name="))
@@ -1349,14 +1365,14 @@ static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
virReportOOMError();
goto cleanup;
}
- VIR_DEBUG("Grabbed %s", mntent.mnt_dir);
+ VIR_DEBUG("Grabbed '%s'", mntent.mnt_dir);
}
- VIR_DEBUG("Checking for symlinks in %s", VIR_CGROUP_SYSFS_MOUNT);
- if (!(dh = opendir(VIR_CGROUP_SYSFS_MOUNT))) {
+ VIR_DEBUG("Checking for symlinks in %s", *root);
+ if (!(dh = opendir(*root))) {
virReportSystemError(errno,
_("Unable to read directory %s"),
- VIR_CGROUP_SYSFS_MOUNT);
+ *root);
goto cleanup;
}
@@ -1370,7 +1386,7 @@ static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
continue;
VIR_DEBUG("Checking entry %s", dent->d_name);
- if (virAsprintf(&path, "%s/%s", VIR_CGROUP_SYSFS_MOUNT, dent->d_name) < 0) {
+ if (virAsprintf(&path, "%s/%s", *root, dent->d_name) < 0) {
virReportOOMError();
goto cleanup;
}
@@ -1410,25 +1426,28 @@ cleanup:
endmntent(procmnt);
VIR_FREE(path);
- if (ret < 0)
+ if (ret < 0) {
lxcContainerCGroupFree(mounts, nmounts);
+ VIR_FREE(*root);
+ }
return ret;
}
static int lxcContainerMountCGroups(struct lxcContainerCGroup *mounts,
size_t nmounts,
- char * sec_mount_options)
+ const char *root,
+ char *sec_mount_options)
{
size_t i;
char *opts = NULL;
- VIR_DEBUG("Mounting cgroups at '%s'", VIR_CGROUP_SYSFS_MOUNT);
+ VIR_DEBUG("Mounting cgroups at '%s'", root);
- if (virFileMakePath(VIR_CGROUP_SYSFS_MOUNT) < 0) {
+ if (virFileMakePath(root) < 0) {
virReportSystemError(errno,
_("Unable to create directory %s"),
- VIR_CGROUP_SYSFS_MOUNT);
+ root);
return -1;
}
@@ -1438,11 +1457,11 @@ static int lxcContainerMountCGroups(struct lxcContainerCGroup *mounts,
return -1;
}
- if (mount("tmpfs", VIR_CGROUP_SYSFS_MOUNT, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
+ if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
VIR_FREE(opts);
virReportSystemError(errno,
_("Failed to mount %s on %s type %s"),
- "tmpfs", VIR_CGROUP_SYSFS_MOUNT, "tmpfs");
+ "tmpfs", root, "tmpfs");
return -1;
}
VIR_FREE(opts);
@@ -1467,10 +1486,10 @@ static int lxcContainerMountCGroups(struct lxcContainerCGroup *mounts,
}
if (mount("cgroup", mounts[i].dir, "cgroup",
- 0, mounts[i].dir + strlen(VIR_CGROUP_SYSFS_MOUNT) + 1) < 0) {
+ 0, mounts[i].dir + strlen(root) + 1) < 0) {
virReportSystemError(errno,
- _("Failed to mount %s on %s"),
- "cgroup", mounts[i].dir);
+ _("Failed to mount cgroup on '%s'"),
+ mounts[i].dir);
return -1;
}
}
@@ -1493,10 +1512,11 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
struct lxcContainerCGroup *mounts = NULL;
size_t nmounts = 0;
int ret = -1;
+ char *cgroupRoot;
/* Before pivoting we need to identify any
* cgroups controllers that are mounted */
- if (lxcContainerIdentifyCGroups(&mounts, &nmounts) < 0)
+ if (lxcContainerIdentifyCGroups(&mounts, &nmounts, &cgroupRoot) < 0)
return -1;
/* Gives us a private root, leaving all parent OS mounts on /.oldroot */
@@ -1519,7 +1539,8 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
/* Now we can re-mount the cgroups controllers in the
* same configuration as before */
- if (lxcContainerMountCGroups(mounts, nmounts, sec_mount_options) < 0)
+ if (lxcContainerMountCGroups(mounts, nmounts,
+ cgroupRoot, sec_mount_options) < 0)
goto cleanup;
/* Mounts /dev/pts */
@@ -1542,6 +1563,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
cleanup:
lxcContainerCGroupFree(mounts, nmounts);
+ VIR_FREE(cgroupRoot);
return ret;
}
@@ -1555,6 +1577,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
int ret = -1;
struct lxcContainerCGroup *mounts = NULL;
size_t nmounts = 0;
+ char *cgroupRoot;
VIR_DEBUG("def=%p", vmDef);
/*
@@ -1582,7 +1605,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
/* Before replacing /sys we need to identify any
* cgroups controllers that are mounted */
- if (lxcContainerIdentifyCGroups(&mounts, &nmounts) < 0)
+ if (lxcContainerIdentifyCGroups(&mounts, &nmounts, &cgroupRoot) < 0)
return -1;
/* Gets rid of any existing stuff under /proc, since we need new
@@ -1598,7 +1621,8 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
/* Now we can re-mount the cgroups controllers in the
* same configuration as before */
- if (lxcContainerMountCGroups(mounts, nmounts, sec_mount_options) < 0)
+ if (lxcContainerMountCGroups(mounts, nmounts,
+ cgroupRoot, sec_mount_options) < 0)
goto cleanup;
VIR_DEBUG("Mounting completed");
@@ -1607,6 +1631,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
cleanup:
lxcContainerCGroupFree(mounts, nmounts);
+ VIR_FREE(cgroupRoot);
return ret;
}
diff --git a/src/util/cgroup.h b/src/util/cgroup.h
index 68ac232..bb12b40 100644
--- a/src/util/cgroup.h
+++ b/src/util/cgroup.h
@@ -28,8 +28,6 @@
struct virCgroup;
typedef struct virCgroup *virCgroupPtr;
-# define VIR_CGROUP_SYSFS_MOUNT "/sys/fs/cgroup"
-
enum {
VIR_CGROUP_CONTROLLER_CPU,
VIR_CGROUP_CONTROLLER_CPUACCT,
--
1.7.11.2
12 years, 2 months
[libvirt] [PATCH] nwfilter: drop use of awk
by Eric Blake
Commit 2a41bc9 dropped a dependency on gawk, but we can go one step
further and avoid awk altogether.
* src/nwfilter/nwfilter_ebiptables_driver.c
(iptablesLinkIPTablesBaseChain): Simplify command.
(ebiptablesDriverInit, ebiptablesDriverShutdown): Drop awk probe.
---
Caveat - I was not set up to test this via actual nwfilter operations,
so it needs a thorough testing review.
src/nwfilter/nwfilter_ebiptables_driver.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index 034e6c4..8ffe737 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -84,7 +84,6 @@ static char *ebtables_cmd_path;
static char *iptables_cmd_path;
static char *ip6tables_cmd_path;
static char *grep_cmd_path;
-static char *awk_cmd_path;
#define PRINT_ROOT_CHAIN(buf, prefix, ifname) \
snprintf(buf, sizeof(buf), "libvirt-%c-%s", prefix, ifname)
@@ -565,12 +564,11 @@ static int iptablesLinkIPTablesBaseChain(virBufferPtr buf,
int stopOnError)
{
virBufferAsprintf(buf,
- "res=$($IPT -L %s -n --line-number | "
- "%s \" %s \")\n"
+ "res=$($IPT -L %s -n --line-number | %s '%s')\n"
"if [ $? -ne 0 ]; then\n"
" $IPT -I %s %d -j %s\n"
"else\n"
- " r=$(echo $res | %s '{print $1}')\n"
+ " set dummy $res; r=$2\n"
" if [ \"${r}\" != \"%d\" ]; then\n"
" " CMD_DEF("$IPT -I %s %d -j %s") CMD_SEPARATOR
" " CMD_EXEC
@@ -582,11 +580,9 @@ static int iptablesLinkIPTablesBaseChain(virBufferPtr buf,
" fi\n"
"fi\n",
- syschain,
- grep_cmd_path, udchain,
+ syschain, grep_cmd_path, udchain,
syschain, pos, udchain,
- awk_cmd_path,
pos,
@@ -4295,7 +4291,6 @@ ebiptablesDriverInit(bool privileged)
if (virMutexInit(&execCLIMutex) < 0)
return -EINVAL;
- awk_cmd_path = virFindFileInPath("awk");
grep_cmd_path = virFindFileInPath("grep");
/*
@@ -4311,7 +4306,7 @@ ebiptablesDriverInit(bool privileged)
/* ip(6)tables support needs awk & grep, ebtables doesn't */
if ((iptables_cmd_path != NULL || ip6tables_cmd_path != NULL) &&
- (!grep_cmd_path || !awk_cmd_path)) {
+ !grep_cmd_path) {
VIR_ERROR(_("essential tools to support ip(6)tables "
"firewalls could not be located"));
VIR_FREE(iptables_cmd_path);
@@ -4333,7 +4328,6 @@ ebiptablesDriverInit(bool privileged)
static void
ebiptablesDriverShutdown(void)
{
- VIR_FREE(awk_cmd_path);
VIR_FREE(grep_cmd_path);
VIR_FREE(ebtables_cmd_path);
VIR_FREE(iptables_cmd_path);
--
1.7.11.4
12 years, 2 months
[libvirt] [PATCH] Include some extra headers needed for OpenBSD.
by Jasper Lievisse Adriaanse
>From bafcb4ed2b90b5ba845ca6b61861e3caa548b16a Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <jasper(a)humppa.nl>
Date: Tue, 4 Sep 2012 16:57:09 +0200
Subject: [PATCH] Include some extra headers needed for OpenBSD.
---
src/util/virnetdevbridge.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 7b11bee..8559223 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -30,6 +30,15 @@
#include "intprops.h"
#include <sys/ioctl.h>
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif
--
1.7.6
--
Cheers,
Jasper
"Stay Hungry. Stay Foolish"
12 years, 2 months
[libvirt] [PATCH v4 00/10] Atomic API to list storage pools
by Osier Yang
Think the subject tells enough after 3 rounds, so ommits words here.
v3 - v4:
* Just rebase on the top:
- Version changes
- rebase after virsh split cleanups
1/10 ~ 2/10 are ACK'ed in v3, but for easy viewing, they are still
posted.
Osier Yang (10):
list: Define new API virStorageListAllStoragePools
list: Add helpers for listing storage pool objects
list: Implement the RPC calls for virConnectListAllStoragePools
list: Implement listAllStoragePools for storage driver
list: Implement listAllStoragePools for test driver
list: Add helper to convert strings separated by ', ' to array
virsh: Fix the wrong doc for pool-list
list: Change MATCH for common use in virsh
list: Use virConnectListAllStoragePools in virsh
python: Expose virStorageListAllStoragePools to python binding
daemon/remote.c | 54 +++
include/libvirt/libvirt.h.in | 33 ++
python/generator.py | 5 +-
python/libvirt-override-api.xml | 6 +
python/libvirt-override-virConnect.py | 12 +
python/libvirt-override.c | 47 +++
src/conf/storage_conf.c | 116 ++++++
src/conf/storage_conf.h | 35 ++
src/driver.h | 5 +
src/libvirt.c | 112 ++++++-
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 5 +
src/remote/remote_driver.c | 64 ++++
src/remote/remote_protocol.x | 13 +-
src/remote_protocol-structs | 12 +
src/storage/storage_driver.c | 18 +
src/test/test_driver.c | 17 +
tools/virsh-domain-monitor.c | 2 -
tools/virsh-domain.c | 19 +-
tools/virsh-pool.c | 631 ++++++++++++++++++++++++++++++++-
tools/virsh.c | 44 +++
tools/virsh.h | 3 +
tools/virsh.pod | 33 ++-
23 files changed, 1249 insertions(+), 38 deletions(-)
--
1.7.7.3
12 years, 2 months
[libvirt] need help/clarification about git and patches.
by Gene Czarcinski
Using git is more than a little different way of doing business for me.
My usual way to create and apply a patch is to rebuild a src.rpm. This
way I have a lot less changes of screwing something up because of ignorance.
It it a little while but I finally cloned a copy of libvirt.git. I
applied a patch to remove the "--filterwin2k" [one fixup because a test
file changed slightly. I then ran "git diff" and produce a new patch.
OK, now what? I did the "git commit" and then tried to do the "git
send-email" like it says in your "hacking" document ...
"git: 'send-email' is not a git command.
I am going to do what I believe is the right thing to do and submit the
patch but there needs to be a bit more info as to how we should do things.
Gene
12 years, 2 months
[libvirt] [libvirt-designer][PATCH 0/4] Yet another functional extension
by Michal Privoznik
This time aimed on virtxml tool to make it user friendlier a little bit.
Michal Privoznik (4):
Implement resources setting
Cleanup double error setting and operating on empty list
virtxml: Detect OS from given ISO
virtxml: Detect platform from libvirt connection URI
examples/virtxml.c | 200 ++++++++++++++++++++++++----
libvirt-designer/libvirt-designer-domain.c | 113 +++++++++++++++-
libvirt-designer/libvirt-designer-domain.h | 8 +
libvirt-designer/libvirt-designer.sym | 3 +-
4 files changed, 292 insertions(+), 32 deletions(-)
--
1.7.8.6
12 years, 2 months
[libvirt] [PATCH] Remove duplicate symbols and add test case
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When the event symbols were added to the public API, not all
of them were removed from the private exports list. Solaris
gets unhappy when there are duplicated symbols. Extend the
symfile check to test for this scenario
---
src/check-symfile.pl | 13 +++++++++----
src/libvirt_private.syms | 2 --
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/check-symfile.pl b/src/check-symfile.pl
index 454fed3..c0b7ec7 100755
--- a/src/check-symfile.pl
+++ b/src/check-symfile.pl
@@ -5,9 +5,11 @@ die "syntax: $0 SYMFILE ELFLIB(S)" unless int(@ARGV) >= 2;
my $symfile = shift @ARGV;
my @elflibs = @ARGV;
-my @wantsyms;
+my %wantsyms;
my %gotsyms;
+my $ret = 0;
+
open SYMFILE, $symfile or die "cannot read $symfile: $!";
while (<SYMFILE>) {
@@ -21,7 +23,12 @@ while (<SYMFILE>) {
die "malformed line $_" unless /^\s*(\S+);$/;
- push @wantsyms, $1;
+ if (exists $wantsyms{$1}) {
+ print STDERR "Symbol $1 is listed twice\n";
+ $ret = 1;
+ } else {
+ $wantsyms{$1} = 1;
+ }
}
close SYMFILE;
@@ -37,8 +44,6 @@ foreach my $elflib (@elflibs) {
close NM;
}
-my $ret = 0;
-
foreach my $sym (@wantsyms) {
next if exists $gotsyms{$sym};
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 65067d6..72d2095 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1177,8 +1177,6 @@ virDirCreate;
virDoubleToStr;
virEnumFromString;
virEnumToString;
-virEventAddHandle;
-virEventRemoveHandle;
virFileAbsPath;
virFileAccessibleAs;
virFileBuildPath;
--
1.7.11.2
12 years, 2 months