[PATCH] qemumigparamstest: Validate output parameters against QMP schema
by Peter Krempa
Ensure that the migration parameters are formatted properly according to
the schema.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/qemumigparamstest.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c
index 0f7809d763..c4fd575401 100644
--- a/tests/qemumigparamstest.c
+++ b/tests/qemumigparamstest.c
@@ -22,8 +22,10 @@
#include "virjson.h"
#include "virbuffer.h"
#include "virxml.h"
+#include "virhash.h"
#include "testutils.h"
#include "testutilsqemu.h"
+#include "tests/testutilsqemuschema.h"
#include "qemumonitortestutils.h"
#include "qemu/qemu_migration_params.h"
#define LIBVIRT_QEMU_MIGRATION_PARAMSPRIV_H_ALLOW
@@ -36,6 +38,7 @@ typedef struct _qemuMigParamsData qemuMigParamsData;
struct _qemuMigParamsData {
virDomainXMLOptionPtr xmlopt;
const char *name;
+ virHashTablePtr qmpschema;
};
@@ -141,6 +144,7 @@ qemuMigParamsTestJSON(const void *opaque)
g_autoptr(virJSONValue) paramsOut = NULL;
g_autoptr(qemuMigrationParams) migParams = NULL;
g_autofree char *actualJSON = NULL;
+ g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
int ret = -1;
replyFile = g_strdup_printf("%s/qemumigparamsdata/%s.reply",
@@ -162,6 +166,17 @@ qemuMigParamsTestJSON(const void *opaque)
!(actualJSON = virJSONValueToString(paramsOut, true)))
goto cleanup;
+ if (testQEMUSchemaValidateCommand("migrate-set-parameters",
+ paramsOut,
+ data->qmpschema,
+ false,
+ false,
+ &debug) < 0) {
+ VIR_TEST_VERBOSE("failed to validate migration params '%s' against QMP schema: %s",
+ actualJSON, virBufferCurrentContent(&debug));
+ goto cleanup;
+ }
+
if (virTestCompareToFile(actualJSON, jsonFile) < 0)
goto cleanup;
@@ -176,6 +191,7 @@ qemuMigParamsTestJSON(const void *opaque)
static int
mymain(void)
{
+ g_autoptr(virHashTable) qmpschema = NULL;
virQEMUDriver driver;
int ret = 0;
@@ -184,10 +200,15 @@ mymain(void)
virEventRegisterDefaultImpl();
+ if (!(qmpschema = testQEMUSchemaLoadLatest("x86_64"))) {
+ VIR_TEST_VERBOSE("failed to load QMP schema");
+ return EXIT_FAILURE;
+ }
+
#define DO_TEST(name) \
do { \
qemuMigParamsData data = { \
- driver.xmlopt, name \
+ driver.xmlopt, name, qmpschema \
}; \
if (virTestRun(name " (xml)", qemuMigParamsTestXML, &data) < 0) \
ret = -1; \
--
2.26.2
4 years, 4 months
[PATCH v2 00/17] Allow sparse streams for block devices
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2020-July/msg00145.html
diff to v1:
- Switch virfdstream to glib (patches 1-6)
- Document the feature in NEWS.rst
- Introduced test cases for virStringIsNull()
- Included what was WIP patch in v1 => patch 16 which ensures block
devices aren't read twice
Michal Prívozník (17):
virfdstream: Use g_autofree in virFDStreamThreadDoRead()
virFDStreamMsgQueuePush: Clear pointer to passed message
virfdstream: Use autoptr for virFDStreamMsg
virfdstream: Use g_new0() instead of VIR_ALLOC()
virfdstream: Use VIR_AUTOCLOSE()
virfdstream: Drop some needless labels
libvirt-storage: Document volume upload/download stream format
virstring: Introduce virStringIsNull()
virfile: Introduce virFileInDataDetectZeroes()
virsh: Pass virshStreamCallbackDataPtr to virshStreamSink() and
virshStreamSkip()
virsh: Track if vol-upload or vol-download work over a block device
virshStreamSkip: Emulate skip for block devices
virfdstream: Allow sparse stream vol-download
virshStreamInData: Handle block devices
virfdstream: Emulate skip for block devices
stream: Don't read block device twice
news: Document sparse streams for block devcies
NEWS.rst | 7 ++
src/libvirt-storage.c | 8 +-
src/libvirt_private.syms | 2 +
src/util/virfdstream.c | 179 ++++++++++++++++++++++-----------------
src/util/virfile.c | 50 +++++++++++
src/util/virfile.h | 5 ++
src/util/virstring.c | 38 +++++++++
src/util/virstring.h | 2 +
tests/virstringtest.c | 47 ++++++++++
tools/virsh-util.c | 90 +++++++++++++++++---
tools/virsh-util.h | 4 +
tools/virsh-volume.c | 23 ++++-
12 files changed, 360 insertions(+), 95 deletions(-)
--
2.26.2
4 years, 4 months
[libvirt PATCH] gitdm: move pld-linux.org to opensource
by Pino Toscano
PLD Linux is a Linux distribution, so @pld-linux.org fits in the
opensource group with similar projects.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
docs/gitdm/groups/opensource | 1 +
docs/gitdm/groups/unaffiliated | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/gitdm/groups/opensource b/docs/gitdm/groups/opensource
index 4ac81e7468..641c1ae3f4 100644
--- a/docs/gitdm/groups/opensource
+++ b/docs/gitdm/groups/opensource
@@ -8,6 +8,7 @@ gnu.org
kernel.org
linux.com
openbsd.org
+pld-linux.org
salasaga.org
samba.org
sdf.org
diff --git a/docs/gitdm/groups/unaffiliated b/docs/gitdm/groups/unaffiliated
index 6e9de7084a..5f867fc5e4 100644
--- a/docs/gitdm/groups/unaffiliated
+++ b/docs/gitdm/groups/unaffiliated
@@ -33,7 +33,6 @@ alexander.nusov(a)nfvexpress.com
andres(a)lagarcavilla.org
andrew(a)interpretmath.pw
asad.saeed(a)acidseed.com
-atler(a)pld-linux.org
benoar(a)dolka.fr
beorn(a)binaries.fr
bigon(a)bigon.be
--
2.26.2
4 years, 4 months
[libvirt PATCH] virsh: guest-agent-timeout: set default value for optional argument
by Tomáš Golembiovský
The timeout argument for guest-agent-timeout is optional but it did not
have proper default value specified. Also update the virsh man page
accordingly.
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
docs/manpages/virsh.rst | 7 ++++---
tools/virsh-domain.c | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 92de0b2192..6e48ae7973 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2631,15 +2631,16 @@ guest
.. code-block::
- guest-agent-timeout domain --timeout value
+ guest-agent-timeout domain [--timeout value]
Set how long to wait for a response from guest agent commands. By default,
agent commands block forever waiting for a response. ``value`` must be a
positive value (wait for given amount of seconds) or one of the following
values:
-* -2 - block forever waiting for a result,
-* -1 - reset timeout to the default value,
+* -2 - block forever waiting for a result (used when --timeout is omitted),
+* -1 - reset timeout to the default value (currently defined as 5 seconds in
+ libvirt daemon),
* 0 - do not wait at all,
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 286cf79671..1f3a549d9a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -14207,7 +14207,7 @@ static bool
cmdGuestAgentTimeout(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
- int timeout;
+ int timeout = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK;
const unsigned int flags = 0;
bool ret = false;
--
2.25.0
4 years, 4 months
[libvirt PATCH] ABOUT-NLS: Drop symlink
by Andrea Bolognani
The ABOUT-NLS symlink pointing to po/README.rst is a leftover
from when we were using autotools as the build system, and now
that we're using Meson we can drop it.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
ABOUT-NLS | 1 -
1 file changed, 1 deletion(-)
delete mode 120000 ABOUT-NLS
diff --git a/ABOUT-NLS b/ABOUT-NLS
deleted file mode 120000
index 91a3266ed6..0000000000
--- a/ABOUT-NLS
+++ /dev/null
@@ -1 +0,0 @@
-po/README.rst
\ No newline at end of file
--
2.26.2
4 years, 4 months
[libvirt PATCH v3] meson: Improve RPATH handling
by Andrea Bolognani
Right now we're unconditionally adding RPATH information to the
installed binaries and libraries, but that's not always desired.
autotools seem to be smart enough to only include that information
when targeting a non-standard prefix, so most distro packages
don't actually contain it; moreover, both Debian and Fedora have
wiki pages encouraging packagers to avoid setting RPATH:
https://wiki.debian.org/RpathIssue
https://fedoraproject.org/wiki/RPath_Packaging_Draft
Implement RPATH logic that Does The Right Thing™ in the most
common cases, while still offering users the ability to override
the default behavior if they have specific needs.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
meson.build | 10 ++++++++++
meson_options.txt | 1 +
src/meson.build | 12 ++++++------
tools/meson.build | 8 ++++----
4 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index a72d0c0e85..d81aceae7a 100644
--- a/meson.build
+++ b/meson.build
@@ -156,6 +156,16 @@ if rc.returncode() == 0
endif
+# Add RPATH information when building for a non-standard prefix, or
+# when explicitly requested to do so
+
+if prefix == '/usr' and not get_option('rpath').enabled()
+ libvirt_rpath = ''
+else
+ libvirt_rpath = libdir
+endif
+
+
# figure out libvirt version strings
arr_version = meson.project_version().split('.')
diff --git a/meson_options.txt b/meson_options.txt
index c538d323c1..79554c3186 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,6 +6,7 @@ option('runstatedir', type: 'string', value: '', description: 'State directory f
option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override')
option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation')
option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
+option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries')
# build dependencies options
diff --git a/src/meson.build b/src/meson.build
index 73ac99f01e..d058cec2e4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -454,7 +454,7 @@ libvirt_qemu_lib = shared_library(
libvirt_qemu_syms_file,
],
install: true,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
@@ -510,7 +510,7 @@ libvirt_lxc_lib = shared_library(
libvirt_lxc_syms_file,
],
install: true,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
@@ -554,7 +554,7 @@ libvirt_admin_lib = shared_library(
libvirt_admin_syms_file,
],
install: true,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
@@ -588,7 +588,7 @@ foreach module : virt_modules
],
install: true,
install_dir: module.get('install_dir', libdir / 'libvirt' / 'connection-driver'),
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
set_variable('@0@_module'.format(module['name'].underscorify()), mod)
endforeach
@@ -633,7 +633,7 @@ foreach daemon : virt_daemons
],
install: true,
install_dir: sbindir,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
endforeach
@@ -661,7 +661,7 @@ foreach helper : virt_helpers
],
install: true,
install_dir: helper.get('install_dir', libexecdir),
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
endforeach
diff --git a/tools/meson.build b/tools/meson.build
index 090179470a..e18adfa7f2 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -75,7 +75,7 @@ if conf.has('WITH_HOST_VALIDATE')
],
install: true,
install_dir: bindir,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
endif
@@ -112,7 +112,7 @@ if conf.has('WITH_LOGIN_SHELL')
],
install: true,
install_dir: libexecdir,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
install_data('virt-login-shell.conf', install_dir: sysconfdir / 'libvirt')
@@ -197,7 +197,7 @@ executable(
],
install: true,
install_dir: bindir,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
executable(
@@ -219,7 +219,7 @@ executable(
],
install: true,
install_dir: bindir,
- install_rpath: libdir,
+ install_rpath: libvirt_rpath,
)
tools_conf = configuration_data()
--
2.26.2
4 years, 4 months
[libvirt PATCH 0/2] Drop some unnecessary files
by Andrea Bolognani
Now that we've switched to Meson, we no longer need to keep
these around.
Andrea Bolognani (2):
ChangeLog: Drop for good
README: Drop symlink
ChangeLog | 15 ---------------
README | 1 -
libvirt.spec.in | 2 +-
3 files changed, 1 insertion(+), 17 deletions(-)
delete mode 100644 ChangeLog
delete mode 120000 README
--
2.26.2
4 years, 4 months
[libvirt PATCH] docs: fix names of some commands
by Tomáš Golembiovský
Some commands were improperly converted from original POD file. Their
names were stripped after first dash.
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
docs/manpages/virsh.rst | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 92de0b2192..5731656b1d 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -498,8 +498,8 @@ in seconds for which the host has to be suspended, it should be at least
60 seconds.
-node
-----
+node-memory-tune
+----------------
**Syntax:**
@@ -600,8 +600,8 @@ source elements to create the pool.
-inject
-------
+inject-nmi
+----------
**Syntax:**
@@ -2624,8 +2624,8 @@ When *--timestamp* is used, a human-readable timestamp will be printed
before the event.
-guest
------
+guest-agent-timeout
+-------------------
**Syntax:**
@@ -7259,8 +7259,8 @@ checkpoint-parent
Output the name of the parent checkpoint, if any, for the given
*checkpoint*.
-checkpoint
-----------
+checkpoint-delete
+-----------------
**Syntax:**
--
2.25.0
4 years, 4 months
[GSoC][PATCH v3 0/8] remove ext. dependencies of domainJobs
by Prathamesh Chavan
Following series of patches deal majorly with moving code
around aimed towards making domain-jobs hypervisor agnostic.
Previous version of this series can be found here[1].
[1]: https://www.redhat.com/archives/libvir-list/2020-August/msg00473.html
Prathamesh Chavan (8):
qemu_domainjob: `qemuDomainJobInfo` code moved to `qemu_domain`
qemu_domain: Added `qemuDomainJobInfo` to domainJob's `privateData`
qemu_domain: Added `qemuDomainJobInfo` to domainJob's `privateData`
qemu_domainjob: callback functions added to access `jobs_queued`
qemu_domainjob: `maxQueuedJobs` added to `qemuDomainJobPrivate`
qemu_domainjob: `qemuDomainJobPrivateJobCallbacks` structure nested
qemu_domainjob: add `saveDomainStatus` as a callback function to jobs
qemu_domainjob: removed reference to `qemuDomainObjPrivatePtr`
src/qemu/qemu_backup.c | 72 +-
src/qemu/qemu_backup.h | 3 +-
src/qemu/qemu_block.c | 45 +-
src/qemu/qemu_block.h | 6 +-
src/qemu/qemu_blockjob.c | 45 +-
src/qemu/qemu_blockjob.h | 3 +-
src/qemu/qemu_checkpoint.c | 29 +-
src/qemu/qemu_domain.c | 625 +++++++++++++++--
src/qemu/qemu_domain.h | 98 ++-
src/qemu/qemu_domainjob.c | 747 ++++----------------
src/qemu/qemu_domainjob.h | 178 ++---
src/qemu/qemu_driver.c | 1127 ++++++++++++++++--------------
src/qemu/qemu_hotplug.c | 319 ++++-----
src/qemu/qemu_hotplug.h | 30 +-
src/qemu/qemu_migration.c | 384 +++++-----
src/qemu/qemu_migration.h | 12 +-
src/qemu/qemu_migration_cookie.c | 15 +-
src/qemu/qemu_migration_params.c | 48 +-
src/qemu/qemu_migration_params.h | 15 +-
src/qemu/qemu_process.c | 306 ++++----
src/qemu/qemu_process.h | 15 +-
tests/qemuhotplugtest.c | 2 +-
22 files changed, 2060 insertions(+), 2064 deletions(-)
--
2.25.1
4 years, 4 months
[GSoC][PATCH v2 0/6] remove dependency of domainJobs on
by Prathamesh Chavan
Following series of patches deal majorly with moving code
around aimed towards making domain-jobs hypervisor agnostic.
Previous version of this series can be found here[1].
[1]: https://www.redhat.com/archives/libvir-list/2020-August/msg00180.html
Prathamesh Chavan (6):
qemu_domain: Added `qemuDomainJobInfo` to domainJob's `privateData`
qemu_domainjob: jobs_queued parameter added to `qemuDomainJobPrivate`
qemu_domainjob: `maxQueuedJobs` added to `qemuDomainJobPrivate`
qemu_domain: funciton declarations moved to correct file
virmigraiton: `qemuMigrationJobPhase` transformed for more generic use
qemu_domainjob: remove dependency on `qemuDomainDiskPrivatePtr`
src/hypervisor/meson.build | 1 +
src/hypervisor/virmigration.c | 41 ++
src/hypervisor/virmigration.h | 38 ++
src/libvirt_private.syms | 4 +
src/qemu/MIGRATION.txt | 8 +-
src/qemu/qemu_backup.c | 22 +-
src/qemu/qemu_domain.c | 653 +++++++++++++++++++++++++++++-
src/qemu/qemu_domain.h | 82 +++-
src/qemu/qemu_domainjob.c | 662 +------------------------------
src/qemu/qemu_domainjob.h | 99 +----
src/qemu/qemu_driver.c | 49 ++-
src/qemu/qemu_migration.c | 135 ++++---
src/qemu/qemu_migration.h | 17 +-
src/qemu/qemu_migration_cookie.c | 8 +-
src/qemu/qemu_process.c | 82 ++--
15 files changed, 1014 insertions(+), 887 deletions(-)
create mode 100644 src/hypervisor/virmigration.c
create mode 100644 src/hypervisor/virmigration.h
--
2.25.1
4 years, 4 months