[libvirt] [PATCH] docs: domain: document blkiotune {read, write}_{bytes, iops}_sec
by Cole Robinson
Added with commit 3b431929 in v1.2.2 but never documented
https://bugzilla.redhat.com/show_bug.cgi?id=1313613
---
docs/formatdomain.html.in | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c2955eb..8c98288 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -991,6 +991,10 @@
<device>
<path>/dev/sdb</path>
<weight>500</weight>
+ <read_bytes_sec>10000</read_bytes_sec>
+ <write_bytes_sec>10000</write_bytes_sec>
+ <read_iops_sec>20000</read_iops_sec>
+ <write_iops_sec>20000</write_iops_sec>
</device>
</blkiotune>
...
@@ -1025,7 +1029,19 @@
absolute path of the device, and <code>weight</code> giving
the relative weight of that device, in the range [100,
1000]. After kernel 2.6.39, the value could be in the
- range [10, 1000].<span class="since">Since 0.9.8</span></dd>
+ range [10, 1000]. <span class="since">Since 0.9.8</span>
+ <br/><br/>
+ <code>device</code> has the following optional sub-elements:
+ <ul>
+ <li><code>read_bytes_sec</code>: read throughput limit in
+ bytes per second. <span class="since">Since 1.2.2</span></li>
+ <li><code>write_bytes_sec</code>: write throughput limit in
+ bytes per second. <span class="since">Since 1.2.2</span></li>
+ <li><code>read_iops_sec</code>: read I/O operations
+ per second limit. <span class="since">Since 1.2.2</span></li>
+ <li><code>write_iops_sec</code>: write I/O operations
+ per second limit. <span class="since">Since 1.2.2</span></li>
+ </ul></dd>
</dl>
--
2.7.3
8 years, 7 months
[libvirt] [PATCH 1/2] tests: Enable failure testing with CompareDomXML2XML
by Cole Robinson
This allows tests to check for specific failure scenarios
---
tests/bhyvexml2xmltest.c | 4 ++--
tests/genericxml2xmltest.c | 4 ++--
tests/lxcxml2xmltest.c | 3 ++-
tests/qemuxml2xmltest.c | 6 ++++--
tests/testutils.c | 47 ++++++++++++++++++++++++++++++++++------------
tests/testutils.h | 12 +++++++++++-
6 files changed, 56 insertions(+), 20 deletions(-)
diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
index 8f556ee..c8c6c6e 100644
--- a/tests/bhyvexml2xmltest.c
+++ b/tests/bhyvexml2xmltest.c
@@ -32,8 +32,8 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, xml_in,
info->different ? xml_out : xml_in,
- false,
- NULL, NULL, 0);
+ false, NULL, NULL, 0,
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
cleanup:
VIR_FREE(xml_in);
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
index bf9b11d..7d504db 100644
--- a/tests/genericxml2xmltest.c
+++ b/tests/genericxml2xmltest.c
@@ -39,8 +39,8 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
- !info->inactive_only,
- NULL, NULL, 0);
+ !info->inactive_only, NULL, NULL, 0,
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);
diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
index 0b51340..fec0142 100644
--- a/tests/lxcxml2xmltest.c
+++ b/tests/lxcxml2xmltest.c
@@ -46,7 +46,8 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
!info->inactive_only,
- NULL, NULL, info->parse_flags);
+ NULL, NULL, info->parse_flags,
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 0735677..b0f298c 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -54,7 +54,8 @@ testXML2XMLActive(const void *opaque)
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt,
info->inName, info->outActiveName, true,
- qemuXML2XMLPreFormatCallback, opaque, 0);
+ qemuXML2XMLPreFormatCallback, opaque, 0,
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
}
@@ -65,7 +66,8 @@ testXML2XMLInactive(const void *opaque)
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName,
info->outInactiveName, false,
- qemuXML2XMLPreFormatCallback, opaque, 0);
+ qemuXML2XMLPreFormatCallback, opaque, 0,
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
}
diff --git a/tests/testutils.c b/tests/testutils.c
index fc4c339..a0ce4b6 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -1079,10 +1079,12 @@ int
testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
const char *infile, const char *outfile, bool live,
testCompareDomXML2XMLPreFormatCallback cb,
- const void *opaque, unsigned int parseFlags)
+ const void *opaque, unsigned int parseFlags,
+ testCompareDomXML2XMLResult expectResult)
{
char *actual = NULL;
int ret = -1;
+ testCompareDomXML2XMLResult result;
virDomainDefPtr def = NULL;
unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
@@ -1092,25 +1094,46 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
if (!live)
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
- if (!(def = virDomainDefParseFile(infile, caps, xmlopt, parse_flags)))
- goto fail;
+ if (!(def = virDomainDefParseFile(infile, caps, xmlopt, parse_flags))) {
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE;
+ goto out;
+ }
if (!virDomainDefCheckABIStability(def, def)) {
VIR_TEST_DEBUG("ABI stability check failed on %s", infile);
- goto fail;
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_STABILITY;
+ goto out;
}
- if (cb && cb(def, opaque) < 0)
- goto fail;
+ if (cb && cb(def, opaque) < 0) {
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_CB;
+ goto out;
+ }
- if (!(actual = virDomainDefFormat(def, caps, format_flags)))
- goto fail;
+ if (!(actual = virDomainDefFormat(def, caps, format_flags))) {
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_FORMAT;
+ goto out;
+ }
- if (virtTestCompareToFile(actual, outfile) < 0)
- goto fail;
+ if (virtTestCompareToFile(actual, outfile) < 0) {
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_COMPARE;
+ goto out;
+ }
+
+ result = TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS;
+ out:
+ if (result == expectResult) {
+ ret = 0;
+ if (expectResult != TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS) {
+ VIR_TEST_DEBUG("Got expected failure code=%d msg=%s",
+ result, virGetLastErrorMessage());
+ }
+ } else {
+ ret = -1;
+ VIR_TEST_DEBUG("Expected failure code=%d but received code=%d",
+ expectResult, result);
+ }
- ret = 0;
- fail:
VIR_FREE(actual);
virDomainDefFree(def);
return ret;
diff --git a/tests/testutils.h b/tests/testutils.h
index 058be55..0417a0b 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -134,6 +134,15 @@ int virtTestMain(int argc,
virCapsPtr virTestGenericCapsInit(void);
virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void);
+typedef enum {
+ TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_STABILITY,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_CB,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_FORMAT,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_COMPARE,
+} testCompareDomXML2XMLResult;
+
typedef int (*testCompareDomXML2XMLPreFormatCallback)(virDomainDefPtr def,
const void *opaque);
int testCompareDomXML2XMLFiles(virCapsPtr caps,
@@ -143,6 +152,7 @@ int testCompareDomXML2XMLFiles(virCapsPtr caps,
bool live,
testCompareDomXML2XMLPreFormatCallback cb,
const void *opaque,
- unsigned int parseFlags);
+ unsigned int parseFlags,
+ testCompareDomXML2XMLResult expectResult);
#endif /* __VIR_TEST_UTILS_H__ */
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] qemu: command: don't overwrite watchdog dump action
by Cole Robinson
The watchdog cli refactoring in 4666b762 dropped the temporary variable
we use to convert to action=dump to action=pause for the qemu cli, and
stored the converted value in the domain structure. Our other watchdog
handling code then treated it as though the user requested action=pause,
which broke action=dump handling.
Revive the temporary variable to fix things.
---
src/qemu/qemu_command.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 21f505b..434c731 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3350,6 +3350,7 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
virDomainWatchdogDefPtr watchdog = def->watchdog;
char *optstr;
const char *action;
+ int action_id;
if (!def->watchdog)
return 0;
@@ -3376,10 +3377,12 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, optstr);
VIR_FREE(optstr);
+ /* 'dump' action tells qemu to pause, then we handle the dump ourselves */
+ action_id = watchdog->action;
if (watchdog->action == VIR_DOMAIN_WATCHDOG_ACTION_DUMP)
- watchdog->action = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
+ action_id = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
- action = virDomainWatchdogActionTypeToString(watchdog->action);
+ action = virDomainWatchdogActionTypeToString(action_id);
if (!action) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid watchdog action"));
--
2.7.3
8 years, 7 months
[libvirt] [PATCH v2 0/2] Add panic device support for S390
by Boris Fiuczynski
S390 architecture inherently provides a crash detection capability
which has not been reflected in the domain xml.
This series adds an s390 model to the panic device which does not
allow an address to be specified and is by default created on S390
guests unless already provided.
Boris Fiuczynski (2):
qemu: add panic device support for S390
tests: add tests for panic device model s390
docs/formatdomain.html.in | 7 +++++-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 21 +++++++++++++++-
src/qemu/qemu_domain.c | 9 ++++++-
.../qemuargv2xml-machine-aeskeywrap-off-argv.xml | 1 +
.../qemuargv2xml-machine-aeskeywrap-on-argv.xml | 1 +
.../qemuargv2xml-machine-deakeywrap-off-argv.xml | 1 +
.../qemuargv2xml-machine-deakeywrap-on-argv.xml | 1 +
.../qemuargv2xml-machine-keywrap-none-argv.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml | 22 ++++++++++++++++
.../qemuxml2argv-s390-panic-address.xml | 26 +++++++++++++++++++
.../qemuxml2argv-s390-panic-missing.args | 25 +++++++++++++++++++
.../qemuxml2argv-s390-panic-missing.xml | 23 +++++++++++++++++
.../qemuxml2argv-s390-panic-no-address.args | 25 +++++++++++++++++++
.../qemuxml2argv-s390-panic-no-address.xml | 24 ++++++++++++++++++
tests/qemuxml2argvtest.c | 11 +++++++-
.../qemuxml2xmlout-iothreads-disk-virtio-ccw.xml | 1 +
.../qemuxml2xmlout-panic-s390.xml | 28 +++++++++++++++++++++
.../qemuxml2xmlout-s390-defaultconsole.xml | 1 +
.../qemuxml2xmlout-s390-panic-missing.xml | 29 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 4 +++
23 files changed, 261 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-s390.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml
--
2.3.0
8 years, 7 months
[libvirt] [PATCH 0/6] vz: misc fixes
by Nikolay Shirokovskiy
Mikhail Feoktistov (2):
vz: handle sourceless cdroms
vz: fix template ct creation
Nikolay Shirokovskiy (4):
vz: remove check for auto file format for disks
vz: fix vzCheckUnsupportedDisks format checks for cdroms
vz: fix error message for readonly fs
vz: make error path code idiomatic
src/vz/vz_sdk.c | 31 ++++++++++++++++++++-----------
src/vz/vz_utils.c | 23 +++++++++--------------
2 files changed, 29 insertions(+), 25 deletions(-)
--
1.8.3.1
8 years, 7 months
[libvirt] Request for XEN source code
by Zakirasafi
Dear all I need XEN hyper-visor source code. Kindly send me
*Thanks and Regards,*
Zakira Inayat
Ph.D Scholar in University of Malaya, Malaysia
8 years, 7 months
[libvirt] [libvirt-glib] spec: Add verification of the tarball GPG signature
by Christophe Fergeau
This at least allows to make sure that all tarballs are signed with the
same GPG key, and that the tarball was not corrupted between the time it
was uploaded upstream, and the time the RPM is built.
danpb-BE86EBB415104FDF.gpg is generated with:
gpg2 -v --armor --export 15104FDF | gpg2 --no-default-keyring --keyring ./danpb-BE86EBB415104FDF.gpg --import
---
libvirt-glib.spec.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libvirt-glib.spec.in b/libvirt-glib.spec.in
index 32ce4f0..3616a6e 100644
--- a/libvirt-glib.spec.in
+++ b/libvirt-glib.spec.in
@@ -28,6 +28,8 @@ Group: Development/Libraries
License: LGPLv2+
URL: http://libvirt.org/
Source0: ftp://libvirt.org/libvirt/glib/%{name}-%{version}.tar.gz
+Source1: ftp://libvirt.org/libvirt/glib/%{name}-%{version}.tar.gz.asc
+Source2: danpb-BE86EBB415104FDF.gpg
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel >= @GLIB2_REQUIRED@
@@ -45,6 +47,7 @@ BuildRequires: libtool
%if %{with_vala}
BuildRequires: vala-tools
%endif
+BuildRequires: gnupg2
%package devel
Group: Development/Libraries
@@ -109,6 +112,7 @@ libvirt and the glib event loop
%endif
%prep
+gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%setup -q
%build
--
2.5.5
8 years, 7 months
[libvirt] [libvirt-perl][PATCH] Fix POD error in Domain.pm
by Ján Tomko
Previous commit put the =item outside of an =over region.
Failed test 'POD test for blib/lib/Sys/Virt/Domain.pm'
at /usr/lib64/perl5/vendor_perl/5.20.2/Test/Pod.pm line 186.
blib/lib/Sys/Virt/Domain.pm (3015): '=item' outside of any '=over'
blib/lib/Sys/Virt/Domain.pm (3019): You forgot a '=back' before '=head2'
Looks like you failed 1 test of 13.
---
Changes | 1 +
lib/Sys/Virt/Domain.pm | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Changes b/Changes
index a54cf71..8f7be1d 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,7 @@ Revision history for perl module Sys::Virt
1.3.4 2016-00-00
+ - Fix POD error in Domain.pm
- Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED constant
- Reuse VIR_DOMAIN_EVENT_ID_DEVICE callbacks
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index bafe9ba..c41fb64 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -3010,12 +3010,12 @@ provides a hash containing the job stats. The keyus in the
hash are the same as those used with the C<Sys::Virt::Domain::get_job_stats()>
method.
-=back
-
=item Sys::Virt::Domain::EVENT_ID_DEVICE_REMOVAL_FAILED
Guest device removal has failed.
+=back
+
=head2 IO ERROR EVENT CONSTANTS
These constants describe what action was taken due to the
--
2.7.3
8 years, 7 months
[libvirt] [PATCH] tests: do not overwrite return value when filling qemuCapsCache
by Ján Tomko
In qemuHotplugCreateObjects, the ret variable was filled by
the value returned by qemuTestCapsCacheInsert.
If any of the functions after this assignment failed, we would still
return success.
Also adjust testCompareXMLToArgvHelper, where this change is just
cosmetic, because the value was overwritten right away.
---
tests/qemuhotplugtest.c | 5 ++---
tests/qemuxml2argvtest.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 1eb2b6a..ea6dc36 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -71,23 +71,22 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
if (!(priv->qemuCaps = virQEMUCapsNew()))
goto cleanup;
/* for attach & detach qemu must support -device */
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE);
if (event)
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT);
- ret = qemuTestCapsCacheInsert(driver.qemuCapsCache, testname,
- priv->qemuCaps);
- if (ret < 0)
+ if (qemuTestCapsCacheInsert(driver.qemuCapsCache, testname,
+ priv->qemuCaps) < 0)
goto cleanup;
if (!((*vm)->def = virDomainDefParseString(domxml,
driver.caps,
driver.xmlopt,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
if (qemuDomainAssignAddresses((*vm)->def, priv->qemuCaps, *vm) < 0)
goto cleanup;
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index be74178..39443e2 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -400,23 +400,22 @@ testCompareXMLToArgvHelper(const void *data)
virAsprintf(&args, "%s/qemuxml2argvdata/qemuxml2argv-%s.args",
abs_srcdir, info->name) < 0)
goto cleanup;
if (virQEMUCapsGet(info->extraFlags, QEMU_CAPS_MONITOR_JSON))
flags |= FLAG_JSON;
if (virQEMUCapsGet(info->extraFlags, QEMU_CAPS_ENABLE_FIPS))
flags |= FLAG_FIPS;
- result = qemuTestCapsCacheInsert(driver.qemuCapsCache, info->name,
- info->extraFlags);
- if (result < 0)
+ if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->name,
+ info->extraFlags) < 0)
goto cleanup;
result = testCompareXMLToArgvFiles(xml, args, info->extraFlags,
migrateURI, flags, info->parseFlags);
cleanup:
VIR_FREE(migrateURI);
VIR_FREE(xml);
VIR_FREE(args);
return result;
--
2.7.3
8 years, 7 months