[libvirt PATCH v2 0/4] qemu: Only raise memlock limit if necessary
by Andrea Bolognani
This feature has been requested by KubeVirt developers and will make
it possible for them to make some VFIO-related features, such as
migration and hotplug, work correctly.
https://bugzilla.redhat.com/show_bug.cgi?id=1916346
Changes from [v1]:
* prep patches have been pushed;
* parsing /proc file is now explicitly restricted to Linux only
and only uses safe libvirt helpers;
* the qemu.conf knob has been dropped in favor of adopting a
behavior that should work correctly in all scenarios.
[v1] https://listman.redhat.com/archives/libvir-list/2021-March/msg00293.html
Andrea Bolognani (4):
util: Try to get limits from /proc
qemu: Don't ignore virProcessGetMaxMemLock() errors
qemu: Refactor qemuDomainAdjustMaxMemLock()
qemu: Only raise memlock limit if necessary
src/qemu/qemu_domain.c | 36 +++++++++------
src/util/virprocess.c | 102 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+), 13 deletions(-)
--
2.26.2
3 years, 8 months
[PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add
by Kevin Wolf
This series adds a QAPI type for the properties of all user creatable
QOM types and finally makes the --object command line option (in all
binaries) and the object-add monitor commands (in QMP and HMP) use the
new ObjectOptions union.
This change improves things in more than just one way:
1. Documentation for QOM object types has always been lacking. Adding
the schema, we get documentation for every property.
2. It prevents bugs by performing parts of the input validation (e.g.
checking presence of mandatory properties) already in QAPI instead of
relying on separate manual implementations in each class.
3. It provides QAPI introspection for user creatable objects.
4. Non-scalar properties are now supported everywhere because the
command line parsers (including HMP) use the keyval parser now.
If you are in the CC list and didn't expect this series, it's probably
because you're the maintainer of one of the objects for which I'm adding
a QAPI schema description. Please just have a look at the specific patch
for your object and check whether the schema and its documentation make
sense to you. You can ignore all other patches.
In a next step after this series, we can add make use of the QAPI
structs in the implementation of the object and separate their
configuration from the runtime state. Specifically, the plan is to
add a .configure() callback to ObjectClass that allows configuring the
object in one place at creation time and keeping QOM property setters
only for properties that can actually be changed at runtime. Paolo made
an example of what the state could look like after this:
https://wiki.qemu.org/Features/QOM-QAPI_integration
Finally, the intention is to extend the QAPI schema to have separate
'object' entities and generate some of the code that was written
manually in the intermediate state before.
This series is available as a git tag at:
https://repo.or.cz/qemu/kevin.git qapi-object-v3
v3:
- Removed now useless QAuthZListRuleListHack
- Made some more ObjectOptions branches conditional
- Improved documentation for some properties
- Fixed 'qemu-img compare' exit code for option parsing failure
v2:
- Convert not only object-add, but all external interfaces so that the
schema will always be enforced and mismatch between implementation and
schema can't go unnoticed.
- Rebased, covering properties and object types added since v1 (yes,
things do become outdated rather quickly when you touch all user
creatable objects)
- Changed the "Since:" version number in the schema documentation to
refer to the version when the object was introduced rather than 6.0
where the schema will (hopefully) be added
- Probably some other minor changes
Kevin Wolf (30):
qapi/qom: Drop deprecated 'props' from object-add
qapi/qom: Add ObjectOptions for iothread
qapi/qom: Add ObjectOptions for authz-*
qapi/qom: Add ObjectOptions for cryptodev-*
qapi/qom: Add ObjectOptions for dbus-vmstate
qapi/qom: Add ObjectOptions for memory-backend-*
qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'
qapi/qom: Add ObjectOptions for throttle-group
qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'
qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'
qapi/qom: Add ObjectOptions for can-*
qapi/qom: Add ObjectOptions for colo-compare
qapi/qom: Add ObjectOptions for filter-*
qapi/qom: Add ObjectOptions for pr-manager-helper
qapi/qom: Add ObjectOptions for confidential-guest-support
qapi/qom: Add ObjectOptions for input-*
qapi/qom: Add ObjectOptions for x-remote-object
qapi/qom: QAPIfy object-add
qom: Make "object" QemuOptsList optional
qemu-storage-daemon: Implement --object with qmp_object_add()
qom: Remove user_creatable_add_dict()
qom: Factor out user_creatable_process_cmdline()
qemu-io: Use user_creatable_process_cmdline() for --object
qemu-nbd: Use user_creatable_process_cmdline() for --object
qom: Add user_creatable_add_from_str()
qemu-img: Use user_creatable_process_cmdline() for --object
hmp: QAPIfy object_add
qom: Add user_creatable_parse_str()
vl: QAPIfy -object
qom: Drop QemuOpts based interfaces
qapi/authz.json | 61 ++-
qapi/block-core.json | 27 ++
qapi/common.json | 52 +++
qapi/crypto.json | 159 +++++++
qapi/machine.json | 22 +-
qapi/net.json | 20 -
qapi/qom.json | 644 ++++++++++++++++++++++++++-
qapi/ui.json | 13 +-
docs/system/deprecated.rst | 25 +-
docs/system/removed-features.rst | 5 +
include/qom/object_interfaces.h | 106 ++---
hw/block/xen-block.c | 16 +-
monitor/hmp-cmds.c | 17 +-
monitor/misc.c | 2 -
qemu-img.c | 251 ++---------
qemu-io.c | 33 +-
qemu-nbd.c | 34 +-
qom/object_interfaces.c | 168 +++----
qom/qom-qmp-cmds.c | 28 +-
softmmu/vl.c | 109 +++--
storage-daemon/qemu-storage-daemon.c | 27 +-
tests/check-qom-proplist.c | 42 +-
hmp-commands.hx | 2 +-
storage-daemon/qapi/qapi-schema.json | 1 +
24 files changed, 1231 insertions(+), 633 deletions(-)
--
2.29.2
3 years, 8 months
[libvirt PATCH] qemu_driver: fix setting vcpu_quota if not all vCPUs are online
by Pavel Hrdina
When switching to g_autoptr this was incorrectly changed from
'continue;' into 'return -1;' resulting into an error when user tries
to set vcpu_quota of running VM:
error: An error occurred, but the cause is unknown
Fixes: e4a8bbfaf2b4cdd741bb441873bb730f9134b714
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b7c89a826a..16c5ccae45 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9204,7 +9204,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i);
if (!vcpu->online)
- return -1;
+ continue;
if (virCgroupNewThread(cgroup, VIR_CGROUP_THREAD_VCPU, i,
false, &cgroup_vcpu) < 0)
--
2.30.2
3 years, 8 months
[libvirt PATCH v2 0/1] ci: Add helper script
by Andrea Bolognani
Changes from [v1]:
* implement (partial) support for running builds and spawning
shells inside the container;
* make the code more maintainable by using a couple of classes.
[v1] https://listman.redhat.com/archives/libvir-list/2021-February/msg00900.h=
tml
Andrea Bolognani (1):
ci: Add helper script
ci/cirrus/refresh | 22 -----
ci/containers/refresh | 41 ---------
ci/helper | 187 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 187 insertions(+), 63 deletions(-)
delete mode 100755 ci/cirrus/refresh
delete mode 100755 ci/containers/refresh
create mode 100755 ci/helper
--=20
2.26.2
3 years, 8 months
[PATCH 00/14] deprecations: remove many old deprecations
by Daniel P. Berrangé
The following features have been deprecated for well over the 2
release cycle we promise
``-usbdevice`` (since 2.10.0)
``-drive file=3Djson:{...{'driver':'file'}}`` (since 3.0)
``-vnc acl`` (since 4.0.0)
``-mon ...,control=3Dreadline,pretty=3Don|off`` (since 4.1)
``migrate_set_downtime`` and ``migrate_set_speed`` (since 2.8.0)
``query-named-block-nodes`` result ``encryption_key_missing`` (since 2.10.0)
``query-block`` result ``inserted.encryption_key_missing`` (since 2.10.0)
``migrate-set-cache-size`` and ``query-migrate-cache-size`` (since 2.11.0)
``query-named-block-nodes`` and ``query-block`` result dirty-bitmaps[i].sta=
tus (ince 4.0)
``query-cpus`` (since 2.12.0)
``query-cpus-fast`` ``arch`` output member (since 3.0.0)
``query-events`` (since 4.0)
chardev client socket with ``wait`` option (since 4.0)
``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, ``acl_remove`` (s=
ince 4.0.0)
``ide-drive`` (since 4.2)
``scsi-disk`` (since 4.2)
AFAICT, libvirt has ceased to use all of these too.
There are many more similarly old deprecations not (yet) tackled.
Daniel P. Berrang=C3=A9 (14):
ui, monitor: remove deprecated VNC ACL option and HMP commands
monitor: raise error when 'pretty' option is used with HMP
monitor: remove 'query-events' QMP command
softmmu: remove '-usbdevice' command line option
migrate: remove QMP/HMP commands for speed, downtime and cache size
machine: remove 'query-cpus' QMP command
machine: remove 'arch' field from 'query-cpus-fast' QMP command
chardev: reject use of 'wait' flag for socket client chardevs
hw/ide: remove 'ide-drive' device
hw/scsi: remove 'scsi-disk' device
block: remove 'encryption_key_missing' flag from QAPI
block: remove dirty bitmaps 'status' field
block: remove 'dirty-bitmaps' field from 'BlockInfo' struct
block: remove support for using "file" driver with block/char devices
block/dirty-bitmap.c | 38 ---
block/file-posix.c | 17 +-
block/qapi.c | 6 -
chardev/char-socket.c | 12 +-
docs/devel/migration.rst | 2 +-
docs/qdev-device-use.txt | 2 +-
docs/rdma.txt | 2 +-
docs/system/deprecated.rst | 117 -------
docs/system/removed-features.rst | 123 +++++++
docs/xbzrle.txt | 5 -
hmp-commands-info.hx | 13 -
hmp-commands.hx | 121 -------
hw/core/machine-hmp-cmds.c | 8 +-
hw/core/machine-qmp-cmds.c | 120 -------
hw/i386/pc.c | 2 -
hw/ide/qdev.c | 38 ---
hw/ppc/mac_newworld.c | 13 -
hw/ppc/mac_oldworld.c | 13 -
hw/scsi/scsi-disk.c | 62 ----
hw/sparc64/sun4u.c | 15 -
include/block/dirty-bitmap.h | 1 -
include/monitor/hmp.h | 4 -
migration/migration.c | 45 ---
migration/ram.c | 2 +-
monitor/hmp-cmds.c | 34 --
monitor/misc.c | 187 ----------
monitor/monitor.c | 4 +-
monitor/qmp-cmds-control.c | 24 --
qapi/block-core.json | 64 +---
qapi/control.json | 45 ---
qapi/machine.json | 181 +---------
qapi/migration.json | 98 ------
qemu-options.hx | 5 +-
scripts/device-crash-test | 2 -
softmmu/vl.c | 43 ---
tests/acceptance/pc_cpu_hotplug_props.py | 2 +-
tests/acceptance/x86_cpu_model_versions.py | 2 +-
tests/migration/guestperf/engine.py | 18 +-
tests/qemu-iotests/051 | 4 -
tests/qemu-iotests/051.pc.out | 20 --
tests/qemu-iotests/124 | 4 -
tests/qemu-iotests/181 | 2 +-
tests/qemu-iotests/184.out | 6 +-
tests/qemu-iotests/191.out | 48 +--
tests/qemu-iotests/194 | 4 +-
tests/qemu-iotests/194.out | 4 +-
tests/qemu-iotests/226.out | 10 +-
tests/qemu-iotests/236 | 2 +-
tests/qemu-iotests/236.out | 42 +--
tests/qemu-iotests/246 | 3 +-
tests/qemu-iotests/246.out | 66 ++--
tests/qemu-iotests/254 | 2 +-
tests/qemu-iotests/254.out | 9 +-
tests/qemu-iotests/257.out | 378 +++++++--------------
tests/qemu-iotests/260 | 5 +-
tests/qemu-iotests/273.out | 15 +-
tests/qtest/migration-test.c | 48 ---
tests/qtest/numa-test.c | 6 +-
tests/qtest/qmp-test.c | 6 +-
tests/qtest/test-hmp.c | 6 +-
tests/qtest/test-x86-cpuid-compat.c | 4 +-
tests/qtest/vhost-user-test.c | 8 +-
ui/vnc.c | 38 ---
63 files changed, 380 insertions(+), 1850 deletions(-)
--=20
2.29.2
3 years, 8 months
[PATCH] bhyve: add <os firmware='efi'> support
by Roman Bogorodskiy
Implement "<os firmware='efi'>" support for bhyve driver.
As there are not really lot of options, try to find
"BHYVE_UEFI.fd" firmware which is installed by the
sysutils/uefi-edk2-bhyve FreeBSD port.
If not found, just use the first found firmware
in the firmwares directory (which is configurable via
config file).
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
Not extremely happy about the LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE knob,
but not sure how to test this otherwise.
po/POTFILES.in | 1 +
src/bhyve/bhyve_domain.c | 5 +
src/bhyve/bhyve_firmware.c | 91 +++++++++++++++++++
src/bhyve/bhyve_firmware.h | 30 ++++++
src/bhyve/bhyve_process.c | 15 +++
src/bhyve/bhyve_process.h | 5 +
src/bhyve/meson.build | 1 +
.../bhyvexml2argv-firmware-efi.args | 11 +++
.../bhyvexml2argv-firmware-efi.ldargs | 1 +
.../bhyvexml2argv-firmware-efi.xml | 22 +++++
tests/bhyvexml2argvtest.c | 83 ++++++++++++++---
11 files changed, 254 insertions(+), 11 deletions(-)
create mode 100644 src/bhyve/bhyve_firmware.c
create mode 100644 src/bhyve/bhyve_firmware.h
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 80c5f145be..413783ee35 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,6 +14,7 @@
@SRCDIR(a)src/bhyve/bhyve_command.c
@SRCDIR(a)src/bhyve/bhyve_domain.c
@SRCDIR(a)src/bhyve/bhyve_driver.c
+@SRCDIR(a)src/bhyve/bhyve_firmware.c
@SRCDIR(a)src/bhyve/bhyve_monitor.c
@SRCDIR(a)src/bhyve/bhyve_parse_command.c
@SRCDIR(a)src/bhyve/bhyve_process.c
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index 8fbc554a0a..209e4d3905 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -64,6 +64,9 @@ bhyveDomainDefNeedsISAController(virDomainDefPtr def)
if (def->os.bootloader == NULL && def->os.loader)
return true;
+ if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)
+ return true;
+
if (def->nserials || def->nconsoles)
return true;
@@ -230,6 +233,8 @@ virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = {
.domainPostParseCallback = bhyveDomainDefPostParse,
.assignAddressesCallback = bhyveDomainDefAssignAddresses,
.deviceValidateCallback = bhyveDomainDeviceDefValidate,
+
+ .features = VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT,
};
static void
diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
new file mode 100644
index 0000000000..ccc3a5ffc8
--- /dev/null
+++ b/src/bhyve/bhyve_firmware.c
@@ -0,0 +1,91 @@
+/*
+ * bhyve_firmware.c: bhyve firmware management
+ *
+ * Copyright (C) 2021 Roman Bogorodskiy
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+#include <dirent.h>
+
+#include "viralloc.h"
+#include "virlog.h"
+#include "virfile.h"
+#include "bhyve_conf.h"
+#include "bhyve_firmware.h"
+
+#define VIR_FROM_THIS VIR_FROM_BHYVE
+
+VIR_LOG_INIT("bhyve.bhyve_firmware");
+
+
+#define BHYVE_DEFAULT_FIRMWARE "BHYVE_UEFI.fd"
+
+int
+bhyveFirmwareFillDomain(bhyveConnPtr driver,
+ virDomainDefPtr def,
+ unsigned int flags)
+{
+ g_autoptr(DIR) dir = NULL;
+ virBhyveDriverConfigPtr cfg = virBhyveDriverGetConfig(driver);
+ const char *firmware_dir_cfg = cfg->firmwareDir;
+ const char *firmware_dir_env = NULL, *firmware_dir = NULL;
+ struct dirent *entry;
+ char *matching_firmware = NULL;
+ char *first_found = NULL;
+
+ virCheckFlags(0, -1);
+
+ if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
+ return 0;
+
+ if (virDirOpenIfExists(&dir, firmware_dir_cfg) > 0) {
+ while ((virDirRead(dir, &entry, firmware_dir)) > 0) {
+ if (STREQ(entry->d_name, BHYVE_DEFAULT_FIRMWARE)) {
+ matching_firmware = g_strdup(entry->d_name);
+ break;
+ }
+ if (!first_found)
+ first_found = g_strdup(entry->d_name);
+ }
+ }
+
+ if (!matching_firmware) {
+ if (!first_found) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("no firmwares found in %s"),
+ firmware_dir_cfg);
+ return -1;
+ } else {
+ matching_firmware = first_found;
+ }
+ }
+
+ if (!def->os.loader)
+ def->os.loader = g_new0(virDomainLoaderDef, 1);
+
+ def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
+ def->os.loader->readonly = VIR_TRISTATE_BOOL_YES;
+
+ VIR_FREE(def->os.loader->path);
+
+ firmware_dir_env = g_getenv("LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE");
+ firmware_dir = firmware_dir_env ? firmware_dir_env : firmware_dir_cfg;
+ def->os.loader->path = g_build_filename(firmware_dir, matching_firmware, NULL);
+
+ return 0;
+}
diff --git a/src/bhyve/bhyve_firmware.h b/src/bhyve/bhyve_firmware.h
new file mode 100644
index 0000000000..ae4bc98676
--- /dev/null
+++ b/src/bhyve/bhyve_firmware.h
@@ -0,0 +1,30 @@
+/*
+ * bhyve_firmware.h: bhyve firmware management
+ *
+ * Copyright (C) 2021 Roman Bogorodskiy
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include "domain_conf.h"
+#include "bhyve_utils.h"
+
+int
+bhyveFirmwareFillDomain(bhyveConnPtr driver,
+ virDomainDefPtr def,
+ unsigned int flags);
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index 060018bc70..0cfe69688c 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -33,6 +33,7 @@
#include "bhyve_device.h"
#include "bhyve_driver.h"
#include "bhyve_command.h"
+#include "bhyve_firmware.h"
#include "bhyve_monitor.h"
#include "bhyve_process.h"
#include "datatypes.h"
@@ -251,6 +252,17 @@ virBhyveProcessStartImpl(bhyveConnPtr driver,
return ret;
}
+int
+bhyveProcessPrepareDomain(bhyveConnPtr driver,
+ virDomainObjPtr vm,
+ unsigned int flags)
+{
+ if (bhyveFirmwareFillDomain(driver, vm->def, flags) < 0)
+ return -1;
+
+ return 0;
+}
+
int
virBhyveProcessStart(virConnectPtr conn,
virDomainObjPtr vm,
@@ -268,6 +280,9 @@ virBhyveProcessStart(virConnectPtr conn,
conn, bhyveProcessAutoDestroy) < 0)
return -1;
+ if (bhyveProcessPrepareDomain(driver, vm, flags) < 0)
+ return -1;
+
return virBhyveProcessStartImpl(driver, vm, reason);
}
diff --git a/src/bhyve/bhyve_process.h b/src/bhyve/bhyve_process.h
index d7b4e0bd4e..133863c1e0 100644
--- a/src/bhyve/bhyve_process.h
+++ b/src/bhyve/bhyve_process.h
@@ -23,6 +23,11 @@
#include "bhyve_utils.h"
+int
+bhyveProcessPrepareDomain(bhyveConnPtr driver,
+ virDomainObjPtr vm,
+ unsigned int flags);
+
int virBhyveProcessStart(virConnectPtr conn,
virDomainObjPtr vm,
virDomainRunningReason reason,
diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build
index 2b65eecf5e..b3551477b7 100644
--- a/src/bhyve/meson.build
+++ b/src/bhyve/meson.build
@@ -2,6 +2,7 @@ bhyve_sources = files(
'bhyve_capabilities.c',
'bhyve_command.c',
'bhyve_conf.c',
+ 'bhyve_firmware.c',
'bhyve_parse_command.c',
'bhyve_device.c',
'bhyve_domain.c',
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
new file mode 100644
index 0000000000..40bc84ef27
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
@@ -0,0 +1,11 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-l bootrom,test_firmware_dir/BHYVE_UEFI.fd \
+-s 1:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
new file mode 100644
index 0000000000..421376db9e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
@@ -0,0 +1 @@
+dummy
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml
new file mode 100644
index 0000000000..302326cb26
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml
@@ -0,0 +1,22 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os firmware='efi'>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index 197334f9c4..13b8e34c2b 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -7,17 +7,20 @@
# include "datatypes.h"
# include "bhyve/bhyve_capabilities.h"
+# include "bhyve/bhyve_conf.h"
# include "bhyve/bhyve_domain.h"
# include "bhyve/bhyve_utils.h"
# include "bhyve/bhyve_command.h"
+# include "bhyve/bhyve_process.h"
# define VIR_FROM_THIS VIR_FROM_BHYVE
static bhyveConn driver;
typedef enum {
- FLAG_EXPECT_FAILURE = 1 << 0,
- FLAG_EXPECT_PARSE_ERROR = 1 << 1,
+ FLAG_EXPECT_FAILURE = 1 << 0,
+ FLAG_EXPECT_PARSE_ERROR = 1 << 1,
+ FLAG_EXPECT_PREPARE_ERROR = 1 << 2,
} virBhyveXMLToArgvTestFlags;
static int testCompareXMLToArgvFiles(const char *xml,
@@ -29,7 +32,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
g_autofree char *actualargv = NULL;
g_autofree char *actualld = NULL;
g_autofree char *actualdm = NULL;
- g_autoptr(virDomainDef) vmdef = NULL;
+ g_autoptr(virDomainObj) vm = NULL;
g_autoptr(virCommand) cmd = NULL;
g_autoptr(virCommand) ldcmd = NULL;
g_autoptr(virConnect) conn = NULL;
@@ -38,7 +41,10 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (!(conn = virGetConnect()))
goto out;
- if (!(vmdef = virDomainDefParseFile(xml, driver.xmlopt,
+ if (!(vm = virDomainObjNew(driver.xmlopt)))
+ return -1;
+
+ if (!(vm->def = virDomainDefParseFile(xml, driver.xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
if (flags & FLAG_EXPECT_PARSE_ERROR) {
ret = 0;
@@ -54,11 +60,20 @@ static int testCompareXMLToArgvFiles(const char *xml,
conn->privateData = &driver;
- cmd = virBhyveProcessBuildBhyveCmd(&driver, vmdef, false);
- if (vmdef->os.loader)
+ if (bhyveProcessPrepareDomain(&driver, vm, 0) < 0) {
+ if (flags & FLAG_EXPECT_PREPARE_ERROR) {
+ ret = 0;
+ VIR_TEST_DEBUG("Got expected error: %s",
+ virGetLastErrorMessage());
+ }
+ goto out;
+ }
+
+ cmd = virBhyveProcessBuildBhyveCmd(&driver, vm->def, false);
+ if (vm->def->os.loader)
ldcmd = virCommandNew("dummy");
else
- ldcmd = virBhyveProcessBuildLoadCmd(&driver, vmdef, "<device.map>",
+ ldcmd = virBhyveProcessBuildLoadCmd(&driver, vm->def, "<device.map>",
&actualdm);
if ((cmd == NULL) || (ldcmd == NULL)) {
@@ -94,10 +109,10 @@ static int testCompareXMLToArgvFiles(const char *xml,
ret = 0;
out:
- if (vmdef &&
- vmdef->ngraphics == 1 &&
- vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
- virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
+ if (vm && vm->def &&
+ vm->def->ngraphics == 1 &&
+ vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
+ virPortAllocatorRelease(vm->def->graphics[0]->data.vnc.port);
return ret;
}
@@ -128,10 +143,16 @@ testCompareXMLToArgvHelper(const void *data)
return testCompareXMLToArgvFiles(xml, args, ldargs, dmargs, info->flags);
}
+# define FAKEFIRMWAREDIRTEMPLATE abs_builddir "/bhyvefakefirmwaredir-XXXXXX"
+
static int
mymain(void)
{
int ret = 0;
+ g_autofree char *fakefirmwaredir = NULL;
+ g_autofree char *emptyfirmwaredir = NULL;
+ const char *firmwares[] = {"BHYVE_UEFI.fd", "BHYVE_UEFI_CSM.fd", "refind_x64.efi", NULL};
+ size_t i;
if ((driver.caps = virBhyveCapsBuild()) == NULL)
return EXIT_FAILURE;
@@ -142,6 +163,35 @@ mymain(void)
if (!(driver.remotePorts = virPortAllocatorRangeNew("display", 5900, 65535)))
return EXIT_FAILURE;
+ if (!(driver.config = virBhyveDriverConfigNew()))
+ return EXIT_FAILURE;
+
+ fakefirmwaredir = g_strdup(FAKEFIRMWAREDIRTEMPLATE);
+
+ if (!g_mkdtemp(fakefirmwaredir)) {
+ fprintf(stderr, "Cannot create fakefirmwaredir");
+ abort();
+ }
+ driver.config->firmwareDir = fakefirmwaredir;
+
+ emptyfirmwaredir = g_strdup(FAKEFIRMWAREDIRTEMPLATE);
+
+ if (!g_mkdtemp(emptyfirmwaredir)) {
+ fprintf(stderr, "Cannot create emptyfirmwaredir");
+ abort();
+ }
+
+ i = 0;
+ while (firmwares[i]) {
+ g_autofree char *firmware_path = g_strdup_printf("%s/%s", fakefirmwaredir, firmwares[i++]);
+
+ if (virFileTouch(firmware_path, 0600) < 0) {
+ fprintf(stderr, "Cannot create firmware file");
+ abort();
+ }
+ }
+
+ g_setenv("LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE", "test_firmware_dir", TRUE);
# define DO_TEST_FULL(name, flags) \
do { \
@@ -162,6 +212,9 @@ mymain(void)
# define DO_TEST_PARSE_ERROR(name) \
DO_TEST_FULL(name, FLAG_EXPECT_PARSE_ERROR)
+# define DO_TEST_PREPARE_ERROR(name) \
+ DO_TEST_FULL(name, FLAG_EXPECT_PREPARE_ERROR)
+
driver.grubcaps = BHYVE_GRUB_CAP_CONSDEV;
driver.bhyvecaps = BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | \
BHYVE_CAP_NET_E1000 | BHYVE_CAP_LPC_BOOTROM | \
@@ -209,6 +262,10 @@ mymain(void)
DO_TEST("sound");
DO_TEST("isa-controller");
DO_TEST_FAILURE("isa-multiple-controllers");
+ DO_TEST("firmware-efi");
+ g_unsetenv("LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE");
+ driver.config->firmwareDir = emptyfirmwaredir;
+ DO_TEST_PREPARE_ERROR("firmware-efi");
DO_TEST("fs-9p");
DO_TEST("fs-9p-readonly");
DO_TEST_FAILURE("fs-9p-unsupported-type");
@@ -264,9 +321,13 @@ mymain(void)
driver.bhyvecaps &= ~BHYVE_CAP_VNC_PASSWORD;
DO_TEST_FAILURE("vnc-password");
+ virFileDeleteTree(fakefirmwaredir);
+ virFileDeleteTree(emptyfirmwaredir);
+
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);
virPortAllocatorRangeFree(driver.remotePorts);
+ virObjectUnref(driver.config);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.30.0
3 years, 8 months
[PATCH v3 00/13] Prepare for -object QAPIfication
by Peter Krempa
v3 now uses JSON to configure objects which is possible with the
following qemu patch:
https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg04436.html
The use of JSON completely avoids problems with conversion of the JSON
definition which we create regardless (especially bitmaps/arrays for the
host-nodes property) to command line arguments which was lossy with the
traditional arguments.
Peter Krempa (13):
qemuxml2argvdata: Remove unused output file
'disk-network-tlsx509.x86_64-latest.args'
virQEMUQAPISchemaTraverse: Fix quoting in comment
qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED
qemu: monitor: Make wrapping of 'props' of 'object-add' optional
qemuMonitorCreateObjectPropsWrap: Open-code in
qemuBuildMemoryBackendProps
qemu: monitor: Don't add 'props' wrapper if qemu has
QEMU_CAPS_OBJECT_QAPIFIED
qemu: command: Use JSON for QAPIfied -object directly
tests: qemuxml2argv: Validate generation of JSON props for object-add
qemumonitorjsontest: Remove tripwire guarding object-add QAPIfication
tests: qemucapabilities: Update qemu caps for object-add qapification
qemuxml2argvtest: Add DO_CAPS_LATEST variant of 'numatune-memnode'
qemuxml2argvtest: Pin examples of -object usage to qemu-5.2 caps
qemu: capabilities: Enable detection of QEMU_CAPS_OBJECT_QAPIFIED
src/libvirt_private.syms | 1 -
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 98 +-
src/qemu/qemu_monitor.c | 78 +-
src/qemu/qemu_monitor.h | 4 -
src/qemu/qemu_qapi.c | 2 +-
src/util/virqemu.c | 38 -
src/util/virqemu.h | 3 -
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 1 +
.../caps_6.0.0.x86_64.replies | 3262 ++++++++++++-----
.../caps_6.0.0.x86_64.xml | 89 +-
tests/qemumonitorjsontest.c | 14 -
.../audio-alsa-best.x86_64-latest.args | 6 +-
.../audio-alsa-full.x86_64-latest.args | 6 +-
.../audio-alsa-minimal.x86_64-latest.args | 6 +-
.../audio-coreaudio-best.x86_64-latest.args | 6 +-
.../audio-coreaudio-full.x86_64-latest.args | 6 +-
...audio-coreaudio-minimal.x86_64-latest.args | 6 +-
...udio-default-nographics.x86_64-latest.args | 6 +-
.../audio-default-sdl.x86_64-latest.args | 6 +-
.../audio-default-spice.x86_64-latest.args | 6 +-
.../audio-default-vnc.x86_64-latest.args | 6 +-
.../audio-file-best.x86_64-latest.args | 6 +-
.../audio-file-full.x86_64-latest.args | 6 +-
.../audio-file-minimal.x86_64-latest.args | 6 +-
.../audio-jack-full.x86_64-latest.args | 6 +-
.../audio-jack-minimal.x86_64-latest.args | 6 +-
.../audio-many-backends.x86_64-latest.args | 6 +-
.../audio-none-best.x86_64-latest.args | 6 +-
.../audio-none-full.x86_64-latest.args | 6 +-
.../audio-none-minimal.x86_64-latest.args | 6 +-
.../audio-oss-best.x86_64-latest.args | 6 +-
.../audio-oss-full.x86_64-latest.args | 6 +-
.../audio-oss-minimal.x86_64-latest.args | 6 +-
.../audio-pulseaudio-best.x86_64-latest.args | 6 +-
.../audio-pulseaudio-full.x86_64-latest.args | 6 +-
...udio-pulseaudio-minimal.x86_64-latest.args | 6 +-
.../audio-sdl-best.x86_64-latest.args | 6 +-
.../audio-sdl-full.x86_64-latest.args | 6 +-
.../audio-sdl-minimal.x86_64-latest.args | 6 +-
.../audio-spice-best.x86_64-latest.args | 6 +-
.../audio-spice-full.x86_64-latest.args | 6 +-
.../audio-spice-minimal.x86_64-latest.args | 6 +-
.../blkdeviotune-group-num.x86_64-latest.args | 6 +-
...blkdeviotune-max-length.x86_64-latest.args | 6 +-
.../blkdeviotune-max.x86_64-latest.args | 6 +-
.../channel-unix-guestfwd.x86_64-latest.args | 6 +-
.../console-virtio-unix.x86_64-latest.args | 6 +-
.../controller-virtio-scsi.x86_64-latest.args | 6 +-
...-Icelake-Server-pconfig.x86_64-latest.args | 6 +-
.../cpu-translation.x86_64-latest.args | 6 +-
.../cpu-tsc-high-frequency.x86_64-latest.args | 6 +-
.../cputune-cpuset-big-id.x86_64-latest.args | 6 +-
.../disk-aio-io_uring.x86_64-latest.args | 6 +-
.../disk-aio.x86_64-latest.args | 6 +-
...-backing-chains-noindex.x86_64-latest.args | 12 +-
.../disk-cache.x86_64-latest.args | 6 +-
.../disk-cdrom-bus-other.x86_64-latest.args | 6 +-
...m-empty-network-invalid.x86_64-latest.args | 6 +-
.../disk-cdrom-network.x86_64-latest.args | 6 +-
.../disk-cdrom-tray.x86_64-latest.args | 6 +-
.../disk-cdrom.x86_64-latest.args | 6 +-
.../disk-copy_on_read.x86_64-latest.args | 6 +-
.../disk-detect-zeroes.x86_64-latest.args | 6 +-
.../disk-discard.x86_64-latest.args | 6 +-
.../disk-error-policy.x86_64-latest.args | 6 +-
.../disk-floppy-q35-2_11.x86_64-latest.args | 6 +-
.../disk-floppy-q35-2_9.x86_64-latest.args | 6 +-
.../disk-floppy.x86_64-latest.args | 6 +-
.../disk-metadata-cache.x86_64-latest.args | 6 +-
.../disk-network-gluster.x86_64-latest.args | 6 +-
.../disk-network-http.x86_64-latest.args | 18 +-
.../disk-network-iscsi.x86_64-latest.args | 18 +-
.../disk-network-nbd.x86_64-latest.args | 6 +-
.../disk-network-nfs.x86_64-latest.args | 6 +-
.../disk-network-rbd.x86_64-latest.args | 12 +-
.../disk-network-sheepdog.x86_64-latest.args | 6 +-
...isk-network-source-auth.x86_64-latest.args | 24 +-
...disk-network-tlsx509-nbd.x86_64-5.2.0.args | 50 +
...isk-network-tlsx509-nbd.x86_64-latest.args | 18 +-
.../disk-network-tlsx509.x86_64-latest.args | 90 -
.../disk-nvme.x86_64-latest.args | 12 +-
.../disk-readonly-disk.x86_64-latest.args | 6 +-
.../disk-scsi-device-auto.x86_64-latest.args | 6 +-
.../disk-scsi.x86_64-latest.args | 6 +-
.../disk-shared.x86_64-latest.args | 6 +-
.../disk-slices.x86_64-latest.args | 18 +-
.../disk-transient.x86_64-latest.args | 6 +-
.../disk-vhostuser.x86_64-latest.args | 8 +-
...virtio-scsi-reservations.x86_64-5.2.0.args | 55 +
...irtio-scsi-reservations.x86_64-latest.args | 14 +-
.../eoi-disabled.x86_64-latest.args | 6 +-
.../eoi-enabled.x86_64-latest.args | 6 +-
.../fips-enabled.x86_64-latest.args | 6 +-
.../floppy-drive-fat.x86_64-latest.args | 6 +-
.../qemuxml2argvdata/fs9p.x86_64-latest.args | 6 +-
.../genid-auto.x86_64-latest.args | 6 +-
.../qemuxml2argvdata/genid.x86_64-latest.args | 6 +-
...egl-headless-rendernode.x86_64-latest.args | 6 +-
.../graphics-egl-headless.x86_64-latest.args | 6 +-
...pice-gl-auto-rendernode.x86_64-latest.args | 6 +-
.../graphics-vnc-power.x86_64-latest.args | 6 +-
.../graphics-vnc-tls-secret.x86_64-5.2.0.args | 42 +
...graphics-vnc-tls-secret.x86_64-latest.args | 17 +-
.../graphics-vnc-tls.x86_64-latest.args | 10 +-
...tdev-mdev-display-ramfb.x86_64-latest.args | 6 +-
...play-spice-egl-headless.x86_64-latest.args | 6 +-
...ev-display-spice-opengl.x86_64-latest.args | 6 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 6 +-
...ostdev-mdev-display-vnc.x86_64-latest.args | 6 +-
.../hostdev-scsi-lsi.x86_64-latest.args | 18 +-
...ostdev-scsi-virtio-scsi.x86_64-latest.args | 18 +-
.../hugepages-memaccess3.x86_64-latest.args | 11 +-
.../hugepages-nvdimm.x86_64-latest.args | 14 +-
.../hyperv-off.x86_64-latest.args | 6 +-
.../hyperv-panic.x86_64-latest.args | 6 +-
.../hyperv-stimer-direct.x86_64-latest.args | 6 +-
.../hyperv.x86_64-latest.args | 6 +-
.../intel-iommu-aw-bits.x86_64-latest.args | 6 +-
...ntel-iommu-caching-mode.x86_64-latest.args | 6 +-
...ntel-iommu-device-iotlb.x86_64-latest.args | 6 +-
.../intel-iommu-eim.x86_64-latest.args | 6 +-
.../intel-iommu.x86_64-latest.args | 6 +-
...othreads-virtio-scsi-pci.x86_64-5.2.0.args | 57 +
...threads-virtio-scsi-pci.x86_64-latest.args | 10 +-
.../kvmclock+eoi-disabled.x86_64-latest.args | 6 +-
.../luks-disks-source-qcow2.x86_64-5.2.0.args | 112 +
...luks-disks-source-qcow2.x86_64-latest.args | 54 +-
...memory-default-hugepage.x86_64-latest.args | 9 +-
.../memfd-memory-numa.x86_64-latest.args | 9 +-
...y-hotplug-nvdimm-access.x86_64-latest.args | 10 +-
...ory-hotplug-nvdimm-align.x86_64-5.2.0.args | 44 +
...ry-hotplug-nvdimm-align.x86_64-latest.args | 11 +-
...ory-hotplug-nvdimm-label.x86_64-5.2.0.args | 44 +
...ry-hotplug-nvdimm-label.x86_64-latest.args | 10 +-
...mory-hotplug-nvdimm-pmem.x86_64-5.2.0.args | 44 +
...ory-hotplug-nvdimm-pmem.x86_64-latest.args | 10 +-
...-hotplug-nvdimm-readonly.x86_64-5.2.0.args | 44 +
...hotplug-nvdimm-readonly.x86_64-latest.args | 10 +-
.../memory-hotplug-nvdimm.x86_64-latest.args | 10 +-
...mory-hotplug-virtio-pmem.x86_64-5.2.0.args | 45 +
...ory-hotplug-virtio-pmem.x86_64-latest.args | 10 +-
.../mlock-off.x86_64-latest.args | 6 +-
.../mlock-on.x86_64-latest.args | 6 +-
.../net-vdpa.x86_64-latest.args | 6 +-
.../net-vhostuser.x86_64-latest.args | 6 +-
.../numatune-hmat.x86_64-latest.args | 16 +-
.../numatune-memnode.x86_64-5.2.0.args | 43 +
.../numatune-memnode.x86_64-latest.args | 43 +
.../os-firmware-bios.x86_64-latest.args | 6 +-
...os-firmware-efi-secboot.x86_64-latest.args | 6 +-
.../os-firmware-efi.x86_64-latest.args | 6 +-
.../parallel-unix-chardev.x86_64-latest.args | 6 +-
...cie-root-port-nohotplug.x86_64-latest.args | 6 +-
.../pv-spinlock-disabled.x86_64-latest.args | 6 +-
.../pv-spinlock-enabled.x86_64-latest.args | 6 +-
.../qemu-ns.x86_64-latest.args | 6 +-
.../serial-unix-chardev.x86_64-latest.args | 6 +-
...rtcard-passthrough-unix.x86_64-latest.args | 6 +-
.../tpm-emulator-tpm2-enc.x86_64-latest.args | 6 +-
...pm-emulator-tpm2-pstate.x86_64-latest.args | 6 +-
.../tpm-emulator-tpm2.x86_64-latest.args | 6 +-
.../tpm-emulator.x86_64-latest.args | 6 +-
.../tpm-passthrough-crb.x86_64-latest.args | 6 +-
.../tpm-passthrough.x86_64-latest.args | 6 +-
.../tseg-explicit-size.x86_64-latest.args | 6 +-
.../usb-redir-unix.x86_64-latest.args | 6 +-
...vhost-user-fs-fd-memory.x86_64-latest.args | 10 +-
...vhost-user-fs-hugepages.x86_64-latest.args | 10 +-
...host-user-gpu-secondary.x86_64-latest.args | 7 +-
.../vhost-user-vga.x86_64-latest.args | 7 +-
.../vhost-vsock-auto.x86_64-latest.args | 6 +-
.../vhost-vsock.x86_64-latest.args | 6 +-
...eo-bochs-display-device.x86_64-latest.args | 6 +-
...video-qxl-device-vram64.x86_64-latest.args | 6 +-
...o-qxl-sec-device-vram64.x86_64-latest.args | 6 +-
...eo-ramfb-display-device.x86_64-latest.args | 6 +-
.../virtio-9p-createmode.x86_64-latest.args | 6 +-
.../virtio-9p-multidevs.x86_64-latest.args | 6 +-
...virtio-non-transitional.x86_64-latest.args | 8 +-
...-options-controller-ats.x86_64-latest.args | 6 +-
...ptions-controller-iommu.x86_64-latest.args | 6 +-
...tions-controller-packed.x86_64-latest.args | 6 +-
...virtio-options-disk-ats.x86_64-latest.args | 6 +-
...rtio-options-disk-iommu.x86_64-latest.args | 6 +-
...tio-options-disk-packed.x86_64-latest.args | 6 +-
.../virtio-options-fs-ats.x86_64-latest.args | 6 +-
...virtio-options-fs-iommu.x86_64-latest.args | 6 +-
...irtio-options-fs-packed.x86_64-latest.args | 6 +-
...irtio-options-input-ats.x86_64-latest.args | 6 +-
...tio-options-input-iommu.x86_64-latest.args | 6 +-
...io-options-input-packed.x86_64-latest.args | 6 +-
...-options-memballoon-ats.x86_64-latest.args | 6 +-
...loon-freepage-reporting.x86_64-latest.args | 6 +-
...ptions-memballoon-iommu.x86_64-latest.args | 6 +-
...tions-memballoon-packed.x86_64-latest.args | 6 +-
.../virtio-options-net-ats.x86_64-latest.args | 6 +-
...irtio-options-net-iommu.x86_64-latest.args | 6 +-
...rtio-options-net-packed.x86_64-latest.args | 6 +-
.../virtio-options-rng-ats.x86_64-latest.args | 10 +-
...irtio-options-rng-iommu.x86_64-latest.args | 10 +-
...rtio-options-rng-packed.x86_64-latest.args | 10 +-
...irtio-options-video-ats.x86_64-latest.args | 6 +-
...tio-options-video-iommu.x86_64-latest.args | 6 +-
...io-options-video-packed.x86_64-latest.args | 6 +-
.../virtio-options.x86_64-latest.args | 8 +-
.../virtio-rng-builtin.x86_64-5.2.0.args | 38 +
.../virtio-rng-builtin.x86_64-latest.args | 8 +-
.../virtio-rng-egd-unix.x86_64-5.2.0.args | 39 +
.../virtio-rng-egd-unix.x86_64-latest.args | 8 +-
.../virtio-transitional.x86_64-latest.args | 8 +-
...-default-cpu-kvm-pc-4.2.x86_64-latest.args | 6 +-
...default-cpu-kvm-q35-4.2.x86_64-latest.args | 6 +-
...-default-cpu-tcg-pc-4.2.x86_64-latest.args | 6 +-
...default-cpu-tcg-q35-4.2.x86_64-latest.args | 6 +-
.../x86_64-pc-graphics.x86_64-latest.args | 8 +-
.../x86_64-pc-headless.x86_64-latest.args | 8 +-
.../x86_64-q35-graphics.x86_64-latest.args | 8 +-
.../x86_64-q35-headless.x86_64-latest.args | 8 +-
tests/qemuxml2argvtest.c | 32 +
223 files changed, 4071 insertions(+), 1781 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509-nbd.x86_64-5.2.0.args
delete mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-tls-secret.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/iothreads-virtio-scsi-pci.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/luks-disks-source-qcow2.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-rng-builtin.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-5.2.0.args
--
2.29.2
3 years, 8 months
[PATCH 0/4] Couple of qemu:///embed related fixes
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (4):
qemu_shim: Don't hang if failed to start domain
docs: Lift restriction on running API from the event loop thread
virConnectOpen: Require root dir to be absolute path
qemu_shim: Always pre-create root dir
docs/drvqemu.html.in | 8 ++++++--
src/libvirt.c | 6 ++++++
src/qemu/qemu_shim.c | 20 ++++++++++++++------
3 files changed, 26 insertions(+), 8 deletions(-)
--
2.26.2
3 years, 8 months
[PATCH 0/2] Fix exec-restart of virtlogd and virtlockd
by Peter Krempa
Peter Krempa (2):
virnetdaemon: Introduce virNetDaemonQuitExecRestart
virtlo(g|ck)d: Fix exec-restart
src/libvirt_remote.syms | 1 +
src/locking/lock_daemon.c | 2 +-
src/logging/log_daemon.c | 2 +-
src/rpc/virnetdaemon.c | 19 +++++++++++++++++++
src/rpc/virnetdaemon.h | 1 +
5 files changed, 23 insertions(+), 2 deletions(-)
--
2.29.2
3 years, 8 months
[PATCH v2] qemu_shim: Don't hang if failed to start domain
by Michal Privoznik
The qemu shim spawns a separate thread in which the event loop is
ran. The virEventRunDefaultImpl() call is wrapped in a while()
loop, just like it should. There are few lines of code around
which try to ensure that domain is destroyed (when quitting) and
that the last round of event loop is ran after the
virDomainDestroy() call. Only after that the loop is quit from
and the thread quits.
However, if domain creation fails, there is no @dom to call
destroy over, the @quit flag is never set and while() never
exits. Set the flag regardless of @dom pointer.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1920337
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v2 of:
https://listman.redhat.com/archives/libvir-list/2021-March/msg00011.html
Thanks to Andrea who made me realize that this can be written better.
diff to v1:
- Instead of exiting from while() early, let the event loop run another
iteration (it should be no-op anyway).
src/qemu/qemu_shim.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_shim.c b/src/qemu/qemu_shim.c
index d85497bd3a..8b3afd0324 100644
--- a/src/qemu/qemu_shim.c
+++ b/src/qemu/qemu_shim.c
@@ -45,9 +45,9 @@ qemuShimEventLoop(void *opaque G_GNUC_UNUSED)
while (!quit) {
g_mutex_lock(&eventLock);
if (eventQuitFlag && !eventPreventQuitFlag) {
+ quit = true;
if (dom) {
virDomainDestroy(dom);
- quit = true;
}
}
g_mutex_unlock(&eventLock);
--
2.26.2
3 years, 8 months