[libvirt] [PATCH v2 0/3] improve virsh attach-interface
by Pavel Hrdina
new in v2:
- removed netdev name as an option for --source parameter
- removed --driver parameter, the default is vfio for new qemu and that's good
enough
Pavel Hrdina (3):
virsh-nodedev: makes struct and functions for NodeDevice list
available
virsh-domain: update attach-interface to support type=hostdev
virsh.pod: update and improve a attach-interface section
tools/virsh-domain.c | 34 +++++++++++++++++++--
tools/virsh-nodedev.c | 16 ++++------
tools/virsh-nodedev.h | 11 +++++++
tools/virsh.pod | 82 +++++++++++++++++++++++++++++++--------------------
4 files changed, 98 insertions(+), 45 deletions(-)
--
2.6.2
9 years, 1 month
[libvirt] qemu-agent-command via isa-serial for freebsd
by Vasiliy Tolstov
Hi! I'm need to control freebsd guest via qemu-ga, as i see qemu-ga
already supports isa-serial connection.
How i need to configure domain via libvirt to able virsh
qemu-agent-command to this guest vm?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
9 years, 1 month
[libvirt] [PATCH] util: set error if DAD is not finished
by Luyao Huang
If DAD not finished in 5 seconds, user will get an
unknown error like this:
# virsh net-start ipv6
error: Failed to start network ipv6
error: An error occurred, but the cause is unknown
Call virReportError to set an error.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
I found the DAD will take 7 seconds
on my machine, and i cannot create a network which
use ipv6 now :( . Can we offer a way allow user to change this
timeout ? maybe add a configuration file option in
libvirtd.conf.
src/util/virnetdev.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 9789e93..c8861e9 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1398,7 +1398,13 @@ virNetDevWaitDadFinish(virSocketAddrPtr *addrs, size_t count)
VIR_FREE(resp);
}
/* Check timeout. */
- ret = dad ? -1 : 0;
+ if (dad) {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Duplicate Address Detection "
+ "not finished in %d seconds"), VIR_DAD_WAIT_TIMEOUT);
+ } else {
+ ret = 0;
+ }
cleanup:
VIR_FREE(resp);
--
1.8.3.1
9 years, 1 month
[libvirt] Again cgroups and isolcpus
by Henning Schild
Hi folks,
i already started a discussion on the interaction of cgroups and
isolcpus a while ago. But now i believe i have got a better
understanding of how the two interact and i can describe problems that
arise from that.
The scenario: A machine that runs realtime tasks on pcpus reserved with
isolcpus. It also runs VMs with the help of libvirt. It might also run
realtime VMs with the help of libvirt.
Moving a task into a new cgroup/cpuset and some modifications of the
cpus in that set imply a setaffinity by the kernel. That affinity
setting will ignore isolcpus. The result is possible "interference by"
or "starvation of" these tasks.
Now let me describe one scenario where that implicit setaffinity
becomes a problem for our realtime system.
libvirt creates a superset called the machine.slice and subsets called
emulator and vpuX. By default the machine.slice inherits from the root
which contains all pcpus, also the isolated ones. Now moving a task
into that superset will place that task on isolcpus where it might
interfere or simply starve.
Turns out that a fresh qemu actually is put into that superset. That is
a bug that should be fixed but let me address that one in another mail.
My current point of view is that we need a strong mechanism to isolate
cpus. isolcpus just is not good enough. The measure of choice probably
is cpusets as well, and this time with the exclusive flag turned on.
That will stop every other cpuset user from messing around with
those cpus by accident.
I am thinking of one or more cpusets where isolated cpus are
parked and not used within this cgroup. Anyone wanting to use one of
them will have to take it out there and explictily put it into their a
new set. Now if libvirt makes the mistake to have tasks running in
supersets these tasks will spread to the newly added rt-cpu. Or new
tasks that run in supersets will end up on rt-cpus already in use. But
at least we have containment in libvirt and the VMs it spawned.
For alloc and free of rt-cpus i am planning to use libvirt hooks to
begin with, from what i read they should enable me to do what i need.
What do you guys think about the general idea to address the described
problem?
I will implement a prototype of the alloc-free of rt-cpus. My current
hope is that libvirt hooks can be abused for that.
I am thinking that at some point libvirt should be able to do that
without hooks. It should get a notion of reserved ressources that are
currently parked in other cgroups. My current suspicion is that the
cpusets might just be the tip of the iceberg. -- for now i am running
libvirt without cgroups to keep my isolcpus free
cgroups/cpusets offer a switch to make a cpu exclusive to a set. That
switch is great because it will act as an assert, a second line of
defense. Having seen how cpusets and migration mess around with
affinities i guess for realtime people have to insist on that second
line of defense. Especially in times where cgroups are all over the
place.
In openstack one would actually say that a pcpu should be "dedicated".
That will result in a vcpupin on exactly one pcpu. Unfortunately one
meaning of "dedicated" gets lost in translation. It could otherwise be
used by libvirtd to set cpuset.cpu_exclusive in the vcpu-cgroup.
And i am bringing that up here because i do not think libvirt allows
me to influence the cpu_exclusive flag for my vcpu cgroups.
Henning
9 years, 1 month
[libvirt] [PATCH] wireshark: Install to generic plugin directory
by Michal Privoznik
There has been a report on the list [1] that we are not
installing the wireshark dissector into the correct plugin
directory. And in fact we are not. The problem is, the plugin
directory path is constructed at compile time. However, it's
dependent on the wireshark version, e.g.
/usr/lib/wireshark/1.12.6/plugins/
This is rather unfortunate, because if libvirt RPMs were built
with one version, but installed on a system with newer one, the
plugins are not really loaded. This problem lead fedora packagers
to unify plugin path to:
/usr/lib/wireshark/plugins/
Cool! But this was enabled just in wireshark-1.12.6-4. Therefore,
we must require at least that version.
And while at it, on some distributions, the wireshark.pc file
already has a variable that defines where plugin dir is. Use that
if possible.
1: https://www.redhat.com/archives/libvirt-users/2015-October/msg00063.html
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
libvirt.spec.in | 6 ++++--
m4/virt-wireshark.m4 | 7 ++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 9dff994..469bfca 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1170,7 +1170,7 @@ virtualization capabilities of recent versions of Linux (and other OSes).
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
Group: Development/Libraries
-Requires: wireshark
+Requires: wireshark >= 1.12.6-4
Requires: %{name}-client = %{version}-%{release}
%description wireshark
@@ -1561,6 +1561,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
%endif
%if %{with_wireshark}
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.la
+mv $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.so \
+ $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.so
%endif
# Temporarily get rid of not-installed libvirt-admin.so
@@ -2279,7 +2281,7 @@ exit 0
%if %{with_wireshark}
%files wireshark
-%{_libdir}/wireshark/plugins/*/libvirt.so
+%{_libdir}/wireshark/plugins/libvirt.so
%endif
%if %{with_lxc}
diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4
index 47204ed..199317e 100644
--- a/m4/virt-wireshark.m4
+++ b/m4/virt-wireshark.m4
@@ -28,7 +28,12 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
dnl Check for system location of wireshark plugins
if test "x$with_wireshark_dissector" != "xno" ; then
if test "x$with_ws_plugindir" = "xcheck" ; then
- ws_plugindir="$libdir/wireshark/plugins/$($PKG_CONFIG --modversion wireshark)"
+ ws_plugindir="$($PKG_CONFIG --variable plugindir wireshark)"
+ if test "x$ws_plugindir" = "x" ; then
+ dnl On some systems the plugindir variable may not be stored within pkg config.
+ dnl Fall back to older style of constructing the plugin dir path.
+ ws_plugindir="$libdir/wireshark/plugins/$($PKG_CONFIG --modversion wireshark)"
+ fi
elif test "x$with_ws_plugindir" = "xno" || test "x$with_ws_plugindir" = "xyes"; then
AC_MSG_ERROR([ws-plugindir must be used only with valid path])
else
--
2.4.10
9 years, 1 month
[libvirt] virsh can't support VM offline blockcommit
by justlibvirt@gmail.com
Hi everyone!
I use the libvirt(version: 1.2.2) and QEMU(version: 2.2.1) to test qemu snapshot features:
I tried virsh blockcommit when VM offline, the virsh blockcommit failed: the error messase as below:
error: Requested operation is not valid: domain is not running
when I start the VM, the virsh blockcommit work fine!
my question is:we need virsh support blockcommit when VM offline。how do?
we test qemu snapshot as follows:
we need create snapshot of the cycle,and by virsh blockcommit merge snapshot chain,but when VM offline, the virsh blockcommit will fail, someone suggest me:when VM offline,may use qemu-img commit to submit snapshot turn,but qemu-img can't modify snapshot chain backing relation,it need we use qemu-img rebase amend snapshot‘s backingfile, the main question is when we use qemu-img rebase modify snapshot's backingfile, if someone start the VM, it will may lead to VM filesystem readonly。
we should how to solve the question? thanks!
justlibvirt(a)gmail.com
9 years, 1 month
[libvirt] [PATCH] Remove new lines from debug messages
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/nwfilter/nwfilter_gentech_driver.c | 2 +-
src/nwfilter/nwfilter_learnipaddr.c | 10 +++++-----
src/rpc/virnetsocket.c | 2 +-
src/util/virfile.c | 2 +-
src/util/virhash.c | 2 +-
src/util/virnetdevmacvlan.c | 28 +++++++++++++-------------
src/util/virprocess.c | 2 +-
src/xen/xend_internal.c | 2 +-
tests/virhostdevtest.c | 36 +++++++++++++++++-----------------
tests/virnetsockettest.c | 2 +-
tests/virtimetest.c | 2 +-
11 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index 701f8d8..5a4cff1 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -540,7 +540,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
if (rc)
break;
} else if (inc) {
- VIR_DEBUG("Following filter %s\n", inc->filterref);
+ VIR_DEBUG("Following filter %s", inc->filterref);
obj = virNWFilterObjFindByName(&driver->nwfilters, inc->filterref);
if (obj) {
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 5b55055..1adbadb 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -413,7 +413,7 @@ learnIPAddressThread(void *arg)
handle = pcap_open_live(listen_if, BUFSIZ, 0, PKT_TIMEOUT_MS, errbuf);
if (handle == NULL) {
- VIR_DEBUG("Couldn't open device %s: %s\n", listen_if, errbuf);
+ VIR_DEBUG("Couldn't open device %s: %s", listen_if, errbuf);
req->status = ENODEV;
goto done;
}
@@ -448,13 +448,13 @@ learnIPAddressThread(void *arg)
filter = virBufferContentAndReset(&buf);
if (pcap_compile(handle, &fp, filter, 1, 0) != 0) {
- VIR_DEBUG("Couldn't compile filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't compile filter '%s'", filter);
req->status = EINVAL;
goto done;
}
if (pcap_setfilter(handle, &fp) != 0) {
- VIR_DEBUG("Couldn't set filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't set filter '%s'", filter);
req->status = EINVAL;
pcap_freecode(&fp);
goto done;
@@ -626,7 +626,7 @@ learnIPAddressThread(void *arg)
req->filtername,
req->filterparams);
VIR_DEBUG("Result from applying firewall rules on "
- "%s with IP addr %s : %d\n", req->ifname, inetaddr, ret);
+ "%s with IP addr %s : %d", req->ifname, inetaddr, ret);
}
} else {
if (showError)
@@ -638,7 +638,7 @@ learnIPAddressThread(void *arg)
techdriver->applyDropAllRules(req->ifname);
}
- VIR_DEBUG("pcap thread terminating for interface %s\n", req->ifname);
+ VIR_DEBUG("pcap thread terminating for interface %s", req->ifname);
virNWFilterUnlockIface(req->ifname);
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 5e5f1ab..526d291 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -196,7 +196,7 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
freeaddrinfo(ai);
- VIR_DEBUG("Protocols: v4 %d v6 %d\n", *hasIPv4, *hasIPv6);
+ VIR_DEBUG("Protocols: v4 %d v6 %d", *hasIPv4, *hasIPv6);
ret = 0;
cleanup:
diff --git a/src/util/virfile.c b/src/util/virfile.c
index e5cf2c5..f45e18f 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -681,7 +681,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0)
return -1;
- VIR_DEBUG("Return from loop-control got fd %d\n", loop_fd);
+ VIR_DEBUG("Return from loop-control got fd %d", loop_fd);
if (loop_fd >= 0)
return loop_fd;
diff --git a/src/util/virhash.c b/src/util/virhash.c
index bc90c44..fab621b 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -287,7 +287,7 @@ virHashGrow(virHashTablePtr table, size_t size)
VIR_FREE(oldtable);
#ifdef DEBUG_GROW
- VIR_DEBUG("virHashGrow : from %d to %d, %ld elems\n", oldsize,
+ VIR_DEBUG("virHashGrow : from %d to %d, %ld elems", oldsize,
size, nbElem);
#endif
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 89985b8..f85bd3e 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -473,16 +473,16 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
case RTM_DELLINK:
case RTM_SETLINK:
case RTM_GETLINK:
- VIR_DEBUG(" IFINFOMSG\n");
- VIR_DEBUG(" ifi_family = 0x%02x\n",
+ VIR_DEBUG(" IFINFOMSG");
+ VIR_DEBUG(" ifi_family = 0x%02x",
((struct ifinfomsg *)data)->ifi_family);
- VIR_DEBUG(" ifi_type = 0x%x\n",
+ VIR_DEBUG(" ifi_type = 0x%x",
((struct ifinfomsg *)data)->ifi_type);
- VIR_DEBUG(" ifi_index = %i\n",
+ VIR_DEBUG(" ifi_index = %i",
((struct ifinfomsg *)data)->ifi_index);
- VIR_DEBUG(" ifi_flags = 0x%04x\n",
+ VIR_DEBUG(" ifi_flags = 0x%04x",
((struct ifinfomsg *)data)->ifi_flags);
- VIR_DEBUG(" ifi_change = 0x%04x\n",
+ VIR_DEBUG(" ifi_change = 0x%04x",
((struct ifinfomsg *)data)->ifi_change);
}
/* DEBUG end */
@@ -544,29 +544,29 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
if (tb[IFLA_IFNAME]) {
ifname = (char *)RTA_DATA(tb[IFLA_IFNAME]);
- VIR_DEBUG("IFLA_IFNAME = %s\n", ifname);
+ VIR_DEBUG("IFLA_IFNAME = %s", ifname);
}
if (tb[IFLA_OPERSTATE]) {
rem = *(unsigned short *)RTA_DATA(tb[IFLA_OPERSTATE]);
- VIR_DEBUG("IFLA_OPERSTATE = %d\n", rem);
+ VIR_DEBUG("IFLA_OPERSTATE = %d", rem);
}
if (tb[IFLA_VF_PORTS]) {
struct nlattr *tb_vf_ports;
- VIR_DEBUG("found IFLA_VF_PORTS\n");
+ VIR_DEBUG("found IFLA_VF_PORTS");
nla_for_each_nested(tb_vf_ports, tb[IFLA_VF_PORTS], rem) {
- VIR_DEBUG("iterating\n");
+ VIR_DEBUG("iterating");
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
- VIR_DEBUG("not a IFLA_VF_PORT. skipping\n");
+ VIR_DEBUG("not a IFLA_VF_PORT. skipping");
continue;
}
if (nla_parse_nested(tb3, IFLA_PORT_MAX, tb_vf_ports,
ifla_port_policy)) {
VIR_DEBUG("nested parsing on level 2"
- " failed.");
+ " failed");
}
if (tb3[IFLA_PORT_VF]) {
VIR_DEBUG("IFLA_PORT_VF = %d",
@@ -600,7 +600,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
uuid = (unsigned char *)
RTA_DATA(tb3[IFLA_PORT_INSTANCE_UUID]);
instance2str(uuid, instance, sizeof(instance));
- VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s\n",
+ VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s",
instance);
}
@@ -615,7 +615,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
}
if (tb3[IFLA_PORT_RESPONSE]) {
- VIR_DEBUG("IFLA_PORT_RESPONSE = %d\n", *(uint16_t *)
+ VIR_DEBUG("IFLA_PORT_RESPONSE = %d", *(uint16_t *)
RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
}
}
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index e6b78ef..d2bf360 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -407,7 +407,7 @@ virProcessKillPainfully(pid_t pid, bool force)
int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
{
size_t i;
- VIR_DEBUG("Set process affinity on %lld\n", (long long)pid);
+ VIR_DEBUG("Set process affinity on %lld", (long long)pid);
# ifdef CPU_ALLOC
/* New method dynamically allocates cpu mask, allowing unlimted cpus */
int numcpus = 1024;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 62ce930..21d99e3 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -507,7 +507,7 @@ xend_op_ext(virConnectPtr xend, const char *path, const char *key, va_list ap)
return -1;
content = virBufferContentAndReset(&buf);
- VIR_DEBUG("xend op: %s\n", content);
+ VIR_DEBUG("xend op: %s", content);
ret = http2unix(xend_post(xend, path, content));
VIR_FREE(content);
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 065b825..faebdd4 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -169,14 +169,14 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
NULL, 0, 0) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
/* Test unmanaged hostdevs */
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -186,21 +186,21 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -223,7 +223,7 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != false) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
@@ -231,11 +231,11 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -261,7 +261,7 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -269,19 +269,19 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -303,18 +303,18 @@ testVirHostdevReAttachPCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != true) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -392,13 +392,13 @@ testVirHostdevUpdateActivePCIHostdevs(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, NULL, 0,
drv_name, dom_name) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, hostdevs, nhostdevs,
drv_name, dom_name) < 0)
goto cleanup;
@@ -432,7 +432,7 @@ mymain(void)
# define DO_TEST(fnc) \
do { \
- VIR_DEBUG("\nTesting: %s", #fnc); \
+ VIR_DEBUG("Testing: %s", #fnc); \
if (virtTestRun(#fnc, fnc, NULL) < 0) \
ret = -1; \
} while (0)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index ce9eeab..5786870 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -105,7 +105,7 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
break;
}
- VIR_DEBUG("Choose port %d\n", *freePort);
+ VIR_DEBUG("Choose port %d", *freePort);
ret = 0;
diff --git a/tests/virtimetest.c b/tests/virtimetest.c
index 9ab38ae..49040d3 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -92,7 +92,7 @@ testTimeLocalOffset(const void *args)
return -1;
if (data->offset != actual) {
- VIR_DEBUG("Expect Offset %ld got %ld\n",
+ VIR_DEBUG("Expect Offset %ld got %ld",
data->offset, actual);
return -1;
}
--
2.6.2
9 years, 1 month
[libvirt] [libvirt-test-api][PATCH] Add config flag when calling setVcpusFlags with maximum flag
by Hongming Zhang
Flag 'VIR_DOMAIN_AFFECT_CONFIG' is required by flag 'VIR_DOMAIN_VCPU_MAXIMUM'
modified: set_vcpus_config.py
---
repos/setVcpus/set_vcpus_config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/repos/setVcpus/set_vcpus_config.py b/repos/setVcpus/set_vcpus_config.py
index 3bb3984..3ef0992 100644
--- a/repos/setVcpus/set_vcpus_config.py
+++ b/repos/setVcpus/set_vcpus_config.py
@@ -80,7 +80,7 @@ def set_vcpus_config(params):
return 1
if maxvcpu:
- flags = libvirt.VIR_DOMAIN_VCPU_MAXIMUM
+ flags = libvirt.VIR_DOMAIN_VCPU_MAXIMUM|libvirt.VIR_DOMAIN_AFFECT_CONFIG
logger.info("the given max vcpu number is %s" % maxvcpu)
logger.info("set domain maximum vcpu as %s with flag: %s" %
(maxvcpu, flags))
--
1.9.3
9 years, 1 month