[libvirt PATCH] ci: jobs.sh: Add back '--no-suite syntax-check --print-errorlogs'
by Erik Skultety
Commit f688a53a converted .gitlab-ci.yml to the usage of ci/jobs.sh
functions, but in doing that our test options
'--no-suite syntax-check --print-errorlogs'
got lost in the process and since commit 8e660c52 didn't introduce them
in the first place, it caused a behavioral regression. This patch adds
them back.
Fixes: 8e660c5286d7e2d07dd61681074bf1555955552d
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Technically this is a build breaker fix, but sending for review anyway to see
if there's an agreement on this approach.
ci/jobs.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ci/jobs.sh b/ci/jobs.sh
index abd695e231..eb4a4e29cf 100644
--- a/ci/jobs.sh
+++ b/ci/jobs.sh
@@ -39,7 +39,10 @@ run_dist() {
}
run_test() {
+ TEST_ARGS="${TEST_ARGS:=--no-suite syntax-check --print-errorlogs}"
+
test -f $GIT_ROOT/build/build.ninja || run_meson_setup
+
run_cmd meson test -C build $TEST_ARGS
}
--
2.41.0
1 year, 7 months
[libvirt PATCH v2 0/5] Add support for vDPA block devices
by Jonathon Jongsma
see https://bugzilla.redhat.com/show_bug.cgi?id=1900770.
Changes in v2:
- Don't use virStorageSource->path for vdpa device path to avoid clashing with
existing path functionality
- Move vdpa device opening to the qemuProcessPrepareHostStorageSource()
function rather than the qemuDomainPrepareStorageSource() function. This
also required some additional support in the tests for setting up the
objects properly for testing.
- rebased to latest master branch
Jonathon Jongsma (5):
conf: add ability to configure a vdpa block disk device
qemu: add virtio-blk-vhost-vdpa capability
qemu: make vdpa connect function more generic
qemu: consider vdpa block devices for memlock limits
qemu: Implement support for vDPA block devices
docs/formatdomain.rst | 19 +++++++++-
src/ch/ch_monitor.c | 1 +
src/conf/domain_conf.c | 8 ++++
src/conf/schemas/domaincommon.rng | 13 +++++++
src/conf/storage_source_conf.c | 7 +++-
src/conf/storage_source_conf.h | 2 +
src/libxl/xen_xl.c | 1 +
src/qemu/qemu_block.c | 20 ++++++++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 24 +++++++++++-
src/qemu/qemu_command.h | 1 +
src/qemu/qemu_domain.c | 12 +++++-
src/qemu/qemu_interface.c | 23 ------------
src/qemu/qemu_interface.h | 2 -
src/qemu/qemu_migration.c | 2 +
src/qemu/qemu_process.c | 34 +++++++++++++++++
src/qemu/qemu_snapshot.c | 4 ++
src/qemu/qemu_validate.c | 33 +++++++++++++++--
src/storage_file/storage_source.c | 1 +
.../caps_8.1.0_x86_64.xml | 1 +
tests/qemuhotplugmock.c | 4 +-
.../disk-vhostvdpa.x86_64-latest.args | 37 +++++++++++++++++++
tests/qemuxml2argvdata/disk-vhostvdpa.xml | 21 +++++++++++
tests/qemuxml2argvmock.c | 2 +-
tests/qemuxml2argvtest.c | 34 +++++++++++++++++
tests/testutilsqemu.c | 11 ++++++
tests/testutilsqemu.h | 2 +
28 files changed, 285 insertions(+), 37 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-vhostvdpa.xml
--
2.41.0
1 year, 7 months
[libvirt PATCH v2 00/35] ci: Unify the GitLab CI jobs with local executions && adopt lcitool container executions
by Erik Skultety
since v2 [1]:
- moved the custom meson.build directory check before running setup to
individual callers for better robustness, but actually let meson deal with an
existing setup directory most of the time
- drops the ci/Makefile
- only set our verbose env variables when running without a TTY
- switched the bright yellow (93m) color to green (32m)
- added KeyboardInterrupt handling in the ci/helper Python code
The changes above require the following lcitool MR to be merged first as
they're built on top of it [2]
[1] https://listman.redhat.com/archives/libvir-list/2023-August/241471.html
[2] https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/431
Erik Skultety (35):
ci: build.sh: Add variables from .gitlab-ci.yml
ci: build.sh: Add GIT_ROOT env helper variable
ci: build.sh: Don't mention that MESON_ARGS are available via CLI
ci: build.sh: Add a wrapper function executing 'shell' commands
ci: build.sh: Add a wrapper function over meson's setup
ci: build.sh: Add a wrapper function over the 'build' job
ci: build.sh: Add a helper function to create the dist tarball
ci: build.sh: Add a wrapper function over the 'test' job
ci: build.sh: Add a wrapper function over the 'codestyle' job
ci: build.sh: Add a wrapper function over the 'potfile' job
ci: build.sh: Add a wrapper function over the 'rpmbuild' job
ci: build.sh: Add a wrapper function over the 'website' job
ci: build.sh: Drop changing working directory to CI_CONT_DIR
ci: build.sh: Drop direct invocation of meson/ninja commands
ci: build.sh: Drop MESON_ARGS definition from global level
ci: Rename build.sh -> jobs.sh
.gitlab-ci.yml: Add 'after_script' stage to prep for artifact
collection
.gitlab-ci.yml: Convert the native build job to the build.sh usage
.gitlab-ci.yml: Convert the cross build job to the build.sh usage
.gitlab-ci.yml: Convert the website build job to the build.sh usage
.gitlab-ci.yml: Convert the codestyle job to the build.sh usage
.gitlab-ci.yml: Convert the potfile job to the build.sh usage
ci: helper: Drop _lcitool_get_targets method
ci: helper: Don't make ':' literal a static part of the image tag
ci: helper: Add --lcitool-path CLI option
ci: helper: Add a required_deps higher order helper/decorator
ci: helper: Add Python code hangling git clones
ci: helper: Add a helper to create a local repo clone Pythonic way
ci: helper: Rework _lcitool_run method logic
ci: helper: Add an action to run the container workload via lcitool
ci: helper: Add a job argparse subparser
ci: helper: Drop original actions
ci: helper: Drop the --meson-args/--ninja-args CLI options
ci: helper: Drop the _make_run method
ci: Drop the now unused Makefile
.gitlab-ci.yml | 47 +++++-----
ci/Makefile | 245 -------------------------------------------------
ci/build.sh | 23 -----
ci/helper | 181 +++++++++++++++++++++---------------
ci/jobs.sh | 79 ++++++++++++++++
5 files changed, 211 insertions(+), 364 deletions(-)
delete mode 100644 ci/Makefile
delete mode 100644 ci/build.sh
create mode 100644 ci/jobs.sh
--
2.41.0
1 year, 7 months
[PATCH (pushed)] virStorageSourceClear: Clear 'vdpadev' field
by Peter Krempa
Release memory for the recently added field.
Fixes: 1df106cc20a4cc6417cfbaf01860f465ec3dd915
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/storage_source_conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c
index f57cb3241d..f7f62c3966 100644
--- a/src/conf/storage_source_conf.c
+++ b/src/conf/storage_source_conf.c
@@ -1143,6 +1143,7 @@ virStorageSourceClear(virStorageSource *def)
VIR_FREE(def->path);
VIR_FREE(def->fdgroup);
VIR_FREE(def->volume);
+ VIR_FREE(def->vdpadev);
VIR_FREE(def->snapshot);
VIR_FREE(def->configFile);
VIR_FREE(def->query);
--
2.41.0
1 year, 7 months
[libvirt PATCH v4] ch: Fix cloud-hypervisor version processing
by Praveen K Paladugu
Refactor the version processing logic in ch driver to support versions
from non-release cloud-hypervisor binaries. This version also supports
versions with branch prefixes in them.
Signed-off-by: Praveen K Paladugu <prapal(a)linux.microsoft.com>
---
src/ch/ch_conf.c | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c
index a8565d9537..f421af5121 100644
--- a/src/ch/ch_conf.c
+++ b/src/ch/ch_conf.c
@@ -172,6 +172,29 @@ virCHDriverConfigDispose(void *obj)
#define MIN_VERSION ((15 * 1000000) + (0 * 1000) + (0))
+/**
+ * chPreProcessVersionString:
+ *
+ * Returns: a pointer to numerical version without branch/commit info
+ */
+static char *
+chPreProcessVersionString(char *version)
+{
+ char *tmp = strrchr(version, '/');
+
+ if (tmp)
+ version = tmp + 1;
+
+ if (version[0] == 'v')
+ version++;
+
+ tmp = strchr(version, '-');
+ if (tmp)
+ *tmp = '\0';
+
+ return version;
+}
+
int
chExtractVersion(virCHDriver *driver)
{
@@ -193,13 +216,20 @@ chExtractVersion(virCHDriver *driver)
tmp = help;
- /* expected format: cloud-hypervisor v<major>.<minor>.<micro> */
- if ((tmp = STRSKIP(tmp, "cloud-hypervisor v")) == NULL) {
+ /* Below are example version formats and expected outputs:
+ * cloud-hypervisor v32.0.0 (expected: 32.0.0)
+ * cloud-hypervisor v33.0-104-ge0e3779e-dirty (expected: 33.0)
+ * cloud-hypervisor testing/v32.0.131-1-ga5d6db5c-dirty (expected: 32.0.131)
+ */
+ if ((tmp = STRSKIP(tmp, "cloud-hypervisor ")) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unexpected output of cloud-hypervisor binary"));
return -1;
}
+ tmp = chPreProcessVersionString(tmp);
+ VIR_DEBUG("Cloud-Hypervisor version detected: %s", tmp);
+
if (virStringParseVersion(&version, tmp, true) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse cloud-hypervisor version: %1$s"), tmp);
--
2.41.0
1 year, 7 months
[PATCH v2] interface: fix udev_device_get_sysattr_value return value check
by Dmitry Frolov
Reviewing the code I found that return value of function
udev_device_get_sysattr_value() is dereferenced without a check.
udev_device_get_sysattr_value() may return NULL by number of reasons.
v2: VIR_DEBUG added, replaced STREQ(NULLSTR()) with STREQ_NULLABLE()
Signed-off-by: Dmitry Frolov <frolov(a)swemel.ru>
---
src/interface/interface_backend_udev.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index a0485ddd21..df7066727e 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -23,6 +23,7 @@
#include <dirent.h>
#include <libudev.h>
+#include "virlog.h"
#include "virerror.h"
#include "virfile.h"
#include "datatypes.h"
@@ -40,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_INTERFACE
+VIR_LOG_INIT("interface.interface_backend_udev");
+
struct udev_iface_driver {
struct udev *udev;
/* pid file FD, ensures two copies of the driver can't use the same root */
@@ -355,10 +358,13 @@ udevConnectListAllInterfaces(virConnectPtr conn,
g_autoptr(virInterfaceDef) def = NULL;
path = udev_list_entry_get_name(dev_entry);
- dev = udev_device_new_from_syspath(udev, path);
+ if (!(dev = udev_device_new_from_syspath(udev, path))) {
+ VIR_DEBUG("Skipping interface '%s'", NULLSTR(path));
+ continue;
+ }
name = udev_device_get_sysname(dev);
macaddr = udev_device_get_sysattr_value(dev, "address");
- status = STREQ(udev_device_get_sysattr_value(dev, "operstate"), "up");
+ status = STREQ_NULLABLE(udev_device_get_sysattr_value(dev, "operstate"), "up");
def = udevGetMinimalDefForDevice(dev);
if (!virConnectListAllInterfacesCheckACL(conn, def)) {
@@ -964,9 +970,9 @@ udevGetIfaceDef(struct udev *udev, const char *name)
/* MTU */
mtu_str = udev_device_get_sysattr_value(dev, "mtu");
- if (virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) {
+ if (!mtu_str || virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse MTU value '%1$s'"), mtu_str);
+ _("Could not parse MTU value '%1$s'"), NULLSTR(mtu_str));
goto error;
}
ifacedef->mtu = mtu;
@@ -1089,7 +1095,7 @@ udevInterfaceIsActive(virInterfacePtr ifinfo)
goto cleanup;
/* Check if it's active or not */
- status = STREQ(udev_device_get_sysattr_value(dev, "operstate"), "up");
+ status = STREQ_NULLABLE(udev_device_get_sysattr_value(dev, "operstate"), "up");
udev_device_unref(dev);
--
2.34.1
1 year, 7 months
[libvirt PATCH 0/5] Add support for vDPA block devices
by Jonathon Jongsma
see https://bugzilla.redhat.com/show_bug.cgi?id=1900770.
Jonathon Jongsma (5):
conf: add ability to configure a vdpa block disk device
qemu: add virtio-blk-vhost-vdpa capability
qemu: make vdpa connect function more generic
qemu: consider vdpa block devices for memlock limits
qemu: Implement support for vDPA block devices
docs/formatdomain.rst | 19 ++++++++-
src/ch/ch_monitor.c | 1 +
src/conf/domain_conf.c | 7 ++++
src/conf/schemas/domaincommon.rng | 13 +++++++
src/conf/storage_source_conf.c | 6 ++-
src/conf/storage_source_conf.h | 1 +
src/libxl/xen_xl.c | 1 +
src/qemu/qemu_block.c | 20 ++++++++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 24 +++++++++++-
src/qemu/qemu_command.h | 1 +
src/qemu/qemu_domain.c | 37 +++++++++++++++++-
src/qemu/qemu_interface.c | 23 -----------
src/qemu/qemu_interface.h | 2 -
src/qemu/qemu_migration.c | 2 +
src/qemu/qemu_snapshot.c | 4 ++
src/qemu/qemu_validate.c | 45 +++++++++++++++++++---
src/storage_file/storage_source.c | 1 +
tests/qemuhotplugmock.c | 4 +-
tests/qemuxml2argvdata/disk-vhostvdpa.args | 35 +++++++++++++++++
tests/qemuxml2argvdata/disk-vhostvdpa.xml | 21 ++++++++++
tests/qemuxml2argvmock.c | 2 +-
tests/qemuxml2argvtest.c | 2 +
24 files changed, 235 insertions(+), 39 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-vhostvdpa.args
create mode 100644 tests/qemuxml2argvdata/disk-vhostvdpa.xml
--
2.40.1
1 year, 7 months
[PATCH] interface: fix udev_device_get_sysattr_value return value check
by Dmitry Frolov
Reviewing the code I found that return value of function
udev_device_get_sysattr_value() is dereferenced without a check.
udev_device_get_sysattr_value() may return NULL by number of reasons.
Signed-off-by: Dmitry Frolov <frolov(a)swemel.ru>
---
src/interface/interface_backend_udev.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index a0485ddd21..c820b3ccdf 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -355,10 +355,11 @@ udevConnectListAllInterfaces(virConnectPtr conn,
g_autoptr(virInterfaceDef) def = NULL;
path = udev_list_entry_get_name(dev_entry);
- dev = udev_device_new_from_syspath(udev, path);
+ if (!(dev = udev_device_new_from_syspath(udev, path)))
+ continue;
name = udev_device_get_sysname(dev);
macaddr = udev_device_get_sysattr_value(dev, "address");
- status = STREQ(udev_device_get_sysattr_value(dev, "operstate"), "up");
+ status = STREQ(NULLSTR(udev_device_get_sysattr_value(dev, "operstate")), "up");
def = udevGetMinimalDefForDevice(dev);
if (!virConnectListAllInterfacesCheckACL(conn, def)) {
@@ -964,9 +965,9 @@ udevGetIfaceDef(struct udev *udev, const char *name)
/* MTU */
mtu_str = udev_device_get_sysattr_value(dev, "mtu");
- if (virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) {
+ if (!mtu_str || virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse MTU value '%1$s'"), mtu_str);
+ _("Could not parse MTU value '%1$s'"), NULLSTR(mtu_str));
goto error;
}
ifacedef->mtu = mtu;
@@ -1089,7 +1090,7 @@ udevInterfaceIsActive(virInterfacePtr ifinfo)
goto cleanup;
/* Check if it's active or not */
- status = STREQ(udev_device_get_sysattr_value(dev, "operstate"), "up");
+ status = STREQ(NULLSTR(udev_device_get_sysattr_value(dev, "operstate")), "up");
udev_device_unref(dev);
--
2.34.1
1 year, 7 months