[libvirt] [PATCH v5 0/5] vz: add migration support
by Nikolay Shirokovskiy
NOTE that minimal command to migrate vz domain is like next:
virsh -c vz:///system migrate 200 vz+ssh://shiny0/system --p2p
--live --compressed --persistent --undefinesource
Difference from v4:
1. move preparation of the migration uri from src to dst as dst intended to do it.
2. change hypervisor migration scheme from 'tcp' to 'vzmigr'
3. declare this scheme in host caps
src/vz/vz_driver.c | 356 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_sdk.c | 86 +++++++++++--
src/vz/vz_sdk.h | 6 +
src/vz/vz_utils.h | 4 +-
4 files changed, 437 insertions(+), 15 deletions(-)
9 years, 1 month
[libvirt] crash in virDomainNumaGetMemorySize
by Olaf Hering
With current master (56945e1), while toying around with a WS2008R2 Hyper-V host:
root@probook:~ # gdb --quiet -ex 'r -c hv dumpxml all-sles12-dev' -ex bt -ex detach -ex quit virsh
Reading symbols from virsh...Reading symbols from /usr/lib/debug/usr/bin/virsh.debug...done.
done.
Starting program: /usr/bin/virsh -c hv dumpxml all-sles12-dev
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Enter Administrator's password for optiplex.fritz.box:
[New Thread 0x7fffee601700 (LWP 26921)]
Program received signal SIGSEGV, Segmentation fault.
virDomainNumaGetMemorySize (numa=0x0) at conf/numa_conf.c:971
971 for (i = 0; i < numa->nmem_nodes; i++)
#0 virDomainNumaGetMemorySize (numa=0x0) at conf/numa_conf.c:971
#1 0x00007ffff793bce0 in virDomainDefGetMemoryActual (def=def@entry=0x55555582ead0) at conf/domain_conf.c:7857
#2 0x00007ffff7948978 in virDomainDefFormatInternal (def=0x55555582ead0, flags=0, buf=buf@entry=0x7fffffffdde0) at conf/domain_conf.c:21677
#3 0x00007ffff794b8bc in virDomainDefFormat (def=<optimized out>, flags=<optimized out>) at conf/domain_conf.c:22507
#4 0x00007ffff7a94c33 in hypervDomainGetXMLDesc (domain=<optimized out>, flags=0) at hyperv/hyperv_driver.c:882
#5 0x00007ffff79b5351 in virDomainGetXMLDesc (domain=domain@entry=0x5555558237a0, flags=0) at libvirt-domain.c:2591
#6 0x000055555558b978 in cmdDumpXML (ctl=0x7fffffffe1c0, cmd=<optimized out>) at virsh-domain.c:9634
#7 0x000055555557d04f in vshCommandRun (ctl=0x7fffffffe1c0, cmd=0x555555822580) at vsh.c:1212
#8 0x0000555555579a4d in main (argc=5, argv=0x7fffffffe3c8) at virsh.c:921
Detaching from program: /usr/bin/virsh, process 26917
root@probook:~ # rpm -qf `which virsh`
libvirt-client-20150917T085913.56945e1-3.xen_unstable.1.x86_64
Olaf
9 years, 1 month
[libvirt] genprotocol.pl generates unstable output
by Olaf Hering
If the same source gets built twice the resulting files may differ.
One example is this:
...
[ 305s] /usr/bin/perl -w ./rpc/genprotocol.pl /usr/bin/rpcgen -c \
[ 305s] remote/remote_protocol.x ./remote/remote_protocol.c
...
[ 577s] /usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c differs (C source, ASCII text)
[ 577s] --- old//usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c 2015-09-30 11:34:31.000000000 +0000
[ 577s] +++ new//usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c 2015-09-30 14:57:39.000000000 +0000
[ 577s] @@ -2084,8 +2084,8 @@
[ 577s] bool_t
[ 577s] xdr_remote_domain_get_vcpus_ret (XDR *xdrs, remote_domain_get_vcpus_ret *objp)
[ 577s] {
[ 577s] - char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val;
[ 577s] char **objp_cpp0 = (char **) (void *) &objp->info.info_val;
[ 577s] + char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val;
[ 577s]
[ 577s] if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX,
[ 577s] sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info))
...
The input is like:
bool_t
xdr_remote_domain_get_vcpus_ret (XDR *xdrs, remote_domain_get_vcpus_ret *objp)
{
register int32_t *buf;
if (!xdr_array (xdrs, (char **)&objp->info.info_val, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX,
sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info))
return FALSE;
if (!xdr_bytes (xdrs, (char **)&objp->cpumaps.cpumaps_val, (u_int *) &objp->cpumaps.cpumaps_len, REMOTE_CPUMAPS_MAX))
return FALSE;
return TRUE;
}
Looks like the perl script transforms the pointers, but it does not sort them
to enforce an order. I think its the map() which does it, but dont know enough
perl to be sure. How can this be fixed?
Olaf
9 years, 1 month
[libvirt] [PATCH 1/3] libvirt-domain: Introduce macro to save duplicated codes
by Wei Jiangang
Signed-off-by: Wei Jiangang <weijg.fnst(a)cn.fujitsu.com>
---
src/libvirt-domain.c | 55 ++++++++++++++--------------------------------------
1 file changed, 15 insertions(+), 40 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 6e1aacd..ed07c9e 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -33,6 +33,13 @@ VIR_LOG_INIT("libvirt.domain");
#define VIR_FROM_THIS VIR_FROM_DOMAIN
+#define VIR_ABSOLUTIZE_PATH(PATH, ABSPATH) \
+ if (virFileAbsPath(PATH, ABSPATH) < 0) { \
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
+ _("could not build absolute input file path")); \
+ goto error; \
+ }
+
/**
* virConnectListDomains:
@@ -830,11 +837,7 @@ virDomainSave(virDomainPtr domain, const char *to)
char *absolute_to;
/* We must absolutize the file path as the save is done out of process */
- if (virFileAbsPath(to, &absolute_to) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute output file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(to, &absolute_to);
ret = conn->driver->domainSave(domain, absolute_to);
@@ -918,11 +921,7 @@ virDomainSaveFlags(virDomainPtr domain, const char *to,
char *absolute_to;
/* We must absolutize the file path as the save is done out of process */
- if (virFileAbsPath(to, &absolute_to) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute output file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(to, &absolute_to);
ret = conn->driver->domainSaveFlags(domain, absolute_to, dxml, flags);
@@ -968,11 +967,7 @@ virDomainRestore(virConnectPtr conn, const char *from)
char *absolute_from;
/* We must absolutize the file path as the restore is done out of process */
- if (virFileAbsPath(from, &absolute_from) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute input file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(from, &absolute_from);
ret = conn->driver->domainRestore(conn, absolute_from);
@@ -1042,11 +1037,7 @@ virDomainRestoreFlags(virConnectPtr conn, const char *from, const char *dxml,
char *absolute_from;
/* We must absolutize the file path as the restore is done out of process */
- if (virFileAbsPath(from, &absolute_from) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute input file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(from, &absolute_from);
ret = conn->driver->domainRestoreFlags(conn, absolute_from, dxml,
flags);
@@ -1107,11 +1098,7 @@ virDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *file,
char *absolute_file;
/* We must absolutize the file path as the read is done out of process */
- if (virFileAbsPath(file, &absolute_file) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute input file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(file, &absolute_file);
ret = conn->driver->domainSaveImageGetXMLDesc(conn, absolute_file,
flags);
@@ -1180,11 +1167,7 @@ virDomainSaveImageDefineXML(virConnectPtr conn, const char *file,
char *absolute_file;
/* We must absolutize the file path as the read is done out of process */
- if (virFileAbsPath(file, &absolute_file) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute input file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(file, &absolute_file);
ret = conn->driver->domainSaveImageDefineXML(conn, absolute_file,
dxml, flags);
@@ -1255,11 +1238,7 @@ virDomainCoreDump(virDomainPtr domain, const char *to, unsigned int flags)
char *absolute_to;
/* We must absolutize the file path as the save is done out of process */
- if (virFileAbsPath(to, &absolute_to) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute core file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(to, &absolute_to);
ret = conn->driver->domainCoreDump(domain, absolute_to, flags);
@@ -1339,11 +1318,7 @@ virDomainCoreDumpWithFormat(virDomainPtr domain, const char *to,
char *absolute_to;
/* We must absolutize the file path as the save is done out of process */
- if (virFileAbsPath(to, &absolute_to) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not build absolute core file path"));
- goto error;
- }
+ VIR_ABSOLUTIZE_PATH(to, &absolute_to);
ret = conn->driver->domainCoreDumpWithFormat(domain, absolute_to,
dumpformat, flags);
--
1.9.3
9 years, 1 month
[libvirt] [PATCH] testscripts: make redirects happen in correct order
by Wei Jiangang
It should redirect stdout to /dev/null firstly,
then redirect stderr to whatever stdout currently points at.
Signed-off-by: Wei Jiangang <weijg.fnst(a)cn.fujitsu.com>
---
tests/test-lib.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index e612f8f..d36a901 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_"
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+if ( diff --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then
compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+elif ( cmp --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then
compare() { cmp -s "$@"; }
else
compare() { cmp "$@"; }
--
1.9.3
9 years, 1 month
[libvirt] [PATCH 0/4] Fix a couple of iothread bugs
by John Ferlan
Details in the patches.
John Ferlan (4):
qemu: During startup need more QEMU_CAPS_OBJECT_IOTHREAD checks
qemu: Check QEMU_CAPS_OBJECT_IOTHREAD for qemuDomainPinIOThread
conf: Refactor the iothreadid initialization
conf: Optimize the iothreadid initialization
src/conf/domain_conf.c | 83 +++++++++++++++++++++++++++++++++++++++----------
src/qemu/qemu_cgroup.c | 3 ++
src/qemu/qemu_driver.c | 6 ++++
src/qemu/qemu_process.c | 18 +++++++----
4 files changed, 88 insertions(+), 22 deletions(-)
--
2.1.0
9 years, 1 month
[libvirt] [PATCH 00/15] NEWS: Plenty of fixes and improvements
by Andrea Bolognani
Oh boy, where to start :)
Patch 01 fixes the XSLT stylesheet used to generate the
plain text NEWS file from docs/news.html.in. This has
been broken for at least two years, based on the oldest
release archive available on the website.
Patches 02-05 clean up some very simple mistakes.
Patches 06-09 are the juicy bits: very old entries were
not as tidy as recent ones, so I went through them and
polished them up to bring them up to standard. It would
be great if someone who was around from the early days,
ideally DV, could go over patch 09 in particular, since
categorizing old changes I know barely nothing about is
by definition prone to error.
Patches 10-15 go over everything one last time for that
extra shiny finish.
Cheers.
PS: Patch 07 contains an awfully long line that
git-send-email warns me about. I'll try to sent it
anyway, but if it doesn't make it to the list
that's probably the reason.
Andrea Bolognani (15):
NEWS: Fix XSLT stylesheet
NEWS: Include description for release 0.7.3
NEWS: Remove empty sections
NEWS: Split off merged sections
NEWS: Properly escape > in HTML
NEWS: Split old entries (2009)
NEWS: Split old entries (2008)
NEWS: Split old entries (2006-2007)
NEWS: Organize old entries
NEWS: Fix whitespace
NEWS: Fix newlines
NEWS: Fix indentation
NEWS: Add empty lines
NEWS: Unify section titles
NEWS: Unify date format
docs/news.html.in | 6071 ++++++++++++++++++++++++++++++-----------------------
docs/news.xsl | 27 +-
2 files changed, 3483 insertions(+), 2615 deletions(-)
--
2.4.3
9 years, 1 month
[libvirt] cpu affinity, isolcpus and cgroups
by Henning Schild
Hi,
i am currently looking into realtime VMs using libvirt. My first
starting point was reserving a couple of cores using isolcpus and later
tuning the affinity to place my vcpus on the reserved pcpus.
My first observation was that libvirt ignores isolcpus. Affinity masks
of new qemus will default to all cpus and will not be inherited from
libvirtd. A comment in the code suggests that this is done on purpose.
After that i changed the code to use only the available cpus by
default. But taskset was still showing all 'f's on my qemus. Then i
traced my change down to sched_setaffinity assuming that some other
mechanism might have reverted my hack, but it is still in place.
Libvirt is setting up cgroups and now my suspicion is that cgroups and
taskset might not work well together.
> /sys/fs/cgroup/cpu/machine.slice/machine-qemu\x2dvm1.scope/vcpu0#
> cpuacct.usage_percpu
> 247340587 50851635 89631114 23383025 412639264 1241965 55442753 19923
> 14093629 15863859 27403280 1292195745 82031088 53690508 135826421
> 124915000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Looks like the last 16 cores are not used.
But if i use taskset to ask for the affinity mask i get all 32 cpus.
> taskset -p `cat tasks`
> pid 12905's current affinity mask: ffffffff
I know that is not strictly libvirt but also a kernel question, still
you guys are probably able to point me to what i am missing here.
> Linux 3.18.11+ #4 SMP PREEMPT RT
regards,
Henning
9 years, 1 month
[libvirt] [PATCH RFC 0/7] libxl: domain statistics support
by Joao Martins
Hey Jim,
This series bring support for various statistics about domains
regarding CPU, Memory, Network Interfaces and BlockStats. Not all of
the statistics are implemented: qdisk support is missing in this series
and some of the memory statistics aren't available.
With this series we further implement 7 more functions of libvirt APIs.
It is organized as follows:
* Patch 1, 2: implements cpu/memory statistics.
* Patch 3, 4: implements (netback) network statistics and VBD block
statistics. QDisk will follow up in a separate series
regarding QEMU monitor integration.
* Patch 5: implement fetching all domain statistics
* Patch 6, 7: implements Job information.
Overall it looks big but 70% of the patch is due to #4 and #5 but doesn't
add necessarily more complexity to the driver I believe. Patch #6 and #7
are of special importance because GetJobInfo and GetJobStats are now used
in Openstack Kilo to monitor live-migration progress. This two patches
together with an earlier series [0] I sent before let us sucessfully
live-migrate with Openstack Kilo. Further with this series we get to
support nova diagnostics.
Tested this series on 4.4.3 and 4.5 setups plus Openstack Kilo.
Any comments or suggestions are welcome,
Thanks!
Joao
Joao Martins (7):
libxl: implement virDomainGetCPUStats
libxl: implement virDomainMemorystats
libxl: implement virDomainInterfaceStats
libxl: implement virDomainBlockStats
libxl: implement virConnectGetAllDomainStats
libxl: implement virDomainGetJobInfo
libxl: implement virDomainGetJobStats
configure.ac | 2 +-
src/libxl/libxl_domain.c | 29 ++
src/libxl/libxl_domain.h | 6 +
src/libxl/libxl_driver.c | 1010 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 1046 insertions(+), 1 deletion(-)
--
2.1.4
9 years, 1 month
[libvirt] libvirt-php and xpath function from libxml2
by Vasiliy Tolstov
Hi! I'm test under high load some libvirt-php xpath based function and
big memory leak under each function call. I'm try to patch libvirt-php
to free some values via xmlFree , but this is not solve leaks.
Do we realy need this function? As i see when i'm use plain libvirt
function and use returned xml with internal php functions that works
with xml and xpath, i'm not get memory leaks.
So does we really need it?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
9 years, 1 month