[libvirt PATCH 0/2] qemu: QEMU_AUDIO_DRV fixes and cleanups
by Andrea Bolognani
Andrea Bolognani (2):
qemu: Correctly translate QEMU_AUDIO_DRV=wav
qemu: Drop qemuAudioDriver enumeration
src/qemu/qemu_command.c | 46 +++++++++++++++++++++++++++++------------
src/qemu/qemu_command.h | 3 +++
src/qemu/qemu_domain.c | 16 ++++----------
3 files changed, 40 insertions(+), 25 deletions(-)
--
2.34.1
2 years, 10 months
[libvirt PATCH 0/4] move virParseVersionString to virstring.c
by Ján Tomko
And clean up some includes while doing it.
Ján Tomko (4):
maint: add required includes
util: virParseVersionString: move to virstring.c
virParseVersionString: rename to virStringParseVersion
maint: remove unnecessary virutil.h includes
src/bhyve/bhyve_driver.c | 2 +-
src/ch/ch_conf.c | 2 +-
src/esx/esx_vi.c | 9 ++---
src/libvirt_private.syms | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 6 +--
src/openvz/openvz_conf.c | 3 +-
src/util/virdnsmasq.c | 3 +-
src/util/virfirewalld.c | 4 +-
src/util/virstring.c | 48 +++++++++++++++++++++++
src/util/virstring.h | 4 ++
src/util/virutil.c | 46 ----------------------
src/util/virutil.h | 3 --
src/vbox/vbox_common.c | 2 +-
src/vmware/vmware_conf.c | 3 +-
src/vz/vz_utils.c | 2 +-
tests/testutilsqemu.c | 3 +-
tests/utiltest.c | 2 +-
tools/virt-host-validate-common.c | 2 +-
19 files changed, 73 insertions(+), 75 deletions(-)
--
2.34.1
2 years, 10 months
[libvirt PATCH] qemu: virtiofs: check whether the supplied binary exists
by Ján Tomko
Report an error upfront if the binary does not exist
or is not executable.
https://bugzilla.redhat.com/show_bug.cgi?id=1999372
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_virtiofs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index 1b853a5a59..7e3324b017 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -184,6 +184,13 @@ qemuVirtioFSStart(virQEMUDriver *driver,
VIR_AUTOCLOSE logfd = -1;
int rc;
+ if (!virFileIsExecutable(fs->binary)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("virtiofsd binary '%s' is not executable"),
+ fs->binary);
+ return -1;
+ }
+
if (!virFileExists(fs->src->path)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("the virtiofs export directory '%s' does not exist"),
--
2.31.1
2 years, 10 months
[libvirt PATCH v5 0/7] cgroup and thread management in ch driver
by Praveen K Paladugu
This patchset adds support for cgroup management of ch threads. This version
correctly manages cgroups for vcpu and emulator threads created by ch. cgroup
management for iothreads is not yet supported.
Along with cgroup management, this patchset also enables support for pinning
vcpu and emulator threads to selected host cpus.
v5:
* bumped the verion of callbacks in ch driver to 8.1.0
v4:
* addressed all open comments in v3
* dropped all the merged commits
v3:
* addrressed all the formatting comments in v2 patch set
* dropped indentation patches are they do not adhere to libvirt coding style
* fixed build issue in qemu driver that was introduced in v2
Praveen K Paladugu (3):
qemu,hypervisor: refactor some cgroup mgmt methods
ch_process: Setup emulator and iothread settings
ch_driver: emulator threadinfo & pinning callbacks
Vineeth Pillai (4):
ch: methods for cgroup mgmt in ch driver
ch_driver,ch_domain: vcpupin callback in ch driver
ch_driver: enable typed param string for numatune
ch_driver: add numatune callbacks for CH driver
src/ch/ch_conf.c | 2 +
src/ch/ch_conf.h | 4 +-
src/ch/ch_domain.c | 64 ++++
src/ch/ch_domain.h | 18 +-
src/ch/ch_driver.c | 590 +++++++++++++++++++++++++++++++++
src/ch/ch_monitor.c | 156 +++++++++
src/ch/ch_monitor.h | 56 +++-
src/ch/ch_process.c | 385 ++++++++++++++++++++-
src/ch/ch_process.h | 3 +
src/hypervisor/domain_cgroup.c | 457 ++++++++++++++++++++++++-
src/hypervisor/domain_cgroup.h | 72 ++++
src/libvirt_private.syms | 14 +-
src/qemu/qemu_cgroup.c | 413 +----------------------
src/qemu/qemu_cgroup.h | 11 -
src/qemu/qemu_driver.c | 14 +-
src/qemu/qemu_hotplug.c | 7 +-
src/qemu/qemu_process.c | 24 +-
17 files changed, 1835 insertions(+), 455 deletions(-)
--
2.27.0
2 years, 10 months
[PATCH 0/4] Couple of misc cleanups
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (4):
test_driver: Don't leak @group_name
lib: Don't set variable to NULL after VIR_FREE()
virpcivpdtest: Fix potential double-free()
src: Use g_steal_pointer() more
src/conf/domain_conf.c | 1 -
src/conf/nwfilter_conf.c | 1 -
src/esx/esx_vi.c | 6 ++----
src/hyperv/hyperv_driver.c | 8 +++-----
src/hyperv/hyperv_wmi.c | 3 +--
src/hypervisor/virhostdev.c | 3 +--
src/libxl/xen_common.c | 12 ++++--------
src/qemu/qemu_hotplug.c | 6 ++----
src/qemu/qemu_migration.c | 9 +++------
src/storage/storage_backend_gluster.c | 9 +++------
src/storage/storage_util.c | 6 ++----
src/test/test_driver.c | 1 -
src/util/virfile.c | 3 +--
src/util/virlease.c | 3 +--
src/util/virnuma.c | 9 +++------
tests/virpcivpdtest.c | 4 +++-
tests/virtypedparamtest.c | 1 -
17 files changed, 29 insertions(+), 56 deletions(-)
--
2.34.1
2 years, 10 months
[PATCH v2] docs: expand firmware descriptor to allow flash without NVRAM
by Daniel P. Berrangé
The current firmware descriptor schema for flash requires that both the
executable to NVRAM template paths be provided. This is fine for the
most common usage of EDK2 builds in virtualization where the separate
_CODE and _VARS files are provided.
With confidential computing technology like AMD SEV, persistent storage
of variables may be completely disabled because the firmware requires a
known clean state on every cold boot. There is no way to express this
in the firmware descriptor today.
Even with regular EDK2 builds it is possible to create a firmware that
has both executable code and variable persistence in a single file. This
hasn't been commonly used, since it would mean every guest bootup would
need to clone the full firmware file, leading to redundant duplicate
storage of the code portion. In some scenarios this may not matter and
might even be beneficial. For example if a public cloud allows users to
bring their own firmware, such that the user can pre-enroll their own
secure boot keys, you're going to have this copied on disk for each
tenant already. At this point the it can be simpler to just deal with
a single file rather than split builds. The firmware descriptor ought
to be able to express this combined firmware model too.
This all points towards expanding the schema for flash with a 'mode'
concept:
- "split" - the current implicit behaviour with separate files
for code and variables.
- "combined" - the alternate behaviour where a single file contains
both code and variables.
- "stateless" - the confidential computing use case where storage
of variables is completely disable, leaving only the code.
Reviewed-by: Philippe Mathieu-Daudé <f4bug(a)amsat.org>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/interop/firmware.json | 54 ++++++++++++++++++++++++++++++++------
1 file changed, 46 insertions(+), 8 deletions(-)
In v2:
- Mark 'mode' as optional field
- Misc typos in docs
diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 8d8b0be030..f5d1d0b6e7 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -210,24 +210,61 @@
'data' : { 'filename' : 'str',
'format' : 'BlockdevDriver' } }
+
+##
+# @FirmwareFlashType:
+#
+# Describes how the firmware build handles code versus variable
+# persistence.
+#
+# @split: the executable file contains code while the NVRAM
+# template provides variable storage. The executable
+# must be configured read-only and can be shared between
+# multiple guests. The NVRAM template must be cloned
+# for each new guest and configured read-write.
+#
+# @combined: the executable file contains both code and
+# variable storage. The executable must be cloned
+# for each new guest and configured read-write.
+# No NVRAM template will be specified.
+#
+# @stateless: the executable file contains code and variable
+# storage is not persisted. The executed must
+# be configured read-only and can be shared
+# between multiple guests. No NVRAM template
+# will be specified.
+#
+# Since: 7.0.0
+##
+{ 'enum': 'FirmwareFlashMode',
+ 'data': [ 'split', 'combined', 'stateless' ] }
+
##
# @FirmwareMappingFlash:
#
# Describes loading and mapping properties for the firmware executable
# and its accompanying NVRAM file, when @FirmwareDevice is @flash.
#
-# @executable: Identifies the firmware executable. The firmware
-# executable may be shared by multiple virtual machine
-# definitions. The preferred corresponding QEMU command
-# line options are
+# @mode: describes how the firmware build handles code versus variable
+# storage. If not present, it must be treated as if it was
+# configured with value ``split``. Since: 7.0.0
+#
+# @executable: Identifies the firmware executable. The @mode
+# indicates whether there will be an associated
+# NVRAM template present. The preferred
+# corresponding QEMU command line options are
# -drive if=none,id=pflash0,readonly=on,file=@executable.@filename,format=@executable.(a)format
# -machine pflash0=pflash0
-# or equivalent -blockdev instead of -drive.
+# or equivalent -blockdev instead of -drive. When
+# @mode is ``combined`` the executable must be
+# cloned before use and configured with readonly=off.
# With QEMU versions older than 4.0, you have to use
# -drive if=pflash,unit=0,readonly=on,file=@executable.@filename,format=@executable.(a)format
#
# @nvram-template: Identifies the NVRAM template compatible with
-# @executable. Management software instantiates an
+# @executable, when @mode is set to ``split``,
+# otherwise it should not be present.
+# Management software instantiates an
# individual copy -- a specific NVRAM file -- from
# @nvram-template.@filename for each new virtual
# machine definition created. @nvram-template.@filename
@@ -246,8 +283,9 @@
# Since: 3.0
##
{ 'struct' : 'FirmwareMappingFlash',
- 'data' : { 'executable' : 'FirmwareFlashFile',
- 'nvram-template' : 'FirmwareFlashFile' } }
+ 'data' : { '*mode': 'FirmwareFlashMode',
+ 'executable' : 'FirmwareFlashFile',
+ '*nvram-template' : 'FirmwareFlashFile' } }
##
# @FirmwareMappingKernel:
--
2.34.1
2 years, 10 months
[libvirt PATCH] tests: refactor testSELinuxLoadDef
by Ján Tomko
Since its introduction in
commit 907a39e735d256b8428ed4c77009d1f713aea19b
Add a test suite for validating SELinux labelling
this function did not return NULL on OOM.
Since we abort on OOM now, switch testSELinuxMungePath to void,
return NULL explicitly on XML parsing failure and remove
the (now pointless) cleanup label.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
tests/securityselinuxlabeltest.c | 35 +++++++++++---------------------
1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 09902e1c54..b62162fe9f 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -82,16 +82,12 @@ testUserXattrEnabled(void)
return ret;
}
-static int
+static void
testSELinuxMungePath(char **path)
{
- char *tmp;
-
- tmp = g_strdup_printf("%s/securityselinuxlabeldata%s", abs_builddir, *path);
-
- VIR_FREE(*path);
+ char *tmp = g_strdup_printf("%s/securityselinuxlabeldata%s", abs_builddir, *path);
+ g_free(*path);
*path = tmp;
- return 0;
}
static int
@@ -154,7 +150,7 @@ testSELinuxLoadFileList(const char *testname,
static virDomainDef *
testSELinuxLoadDef(const char *testname)
{
- char *xmlfile = NULL;
+ g_autofree char *xmlfile = NULL;
virDomainDef *def = NULL;
size_t i;
@@ -163,15 +159,14 @@ testSELinuxLoadDef(const char *testname)
if (!(def = virDomainDefParseFile(xmlfile, driver.xmlopt,
NULL, 0)))
- goto cleanup;
+ return NULL;
for (i = 0; i < def->ndisks; i++) {
if (def->disks[i]->src->type != VIR_STORAGE_TYPE_FILE &&
def->disks[i]->src->type != VIR_STORAGE_TYPE_BLOCK)
continue;
- if (testSELinuxMungePath(&def->disks[i]->src->path) < 0)
- goto cleanup;
+ testSELinuxMungePath(&def->disks[i]->src->path);
}
for (i = 0; i < def->nserials; i++) {
@@ -182,23 +177,17 @@ testSELinuxLoadDef(const char *testname)
continue;
if (def->serials[i]->source->type == VIR_DOMAIN_CHR_TYPE_UNIX) {
- if (testSELinuxMungePath(&def->serials[i]->source->data.nix.path) < 0)
- goto cleanup;
+ testSELinuxMungePath(&def->serials[i]->source->data.nix.path);
} else {
- if (testSELinuxMungePath(&def->serials[i]->source->data.file.path) < 0)
- goto cleanup;
+ testSELinuxMungePath(&def->serials[i]->source->data.file.path);
}
}
- if (def->os.kernel &&
- testSELinuxMungePath(&def->os.kernel) < 0)
- goto cleanup;
- if (def->os.initrd &&
- testSELinuxMungePath(&def->os.initrd) < 0)
- goto cleanup;
+ if (def->os.kernel)
+ testSELinuxMungePath(&def->os.kernel);
+ if (def->os.initrd)
+ testSELinuxMungePath(&def->os.initrd);
- cleanup:
- VIR_FREE(xmlfile);
return def;
}
--
2.34.1
2 years, 10 months
[libvirt PATCH 0/4] libxl: clean up more LIBXL_HAVE constants
by Ján Tomko
We still were checking for some that were introduced before Xen 4.9
Ján Tomko (4):
libxl: assume LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
libxl: remove LIBXL_ATTR_UNUSED
libxl: assume LIBXL_HAVE_SRM_V2
libxl: assume LIBXL_HAVE_PVUSB
src/libxl/libxl_conf.c | 20 ++------------------
src/libxl/libxl_conf.h | 13 +------------
2 files changed, 3 insertions(+), 30 deletions(-)
--
2.34.1
2 years, 10 months
[libvirt PATCH] syntax-check: https: list the HTTP-only sites
by Ján Tomko
Instead of listing the sites that surely support HTTPS,
list the ones that don't.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
build-aux/syntax-check.mk | 66 ++++++++++++++++++++++++++++++++-------
1 file changed, 54 insertions(+), 12 deletions(-)
diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 4d396699c9..d5cdb3c70e 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -874,20 +874,62 @@ sc_prohibit_obj_free_apis_in_virsh:
halt='avoid using public virXXXFree in virsh, use virsh-prefixed wrappers instead' \
$(_sc_search_regexp)
-https_sites = www.libvirt.org
-https_sites += libvirt.org
-https_sites += security.libvirt.org
-https_sites += qemu.org
-https_sites += www.qemu.org
-https_sites += wiki.qemu.org
-https_sites += linux-kvm.org
-https_sites += www.linux-kvm.org
-
-https_re= ($(subst $(space),|,$(https_sites)))
+# Links in various schemas
+http_sites = libvirt.org.*\/schemas\/
+http_sites += \.dtd
+http_sites += libosinfo
+http_sites += localhost
+http_sites += rdf:resource
+http_sites += schemas.dmtf.org
+http_sites += schemas.microsoft.com
+http_sites += schemas.xmlsoap.org
+http_sites += www.inkscape.org
+http_sites += www.innotek.de
+http_sites += www.w3.org
+http_sites += xmlns
+
+# Links in licenses
+http_sites += scripts.sil.org
+http_sites += www.gnu.org\/licenses\/
+http_sites += www.sun.com
+
+# Example links
+http_sites += example.com
+http_sites += example.org
+http_sites += herp.derp
+
+# HTTP-only sites
+http_sites += 0pointer.de
+http_sites += mah.everybody.org
+http_sites += mingw.org
+http_sites += munin.projects.linpro.no
+http_sites += netcat.sourceforge.net
+http_sites += snooze.inria.fr
+http_sites += www.nimbusproject.org
+http_sites += www.odin.com
+http_sites += www.sflow.net
+http_sites += xmlsoft.org
+http_sites += etallen.com
+
+# dead sites
+http_sites += blog.lystor.org.ua
+http_sites += blog.mes-stats.fr
+http_sites += cc1.ifj.edu.pl
+http_sites += www.javvin.com
+
+# 404 links
+http_sites += publib.boulder.ibm.com
+http_sites += kerneltrap.org
+http_sites += valloric.github.io
+http_sites += www.microsoft.com
+http_sites += xenbits.xen.org
+http_sites += lovezutto.googlepages.com
+
+http_re= ($(subst $(space),|,$(http_sites)))
sc_prohibit_http_urls:
- @prohibit='http://$(https_re)' \
- exclude="/schemas/" \
+ @prohibit='http://\w' \
+ exclude="$(http_re)" \
halt='Links must use https:// protocol' \
$(_sc_search_regexp)
--
2.34.1
2 years, 10 months
[libvirt PATCH] qemu_firmware: don't error out for unknown firmware features
by Pavel Hrdina
When QEMU introduces new firmware features libvirt will fail until we
list that feature in our code as well which doesn't sound right.
We should simply ignore the new feature until we add a proper support
for it.
Reported-by: Laszlo Ersek <lersek(a)redhat.com>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_firmware.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 94e88ebe4b..e37a7edefa 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -567,6 +567,7 @@ qemuFirmwareFeatureParse(const char *path,
virJSONValue *featuresJSON;
g_autoptr(qemuFirmwareFeature) features = NULL;
size_t nfeatures;
+ size_t nparsed = 0;
size_t i;
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
@@ -586,17 +587,16 @@ qemuFirmwareFeatureParse(const char *path,
int tmp;
if ((tmp = qemuFirmwareFeatureTypeFromString(tmpStr)) <= 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown feature %s"),
- tmpStr);
- return -1;
+ VIR_DEBUG("unknown feature %s", tmpStr);
+ continue;
}
- features[i] = tmp;
+ features[nparsed] = tmp;
+ nparsed++;
}
fw->features = g_steal_pointer(&features);
- fw->nfeatures = nfeatures;
+ fw->nfeatures = nparsed;
return 0;
}
--
2.30.2
2 years, 10 months