[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, 2 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, 2 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, 2 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, 2 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, 2 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, 2 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, 2 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, 2 months
[libvirt] [test-API][PATCH v2] utils: Update remote_exec_pexpect function and sync cases
by Wayne Sun
After delete duplicate remote_exec_pexect function, the left function
with same name causes some problem with cases, so update the function
and sync all cases using it.
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
repos/domain/cpu_topology.py | 2 +-
repos/snapshot/file_flag.py | 8 ++++----
repos/snapshot/flag_check.py | 12 ++++++------
utils/utils.py | 28 ++++++++++++++--------------
4 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/repos/domain/cpu_topology.py b/repos/domain/cpu_topology.py
index 5f4ef52..cb071c9 100644
--- a/repos/domain/cpu_topology.py
+++ b/repos/domain/cpu_topology.py
@@ -136,7 +136,7 @@ def cpu_topology_chk(ip, username, password,
int = 0
actual_thread = actual_core = actual_socket = ''
- for item in output.strip().split('\r'):
+ for item in output.split('\r'):
if int == 5:
actual_thread = item.split()[-1]
logger.info("the actual thread in the guest is %s" % actual_thread)
diff --git a/repos/snapshot/file_flag.py b/repos/snapshot/file_flag.py
index e18975e..001f13c 100644
--- a/repos/snapshot/file_flag.py
+++ b/repos/snapshot/file_flag.py
@@ -34,12 +34,12 @@ def check_domain_running(conn, guestname, logger):
def make_flag(ipaddr, username, password, logger):
""" enter guest OS, create a file in /tmp folder """
- ret = utils.remote_exec_pexpect(ipaddr, username, password, MAKE_FLAG)
- if ret == "TIMEOUT!!!":
+ ret, out = utils.remote_exec_pexpect(ipaddr, username, password, MAKE_FLAG)
+ if ret:
logger.error("connecting to guest OS timeout")
return False
- elif ret != '':
- logger.error("failed to make flag in guest OS, %s" % ret)
+ elif out != '':
+ logger.error("failed to make flag in guest OS, %s" % out)
return False
else:
logger.info("flag %s is created in /tmp folder" % FLAG_FILE)
diff --git a/repos/snapshot/flag_check.py b/repos/snapshot/flag_check.py
index 41314d8..f0ddecf 100644
--- a/repos/snapshot/flag_check.py
+++ b/repos/snapshot/flag_check.py
@@ -68,20 +68,20 @@ def flag_check(params):
logger.info("vm %s failed to get ip address" % guestname)
return 1
- ret = utils.remote_exec_pexpect(ipaddr, username, password, FLAG_CHECK)
- if ret == "TIMEOUT!!!":
+ ret, out = utils.remote_exec_pexpect(ipaddr, username, password, FLAG_CHECK)
+ if ret:
logger.error("connecting to guest OS timeout")
return 1
- elif ret == FLAG_FILE and expected_result == "exist":
+ elif out == FLAG_FILE and expected_result == "exist":
logger.info("checking flag %s in guest OS succeeded" % FLAG_FILE)
return 0
- elif ret == FLAG_FILE and expected_result == 'noexist':
+ elif out == FLAG_FILE and expected_result == 'noexist':
logger.error("flag %s still exist, FAILED." % FLAG_FILE)
return 1
- elif ret != None and expected_result == "exist":
+ elif out != None and expected_result == "exist":
logger.error("no flag %s exists in the guest %s " % (FLAG_FILE,guestname))
return 1
- elif ret != None and expected_result == 'noexist':
+ elif out != None and expected_result == 'noexist':
logger.info("flag %s is not present, checking succeeded" % FLAG_FILE)
return 0
diff --git a/utils/utils.py b/utils/utils.py
index 27ddbc2..e242847 100644
--- a/utils/utils.py
+++ b/utils/utils.py
@@ -427,10 +427,10 @@ def remote_exec_pexpect(hostname, username, password, cmd):
child.sendline(password)
elif index == 2:
child.close()
- return 0, child.before
+ return 0, string.strip(child.before)
elif index == 3:
child.close()
- return 1, ""
+ return 1, "Timeout!!!!"
return 0
@@ -531,8 +531,8 @@ def get_remote_memory(hostname, username, password):
i = 0
while i < 3:
i += 1
- memsize = \
- int(remote_exec_pexpect(hostname, username, password, cmd)) * 1024
+ ret, out = remote_exec_pexpect(hostname, username, password, cmd)
+ memsize = int(out) * 1024
if memsize == -1:
continue
else:
@@ -595,10 +595,10 @@ def libvirt_version(latest_ver = ''):
def create_dir(hostname, username, password):
"""Create new dir"""
cmd = "mkdir /tmp/test"
- mkdir_ret = remote_exec_pexpect(hostname, username, password, cmd)
+ ret, mkdir_ret = remote_exec_pexpect(hostname, username, password, cmd)
if mkdir_ret == '':
cmd = "ls -d /tmp/test"
- check_str = remote_exec_pexpect(hostname, username,
+ ret, check_str = remote_exec_pexpect(hostname, username,
password, cmd)
if check_str == "/tmp/test":
return 0
@@ -613,11 +613,11 @@ def write_file(hostname, username, password):
"""Simple test for writting file on specified host"""
test_string = 'hello word testing'
cmd = """echo '%s'>/tmp/test/test.log""" % (test_string)
- write_file_ret = remote_exec_pexpect(hostname, username,
+ ret, write_file_ret = remote_exec_pexpect(hostname, username,
password, cmd)
if write_file_ret == '':
cmd = """grep '%s' /tmp/test/test.log""" % ("hello")
- check_str = remote_exec_pexpect(hostname, username,
+ ret, check_str = remote_exec_pexpect(hostname, username,
password, cmd)
if check_str == test_string:
return 0
@@ -649,10 +649,10 @@ def run_wget_app(hostname, username, password, file_url, logger):
"""Simple test for wget app on specified host"""
cmd_line = "wget -P /tmp %s -o /tmp/wget.log" % (file_url)
logger.info("Command: %s" % (cmd_line))
- wget_ret = remote_exec_pexpect(hostname, username,
+ ret, wget_ret = remote_exec_pexpect(hostname, username,
password, cmd_line)
cmd_line = "grep %s %s" % ('100%', '/tmp/wget.log')
- check_ret = remote_exec_pexpect(hostname, username,
+ ret, check_ret = remote_exec_pexpect(hostname, username,
password, cmd_line)
if check_ret == "":
logger.info("grep output is nothing")
@@ -683,9 +683,9 @@ def validate_remote_nic_type(hostname, username,
logger.info("nic_driver = %s" % (nic_driver))
lspci_cmd = "lspci"
lsmod_cmd = "lsmod"
- lspci_cmd_ret = remote_exec_pexpect(hostname, username,
+ ret, lspci_cmd_ret = remote_exec_pexpect(hostname, username,
password, lspci_cmd)
- lsmod_cmd_ret = remote_exec_pexpect(hostname, username,
+ ret, lsmod_cmd_ret = remote_exec_pexpect(hostname, username,
password, lsmod_cmd)
logger.info("------------")
logger.info("lspci_cmd_ret:\n %s" % (lspci_cmd_ret))
@@ -743,9 +743,9 @@ def validate_remote_blk_type(hostname, username, password,
blk_type_to_driver_dict = {'ide':'unknow', 'virtio':'virtio_blk'}
lspci_cmd = "lspci"
lsmod_cmd = "lsmod"
- lspci_cmd_ret = remote_exec_pexpect(hostname, username,
+ ret, lspci_cmd_ret = remote_exec_pexpect(hostname, username,
password, lspci_cmd)
- lsmod_cmd_ret = remote_exec_pexpect(hostname, username,
+ ret, lsmod_cmd_ret = remote_exec_pexpect(hostname, username,
password, lsmod_cmd)
logger.info("------------")
logger.info("lspci_cmd_ret:\n %s" % (lspci_cmd_ret))
--
1.7.1
12 years, 2 months