[libvirt] [PATCH] tests: Fix virnetdaemontest to be skipped in non-yajl environment
by Prerna
When libvirt is compiled without yajl-devel, virnetdaemontest fails.
This causes 'make check' to fail with nondescript errors, such as following:
[snip]...............................
PASS: read-bufsiz
PASS: read-non-seekable
PASS: start
TEST: virsh-uriprecedence
.... 4 OK
PASS: virsh-uriprecedence
PASS: vcpupin
/home/prerna/trees/libvirt/tests/virsh-all: skipping test:
This test is very expensive, so it is disabled by default.
To run it anyway, rerun: make check VIR_TEST_EXPENSIVE=1
SKIP: virsh-all
PASS: virsh-optparse
PASS: virsh-schedinfo
PASS: virsh-synopsis
PASS: virsh-undefine
=======================================
1 of 108 tests failed
(7 tests were not run)
Please report to libvir-list(a)redhat.com
=======================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/home/prerna/build/libvirt/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/prerna/build/libvirt/tests'
make: *** [check-recursive] Error 1
.....................................
This patch skips virnetdaemontest in absence of yajl-devel, so that
make check gracefully runs to completion.
Signed-off-by: Prerna Saxena <saxenap.ltc(a)gmail.com>
---
tests/virnetdaemontest.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 24cbd54..17d1f7f 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -290,6 +290,11 @@ mymain(void)
{
int ret = 0;
+#if !WITH_YAJL
+ fputs("libvirt not compiled with yajl, skipping this test\n", stderr);
+ return EXIT_AM_SKIP;
+#endif
+
if (virInitialize() < 0 ||
virEventRegisterDefaultImpl() < 0) {
virDispatchError(NULL);
--
1.7.1
9 years, 6 months
[libvirt] [PATCH 0/4] qemu: hostdev: Unify naming
by Andrea Bolognani
I was working on the QEMU hostdev code and the inconsistent
naming used kept making things just that little harder for
me to follow, so I unified it.
Cheers.
Andrea Bolognani (4):
qemu: hostdev: Unify naming for qemuPrepareHost*Devices()
qemu: hostdev: Unify naming for qemuDomainReAttachHost*Devices()
qemu: hostdev: Unify naming for qemuUpdateActiveHost*Devices()
qemu: hostdev: Introduce qemuUpdateActiveHostDevices()
src/qemu/qemu_hostdev.c | 74 ++++++++++++++++++++++++++++++-------------------
src/qemu/qemu_hostdev.h | 36 ++++++++++++------------
src/qemu/qemu_hotplug.c | 13 ++++-----
src/qemu/qemu_process.c | 8 +-----
4 files changed, 72 insertions(+), 59 deletions(-)
--
2.4.3
9 years, 6 months
[libvirt] [PATCH v2 0/2] tests: Add nodeinfo test data utility scripts
by Andrea Bolognani
Changes from v1:
* use a better approach to copy host data (thanks Martin)
* acknowledge the fact that the scripts require bash
* other small cleanups and improvements
Andrea Bolognani (2):
tests: Add script to display nodeinfo test data
tests: Add script to copy nodeinfo test data from host
tests/nodeinfodata/copy-from-host.sh | 113 +++++++++++++++++++++++++++++++++++
tests/nodeinfodata/display.sh | 113 +++++++++++++++++++++++++++++++++++
2 files changed, 226 insertions(+)
create mode 100755 tests/nodeinfodata/copy-from-host.sh
create mode 100755 tests/nodeinfodata/display.sh
--
2.4.3
9 years, 6 months
[libvirt] outreachy 2015
by mesode akwe
hello!
i am mesode from cameroon and am interested in participating in the
libvirt-designer enhancement project.
where do i go from here?
thanks.
9 years, 6 months
[libvirt] [RFC] Simplifying usage of {Enter, Exit}Monitor and {Begin/End}Job
by Jiri Denemark
Hi all.
Looking at the qemu driver code, we have a lot of code with the
following pattern:
if (doSomething() < 0)
goto cleanup;
if (qemuDomainObjBeginJob() < 0)
goto cleanup;
if (doSomethingElse() < 0)
goto endjob;
qemuDomainObjEnterMonitor();
if (qemuMonitorSomething() < 0) {
qemuDomainObjExitMonitor();
goto endjob;
}
if (qemuMonitorSomethingElse() < 0) {
qemuDomainObjExitMonitor();
goto endjob;
}
if (qemuDomainObjExitMonitor() < 0)
goto endjob;
...
ret = 0;
endjob:
qemuDomainObjEndJob();
cleanup:
...
return ret;
Sometimes qemuDomainObjExitMonitor is in its own label instead of being
explicitly called on every single error path. Sometimes
qemuDomainObjEndJob is called explicitly followed by goto cleanup. In
either case, it's pretty easy to get this wrong. It's too easy to jump
to a wrong label (especially when moving code around) or forget to call
the appropriate exit function before jumping to a label.
So what if we make the code more robust by changing who needs to track
whether we are in a monitor or have a job. Now it's the caller that
tracks it while I think we could teach the job/monitor APIs themselves
to track the state:
bool inJob = false;
bool inMonitor = false;
if (doSomething() < 0)
goto cleanup;
if (qemuDomainObjBeginJob(..., &inJob) < 0)
goto cleanup;
if (doSomethingElse() < 0)
goto cleanup;
qemuDomainObjEnterMonitor(..., &inMonitor);
if (qemuMonitorSomething() < 0)
goto cleanup;
if (qemuMonitorSomethingElse() < 0)
goto cleanup;
if (qemuDomainObjExitMonitor(..., &inMonitor) < 0)
goto cleanup;
...
ret = 0;
cleanup:
if (qemuDomainObjExitMonitor(..., &inMonitor) < 0)
ret = -1;
qemuDomainObjEndJob(..., &inJob);
...
return ret;
It's not a lot shorter or longer but it saves us from jumping to
different labels and it makes sure we always exit the monitor and end
the job.
So is it worth the effort or do you thing it's even worse than before or
do you have any other ideas?
Thanks,
Jirka
9 years, 6 months
[libvirt] [PATCHv2] virsh: fix no error when pass a count <= 0 to setvcpus
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1248277
When count <= 0, the client exit without set an error.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
v2:
- use vshCommandOptUInt to forbid negative number,
and check if count is zero. (thanks Peter and Andrea)
tools/virsh-domain.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4191548..3f032f4 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6873,7 +6873,7 @@ static bool
cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- int count = 0;
+ unsigned int count = 0;
bool ret = false;
bool maximum = vshCommandOptBool(cmd, "maximum");
bool config = vshCommandOptBool(cmd, "config");
@@ -6900,9 +6900,14 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptInt(ctl, cmd, "count", &count) < 0 || count <= 0)
+ if (vshCommandOptUInt(ctl, cmd, "count", &count) < 0)
goto cleanup;
+ if (count == 0) {
+ vshError(ctl, _("Can't set 0 processors for a VM"));
+ goto cleanup;
+ }
+
/* none of the options were specified */
if (!current && flags == 0) {
if (virDomainSetVcpus(dom, count) != 0)
--
1.8.3.1
9 years, 6 months
[libvirt] [PATCH] tests: Remove unused nodeinfo test data
by Andrea Bolognani
A bunch of files that we don't currently parse, and are very
unlikely to ever start parsing, made their way into the nodeinfo
test data. Get rid of them.
---
tests/nodeinfodata/linux-f21-mustang/cpu/modalias | 1 -
tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver | 1 -
tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro | 1 -
tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias | 1 -
tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver | 1 -
tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro | 1 -
tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings | 1 -
tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings | 1 -
8 files changed, 8 deletions(-)
delete mode 100644 tests/nodeinfodata/linux-f21-mustang/cpu/modalias
delete mode 100644 tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver
delete mode 100644 tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro
delete mode 100644 tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias
delete mode 100644 tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
delete mode 100644 tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
delete mode 100644 tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
delete mode 100644 tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
diff --git a/tests/nodeinfodata/linux-f21-mustang/cpu/modalias b/tests/nodeinfodata/linux-f21-mustang/cpu/modalias
deleted file mode 100644
index 18bb0b6..0000000
--- a/tests/nodeinfodata/linux-f21-mustang/cpu/modalias
+++ /dev/null
@@ -1 +0,0 @@
-cpu:type:aarch64:feature:,0000,0001,0002
diff --git a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver b/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver
deleted file mode 100644
index 621e94f..0000000
--- a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver
+++ /dev/null
@@ -1 +0,0 @@
-none
diff --git a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro b/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro
deleted file mode 100644
index c35a724..0000000
--- a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro
+++ /dev/null
@@ -1 +0,0 @@
-menu
diff --git a/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias b/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias
deleted file mode 100644
index 18bb0b6..0000000
--- a/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias
+++ /dev/null
@@ -1 +0,0 @@
-cpu:type:aarch64:feature:,0000,0001,0002
diff --git a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver b/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
deleted file mode 100644
index 57d5dd3..0000000
--- a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
+++ /dev/null
@@ -1 +0,0 @@
-acpi_idle
diff --git a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro b/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
deleted file mode 100644
index c35a724..0000000
--- a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
+++ /dev/null
@@ -1 +0,0 @@
-menu
diff --git a/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings b/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
deleted file mode 100644
index 573541a..0000000
--- a/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings b/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
deleted file mode 100644
index 573541a..0000000
--- a/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
+++ /dev/null
@@ -1 +0,0 @@
-0
--
2.4.3
9 years, 6 months
[libvirt] [PATCH] conf: Fix error message to use correct parameter
by John Ferlan
Fix a cut-n-paste error from commit id '35eecdde' where the previous
check for max_sectors seems to have been copied, but the error message
parameter not updated to be ioeventfd
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
pushing as trivial
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 02cc8ad..0c559d2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7985,7 +7985,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
if (ioeventfd &&
(def->ioeventfd = virTristateSwitchTypeFromString(ioeventfd)) < 0) {
virReportError(VIR_ERR_XML_ERROR,
- _("Malformed 'ioeventfd' value %s'"), max_sectors);
+ _("Malformed 'ioeventfd' value %s'"), ioeventfd);
goto error;
}
--
2.1.0
9 years, 6 months
[libvirt] gem install ruby-libvirt fails on FreeBSD 10.2
by Rickard von Essen
Hi,
Installing the ruby-libvirt gem fails on FreeBSD 10.2 since it can't locate
the lib and include dir. Installing with:
gem install ruby-libvirt --
--with-libvirt-include=/usr/local/include/libvirt
--with-libvirt-lib=/usr/local/lib/libvirt.so
works fine.
It would be great if this worked out of the box, e.g. detects that it is
building on BSD and applies the above settings as default, or at least it
could be provided as a hint if running make fails to guide ruby noobs, like
me.
Regards,
Rickard von Essen
9 years, 6 months