[libvirt] [test-API][PATCH] Fix problem in create netfs pool and logical volume
by Wayne Sun
create_netfs_pool:
In rhel7 the source nfs mount dir shows in /proc/mounts will end with a
'/' which in rhel6 and rhel5 didn't. So the check with exact match will
fail on rhel7. Change with '/*' will accept with both '/' exist or not.
create_logical_volume:
When grep lvcreate command in /etc/lvm/backup/logical_pool for create
logical volume, rhel6 and rhel7 command is slightly differnet with
rhel5, so make the change to fit for all version.
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
repos/storage/create_logical_volume.py | 6 +++---
repos/storage/create_netfs_pool.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/repos/storage/create_logical_volume.py b/repos/storage/create_logical_volume.py
index 098c148..9fd1305 100644
--- a/repos/storage/create_logical_volume.py
+++ b/repos/storage/create_logical_volume.py
@@ -54,9 +54,9 @@ def check_volume_create(poolobj, poolname, volname, size):
logger.debug("%s file path: %s" % (poolname, path))
if os.access(path, os.R_OK):
logger.debug("execute grep lvcreate %s command" % path)
- stat, ret = commands.getstatusoutput("grep \
-'lvcreate --name %s -L %sK /dev/%s' %s"\
- % (volname, size, poolname, path))
+ stat, ret = commands.getstatusoutput(
+ "grep 'lvcreate --name %s -L %sK .*%s' %s"
+ % (volname, size, poolname, path))
if stat == 0 and volname in poolobj.listVolumes():
logger.debug(ret)
return True
diff --git a/repos/storage/create_netfs_pool.py b/repos/storage/create_netfs_pool.py
index 9fb7b69..4603788 100644
--- a/repos/storage/create_netfs_pool.py
+++ b/repos/storage/create_netfs_pool.py
@@ -44,7 +44,7 @@ def check_pool_create_OS(conn, poolname, logger):
(src_host, src_path, dest_path) )
fd = open("/proc/mounts","r")
mount = src_host + ":" + src_path
- pat = mount + "\s+" + dest_path
+ pat = mount + "/*\s+" + dest_path
found = 0
for line in fd:
if re.match(pat, line):
--
1.7.1
12 years, 7 months
[libvirt] [PATCH] nwfilter: Don't try to acquire DBus context when DBus is disabled
by Peter Krempa
To silence error if DBus support is not compiled in.
---
src/nwfilter/nwfilter_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index ae09960..a30026e 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -168,7 +168,11 @@ static int
nwfilterDriverStartup(int privileged)
{
char *base = NULL;
- DBusConnection *sysbus = virDBusGetSystemBus();
+ DBusConnection *sysbus = NULL;
+
+#if HAVE_DBUS
+ sysbus = virDBusGetSystemBus();
+#endif /* HAVE_DBUS */
if (VIR_ALLOC(driverState) < 0)
goto alloc_err_exit;
--
1.7.12
12 years, 7 months
[libvirt] [PATCH] qemu: Set placement when setting numa parameters
by Osier Yang
To keep the internal data structure consistent.
---
src/qemu/qemu_driver.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d74bf52..955744a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7585,6 +7585,8 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
}
vm->def->numatune.memory.nodemask = nodeset;
+ vm->def->numatune.memory.placement_mode =
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_STATIC;
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
@@ -7601,11 +7603,16 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
}
persistentDef->numatune.memory.nodemask = nodeset;
+ persistentDef->numatune.memory.placement_mode =
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_STATIC;
}
}
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
+ if (!persistentDef->numatune.memory.placement_mode)
+ persistentDef->numatune.memory.placement_mode =
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO;
if (virDomainSaveConfig(driver->configDir, persistentDef) < 0)
ret = -1;
}
--
1.7.7.3
12 years, 7 months
[libvirt] [PATCH 0/3] Fix bugs in DAC security driver preventing guest start
by Peter Krempa
When using the DAC security driver with security_default_confined = 0
the daemon segfaulted. After fixing that problem guests could not be started
because the driver had a logic bug that used uninitialized values while
setting hypervisor uid and gid.
This is probably a regression and I would like to hear your opinion if it's
worth to push before the release tomorrow.
Peter Krempa (3):
util: Fix error message when getpwuid_r fails to find the user
security_dac: Avoid segfault when no label is requested
security_dac: Don't return uninitialised value when parsing seclabels
src/security/security_dac.c | 5 +++--
src/util/util.c | 22 ++++++++++++++++------
2 files changed, 19 insertions(+), 8 deletions(-)
--
1.7.12
12 years, 7 months
[libvirt] make rpm does not work
by Gautam Sampathkumar
Hi All,
I built libvirt on centos 6.2 and the configure and make steps went
through successfully. I did try a make rpm which fails with the error: cp:
cannot stat `./404.html': No such file or directory.
Doesnt looks like any RPMs were generated. I tried to manually create
404.html in the current dir, but that didn't help. Any help or guidance
would be much appreciated.
thanks
Gautam
12 years, 7 months
[libvirt] libvirt-java, libvirt-client on Centos 6.2
by Gautam Sampathkumar
Hi All,
I've been trying to upgrade our version of libvirt-java to 0.4.8
since we're now running libvirt 0.10.0 and are running into the following
dependency problems on our Centos 6.2 machine.
libvirt-java requires libvirt-client > 0.9.12
1. The libvirt-client RPMs all appear to be targeted to Fedora Core system
and I'm not certain I should be trying to install these RPMs on my CentOS
box. However, I'm unable to find a source tarball so I can build
libvirt-client from source.
2. I did try to install the FC RPM
libvirt-client-0.10.0-0rc0.fc16.x86_64.rpm and this fails with the error
libc.so.6(GLIBC_2.14)(64bit) is needed by
libvirt-client-0.10.0-0rc0.fc16.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by
libvirt-client-0.10.0-0rc0.fc16.x86_64
glib 2.12 is the latest version available via YUM for all CentOS 6.x
distributions, so I attempted to build and install glibc 2.15 from source.
I can confirm that we now have /usr/lib64/libc.so.6 installed. However,
attempting to install libvirt-client still fails with the same error.
3. Not sure why libvirt-java depends on libvirt-client
Any guidance or pointers would be much appreciated.
thanks,
Gautam
12 years, 7 months
[libvirt] [PATCH] conf: Fix the problem which cause libvirtd to crash
by Osier Yang
* src/conf/domain_conf.c: Use STREQ_NULLABLE instead of STREQ,
as def->seclables[i]->model could be NULL.
---
I guess this doesn't fix the root cause (perhaps on XML parsing),
but this fix is sufficient anyway.
---
src/conf/domain_conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c02d6f8..224aec5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14995,7 +14995,7 @@ virDomainDiskDefGetSecurityLabelDef(virDomainDiskDefPtr def, const char *model)
return NULL;
for (i = 0; i < def->nseclabels; i++) {
- if (STREQ(def->seclabels[i]->model, model))
+ if (STREQ_NULLABLE(def->seclabels[i]->model, model))
return def->seclabels[i];
}
return NULL;
--
1.7.7.3
12 years, 7 months
[libvirt] [PATCH] build: define 'inline' iff HAVE_LIBNL1
by Michal Privoznik
Previous commit 0b4b53bb80 defined 'inline' to prevent broken build on
systems with libnl1 headers. However, it broke build on systems with
libnl3 headers. Therefore we must make that fix conditional.
---
Pushed under build breaker rule.
src/util/virnetlink.h | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index 82154de..b1a1750 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -28,9 +28,13 @@
/* Work around a bug where older libnl-1 headers expected older gcc
* semantics of 'extern inline' that conflict with C99 semantics. */
-# define inline
+# ifdef HAVE_LIBNL1
+# define inline
+# endif
# include <netlink/msg.h>
-# undef inline
+# ifdef HAVE_LIBNL1
+# undef inline
+# endif
# else
--
1.7.8.6
12 years, 7 months
[libvirt] [PATCH] Don't require gawk for a simple print expression
by Guido Günther
Fedora uses gawk as awk so there's no change and in behavior while
Debian/Ubuntu use mawk by default.
This was reported by Luca Capello in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636712
---
src/nwfilter/nwfilter_ebiptables_driver.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index 11fd04c..ad1d055 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -84,7 +84,7 @@ static char *ebtables_cmd_path;
static char *iptables_cmd_path;
static char *ip6tables_cmd_path;
static char *grep_cmd_path;
-static char *gawk_cmd_path;
+static char *awk_cmd_path;
#define PRINT_ROOT_CHAIN(buf, prefix, ifname) \
snprintf(buf, sizeof(buf), "libvirt-%c-%s", prefix, ifname)
@@ -586,7 +586,7 @@ static int iptablesLinkIPTablesBaseChain(virBufferPtr buf,
grep_cmd_path, udchain,
syschain, pos, udchain,
- gawk_cmd_path,
+ awk_cmd_path,
pos,
@@ -4288,7 +4288,7 @@ ebiptablesDriverInit(bool privileged)
if (virMutexInit(&execCLIMutex) < 0)
return -EINVAL;
- gawk_cmd_path = virFindFileInPath("gawk");
+ awk_cmd_path = virFindFileInPath("awk");
grep_cmd_path = virFindFileInPath("grep");
/*
@@ -4302,9 +4302,9 @@ ebiptablesDriverInit(bool privileged)
/* make sure tools are available and work */
ebiptablesDriverTestCLITools();
- /* ip(6)tables support needs gawk & grep, ebtables doesn't */
+ /* ip(6)tables support needs awk & grep, ebtables doesn't */
if ((iptables_cmd_path != NULL || ip6tables_cmd_path != NULL) &&
- (!grep_cmd_path || !gawk_cmd_path)) {
+ (!grep_cmd_path || !awk_cmd_path)) {
VIR_ERROR(_("essential tools to support ip(6)tables "
"firewalls could not be located"));
VIR_FREE(iptables_cmd_path);
@@ -4326,7 +4326,7 @@ ebiptablesDriverInit(bool privileged)
static void
ebiptablesDriverShutdown(void)
{
- VIR_FREE(gawk_cmd_path);
+ VIR_FREE(awk_cmd_path);
VIR_FREE(grep_cmd_path);
VIR_FREE(ebtables_cmd_path);
VIR_FREE(iptables_cmd_path);
--
1.7.10.4
12 years, 7 months