[libvirt] [PATCH] qemu: Properly check for incoming migration job
by Jiri Denemark
In addition to checking the current asynchronous job
qemuMigrationJobIsActive reports an error if the current job does not
match the one we asked for. Let's just check the job directly since we
are not interested in the error in qemuProcessHandleMonitorEOF.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1c0c734..23baa82 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -310,7 +310,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
auditReason = "failed";
}
- if (qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN))
+ if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN)
qemuMigrationErrorSave(driver, vm->def->name,
qemuMonitorLastError(priv->mon));
--
2.5.0
9 years, 3 months
[libvirt] [sandbox PATCH 00/11] Virt-sandbox-image
by Eren Yagdiran
Hello,
virt-sandbox-image.py is a python script that lets you download and run templates
from supported sources using virt-sandbox.
Component-based archictecture is accomplished through Source base class.
Docker image support is added through DockerSource.
DockerSource is capable of downloading and running Docker images by consuming Docker Registry API.
Daniel P Berrange (1):
Add virt-sandbox-image
Eren Yagdiran (10):
Fix virt-sandbox-image
Image: Add Hooking Mechanism
Image: Add download function
Image: Refactor create function
Image: Add delete function
Image: Add get_command function to Source
Image: Add run args
Image: Add check_driver function
Image: Add get_disk function to Source
Image: Add run function
po/POTFILES.in | 1 +
virt-sandbox-image/sources/DockerSource.py | 364 +++++++++++++++++++++++++++++
virt-sandbox-image/sources/Source.py | 27 +++
virt-sandbox-image/virt-sandbox-image.py | 233 ++++++++++++++++++
4 files changed, 625 insertions(+)
create mode 100644 virt-sandbox-image/sources/DockerSource.py
create mode 100644 virt-sandbox-image/sources/Source.py
create mode 100644 virt-sandbox-image/virt-sandbox-image.py
--
2.1.0
9 years, 3 months
[libvirt] [libvirt-test-api][PATCH] Introduce new test case for setMemoryStatsPeriod
by Luyao Huang
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
cases/linux_domain.conf | 6 +++
repos/domain/set_memory_period.py | 84 +++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+)
create mode 100644 repos/domain/set_memory_period.py
diff --git a/cases/linux_domain.conf b/cases/linux_domain.conf
index 9f64226..fd32aad 100644
--- a/cases/linux_domain.conf
+++ b/cases/linux_domain.conf
@@ -275,6 +275,12 @@ domain:virDomain_getCPUStats
conn
qemu:///system
+domain:set_memory_period
+ guestname
+ $defaultname
+ conn
+ qemu:///system
+
domain:destroy
guestname
$defaultname
diff --git a/repos/domain/set_memory_period.py b/repos/domain/set_memory_period.py
new file mode 100644
index 0000000..56b71ae
--- /dev/null
+++ b/repos/domain/set_memory_period.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+
+import libvirt
+from libvirt import libvirtError
+import lxml
+import lxml.etree
+
+required_params = ('guestname',)
+optional_params = {'conn': 'qemu:///system'}
+
+def get_period_fromxml(vm, running):
+ if (running == 1):
+ tree = lxml.etree.fromstring(vm.XMLDesc(0))
+ else:
+ tree = lxml.etree.fromstring(vm.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE))
+
+ set = tree.xpath("//memballoon/stats")
+ if len(set) == 0:
+ return 0
+ for n in set:
+ period = n.attrib['period']
+ return period
+
+def check_memoryStats(vm):
+ memstats = vm.memoryStats()
+ try:
+ available = memstats["available"]
+ if available:
+ logger.info("can get available from memoryStats()")
+ return 0
+ except KeyError:
+ logger.info("cannot get available from memoryStats()")
+ return 1
+
+def set_memory_period(params):
+ """
+ test API for setMemoryStatsPeriod in class virDomain
+ """
+ global logger
+ logger = params['logger']
+ fail=0
+
+ try:
+ conn = libvirt.open(params['conn'])
+
+ logger.info("get connection to libvirtd")
+ guest = params['guestname']
+ vm = conn.lookupByName(guest)
+ logger.info("test guest name: %s" % guest)
+
+ """ test with running vm """
+ if vm.isActive() == 1:
+ logger.info("guest is running test with running guest")
+ period = int(get_period_fromxml(vm, 1))
+ if period == 0:
+ vm.setMemoryStatsPeriod(1, libvirt.VIR_DOMAIN_AFFECT_LIVE)
+ if int(get_period_fromxml(vm, 1)) != 1:
+ logger.error("Period value from xml is not right")
+ fail = 1
+ elif check_memoryStats(vm) == 0:
+ period = 1
+ else:
+ fail = 1
+
+ if period > 0:
+ if check_memoryStats(vm) == 0:
+ vm.setMemoryStatsPeriod(period + 1, libvirt.VIR_DOMAIN_AFFECT_LIVE)
+ if int(get_period_fromxml(vm, 1)) != period + 1:
+ logger.error("Period value from xml is not right")
+ fail = 1
+ else:
+ fail = 1
+
+ """ test with vm config """
+ period = int(get_period_fromxml(vm, 0))
+ vm.setMemoryStatsPeriod(period + 1, libvirt.VIR_DOMAIN_AFFECT_CONFIG)
+ if int(get_period_fromxml(vm, 0)) != period + 1:
+ logger.error("Period value from xml is not right")
+ fail = 1
+
+ except libvirtError, e:
+ logger.error("API error message: %s" % e.message)
+ fail=1
+ return fail
--
1.8.3.1
9 years, 3 months
[libvirt] [PATCH 0/2] Disable floppy disk for PowerPC VMs
by Kothapally Madhu Pavan
This is an attempt to fix:
Libvirt BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1180486
Libvirt currently assumes ISA_based floppy disks to be available across all
architectures and machine types. However, PowerPC Book 3S compatible ('ie pseries)
virtual machines do not support Floppy disks.
This patch series prevents libvirt from launching ppc64[le] -based 'pseries'
VMs with floppy devices.
---
Kothapally Madhu Pavan (2):
Caps: Disable floppy disk for PowerPC Vm
Avoid starting a PowerPC VM with floppy disk
src/conf/domain_conf.c | 19 +++++++++++++----
src/qemu/qemu_capabilities.c | 15 ++++++++++---
src/qemu/qemu_command.c | 47 ++++++++++++++++++++++++++++++++++++++++--
3 files changed, 71 insertions(+), 10 deletions(-)
--
9 years, 3 months
[libvirt] [PATCH v10 0/5] nodeinfo: Add support for subcores
by Andrea Bolognani
Only patch 1/5 has been updated, all the other patches
are the same as v8:
2/5 https://www.redhat.com/archives/libvir-list/2015-July/msg01045.html
3/5 https://www.redhat.com/archives/libvir-list/2015-July/msg01048.html
4/5 https://www.redhat.com/archives/libvir-list/2015-July/msg01049.html
5/5 https://www.redhat.com/archives/libvir-list/2015-July/msg01050.html
I'm including the full history below.
Cheers.
Changes in v10:
* don't attempt to close a file that wasn't opened
* report a detailed error to help with diagnosis
Changes in v9:
* take into account the fact that kvm might not be loaded
or even installed
Changes in v8:
* shortened test names so that make dist doesn't
stop working again
Changes in v7:
* rebased on top of master now that the series this one
builds on have been merged
Changes in v6:
* updated to work on top of
[PATCH v2 00/10] nodeinfo: Various cleanups
Changes in v5:
* streamlined the logic used to decide whether the subcore
configuration is valid and moved it to a separate function
* split the tests into separate commits for easier review and
to hopefully avoid having trouble with the list due to the
message size
Changes in v4:
* removed a printf() statement
* fixed typo in a commit message
Changes in v3:
* the function to get the number of threads per subcore
has been moved to the from virarch.c, which deals with
architecture names only and is therefore not the right
place to read host configuration, to nodeinfo.c where
the rest of this stuff lives
* said function has also been given a shorter name
* the "valid subcore mode" boolean has been removed:
threads_per_subcore will be a positive number if
subcores should be taken into account, and if that's
not the case (x86 host, tainted configuration) it
will simply be zero, so now the code needs to keep
track of a single variable instead of two
* the test case has been renamed to be more
descriptive
* the test data has been cleaned up by removing all
cpu/cpu*/node* links, which prevented 'make dist'
from working due to recursive linking
Andrea Bolognani (3):
tests: Add subcores1 nodeinfo test
tests: Add subcores2 nodeinfo test
tests: Add subcores3 nodeinfo test
Shivaprasad G Bhat (2):
nodeinfo: Fix output on PPC64 KVM hosts
tests: Prepare for subcore tests
src/libvirt_private.syms | 1 +
src/nodeinfo.c | 159 ++++++++++++++++++++-
src/nodeinfo.h | 1 +
tests/Makefile.am | 6 +
[...]
tests/nodeinfomock.c | 35 +++++
tests/nodeinfotest.c | 8 +-
1348 files changed, 2140 insertions(+), 6 deletions(-)
[...]
create mode 100644 tests/nodeinfomock.c
--
2.4.3
9 years, 3 months
[libvirt] Build failed in Jenkins: libvirt-syntax-check #3732
by Jenkins CI
See <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/3732/>
------------------------------------------
Started by upstream project "libvirt-build" build number 4256
Building on master in workspace <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/>
[workspace] $ /bin/sh -xe /tmp/hudson3362415966189127246.sh
+ make syntax-check
GEN bracket-spacing-check
GFDL_version
0.86 GFDL_version
TAB_in_indentation
0.55 TAB_in_indentation
Wundef_boolean
0.37 Wundef_boolean
avoid_attribute_unused_in_header
0.42 avoid_attribute_unused_in_header
avoid_ctype_macros
0.91 avoid_ctype_macros
avoid_if_before_free
6.76 avoid_if_before_free
avoid_strcase
0.76 avoid_strcase
avoid_write
0.49 avoid_write
bindtextdomain
0.41 bindtextdomain
cast_of_argument_to_free
0.80 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.82 cast_of_x_alloc_return_value
changelog
0.36 changelog
const_long_option
0.80 const_long_option
copyright_check
1.08 copyright_check
copyright_format
2.63 copyright_format
copyright_usage
2.26 copyright_usage
correct_id_types
0.91 correct_id_types
curly_braces_style
1.56 curly_braces_style
error_message_period
0.70 error_message_period
error_message_warn_fatal
0.61 error_message_warn_fatal
flags_debug
1.56 flags_debug
flags_usage
1.73 flags_usage
forbid_const_pointer_typedef
1.81 forbid_const_pointer_typedef
forbid_manual_xml_indent
0.79 forbid_manual_xml_indent
libvirt_unmarked_diagnostics
2.23 libvirt_unmarked_diagnostics
m4_quote_check
0.43 m4_quote_check
makefile_TAB_only_indentation
0.42 makefile_TAB_only_indentation
makefile_at_at_check
0.35 makefile_at_at_check
makefile_conditionals
0.41 makefile_conditionals
po_check
15.53 po_check
preprocessor_indentation
0.73 preprocessor_indentation
prohibit_HAVE_MBRTOWC
0.91 prohibit_HAVE_MBRTOWC
prohibit_PATH_MAX
1.05 prohibit_PATH_MAX
prohibit_VIR_ERR_NO_MEMORY
0.79 prohibit_VIR_ERR_NO_MEMORY
prohibit_access_xok
0.84 prohibit_access_xok
prohibit_always-defined_macros
2.06 prohibit_always-defined_macros
prohibit_always_true_header_tests
0.94 prohibit_always_true_header_tests
prohibit_argmatch_without_use
0.66 prohibit_argmatch_without_use
prohibit_asprintf
1.57 prohibit_asprintf
prohibit_assert_without_use
0.71 prohibit_assert_without_use
prohibit_atoi
0.82 prohibit_atoi
prohibit_backup_files
0.26 prohibit_backup_files
prohibit_c_ctype_without_use
0.69 prohibit_c_ctype_without_use
prohibit_canonicalize_without_use
0.61 prohibit_canonicalize_without_use
prohibit_cloexec_without_use
0.66 prohibit_cloexec_without_use
prohibit_close
1.45 prohibit_close
prohibit_close_stream_without_use
0.76 prohibit_close_stream_without_use
prohibit_config_h_in_headers
0.44 prohibit_config_h_in_headers
prohibit_cross_inclusion
13.40 prohibit_cross_inclusion
prohibit_ctype_h
0.75 prohibit_ctype_h
prohibit_cvs_keyword
0.74 prohibit_cvs_keyword
prohibit_defined_have_decl_tests
0.79 prohibit_defined_have_decl_tests
prohibit_devname
0.76 prohibit_devname
prohibit_diagnostic_without_format
src/util/virfile.c:820: virReportError(VIR_ERR_INTERNAL_ERROR,
src/util/virfile.c-821- _("Failed to load nbd module: "
src/util/virfile.c-822- "administratively prohibited"));
src/util/virfile.c:829: virReportError(VIR_ERR_INTERNAL_ERROR,
src/util/virfile.c-830- _("Failed to load nbd module"));
maint.mk: found diagnostic without %
make: *** [sc_prohibit_diagnostic_without_format] Error 1
Build step 'Execute shell' marked build as failure
9 years, 3 months
[libvirt] [python PATCH] iothread: Fix crash if virDomainGetIOThreadInfo returns error
by Peter Krempa
The cleanup portion of libvirt_virDomainGetIOThreadInfo would try to
clean the returned structures but the count of iothreads was set to -1.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1248295
---
libvirt-override.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 45c8afc..2398228 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -2104,8 +2104,10 @@ libvirt_virDomainGetIOThreadInfo(PyObject *self ATTRIBUTE_UNUSED,
py_iothrinfo = NULL;
cleanup:
- for (i = 0; i < niothreads; i++)
- virDomainIOThreadInfoFree(iothrinfo[i]);
+ if (niothreads > 0) {
+ for (i = 0; i < niothreads; i++)
+ virDomainIOThreadInfoFree(iothrinfo[i]);
+ }
VIR_FREE(iothrinfo);
Py_XDECREF(py_iothrinfo);
return py_retval;
--
2.4.5
9 years, 3 months
[libvirt] [PATCH 0/3] libxl: a few small migration fixes
by Jim Fehlig
This series fixes a few issues found while testing migration with
latest Xen and libvirt. See the individual patches for details.
Jim Fehlig (3):
libxl: fix ref counting of libxlMigrationDstArgs
libxl: don't attempt to resume domain when suspend fails
libxl: acquire a job when receiving a migrating domain
src/libxl/libxl_migration.c | 52 +++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 30 deletions(-)
--
2.1.4
9 years, 4 months
[libvirt] [PATCH] Load nbd module before running qemu-nbd
by Cédric Bosdonnat
So far qemu-nbd is run even if the nbd kernel module isn't loaded. This
leads to errors when the user starts his lxc container while libvirt
could easily load the nbd module automatically.
---
src/util/virfile.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 61f6e4d..76f1b7a 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -63,6 +63,7 @@
#include "vircommand.h"
#include "virerror.h"
#include "virfile.h"
+#include "virkmod.h"
#include "virlog.h"
#include "virprocess.h"
#include "virstring.h"
@@ -745,6 +746,7 @@ int virFileLoopDeviceAssociate(const char *file,
# define SYSFS_BLOCK_DIR "/sys/block"
+# define NBD_DRIVER "nbd"
static int
@@ -811,18 +813,42 @@ virFileNBDDeviceFindUnused(void)
return ret;
}
+static bool
+virFileNBDLoadDriver(void)
+{
+ if (virKModIsBlacklisted(NBD_DRIVER)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to load nbd module: "
+ "administratively prohibited"));
+ return false;
+ } else {
+ char *errbuf = NULL;
+
+ if ((errbuf = virKModLoad(NBD_DRIVER, true))) {
+ VIR_FREE(errbuf);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to load nbd module"));
+ return false;
+ }
+ VIR_FREE(errbuf);
+ }
+ return true;
+}
int virFileNBDDeviceAssociate(const char *file,
virStorageFileFormat fmt,
bool readonly,
char **dev)
{
- char *nbddev;
+ char *nbddev = NULL;
char *qemunbd = NULL;
virCommandPtr cmd = NULL;
int ret = -1;
const char *fmtstr = NULL;
+ if (!virFileNBDLoadDriver())
+ goto cleanup;
+
if (!(nbddev = virFileNBDDeviceFindUnused()))
goto cleanup;
--
2.1.4
9 years, 4 months