[PATCH v2 0/5] Support crypto device
by zhenwei pi
v1 -> v2:
- Rebase code against the latest commit:
46aee2a9255adf842ab44a9292acb46189a726f7
- Merge previous 1/7 and 2/7 into a single patch:
conf: introduce crypto device
- Add missing qemuxml2xmltest.
- Merge previous 3/7 and 4/7 into a single patch:
capabilities: introduce crypto
- Add missing formatdomaincaps.rst.
- Several fixes from Michal Prívozník' crypto_review branch.
- Add caps and test for qemu-8.0.
Thanks to Michal for lots of suggestions!
v1:
This series supports crypto device, also add support for QEMU.
The basic xml schema looks like:
<crypto model='virtio' type='qemu'>
<backend model='builtin' queues='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</crypto>
<crypto model='virtio' type='qemu'>
<backend model='lkcf'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</crypto>
Each patch has been tested by 'ninja -C build test', and launch a QEMU
with crypto devices, it works fine.
zhenwei pi (5):
conf: introduce crypto device
capabilities: introduce crypto
qemu: alias: support crypto device
qemu: command: support crypto device
NEWS: Document 'crypto' device
NEWS.rst | 3 +
docs/formatdomain.rst | 21 +++
docs/formatdomaincaps.rst | 33 ++++
src/ch/ch_domain.c | 1 +
src/conf/domain_capabilities.c | 15 ++
src/conf/domain_capabilities.h | 12 ++
src/conf/domain_conf.c | 158 ++++++++++++++++++
src/conf/domain_conf.h | 39 +++++
src/conf/domain_postparse.c | 1 +
src/conf/domain_validate.c | 18 ++
src/conf/schemas/domaincaps.rng | 10 ++
src/conf/schemas/domaincommon.rng | 58 +++++++
src/conf/virconftypes.h | 2 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_alias.c | 23 +++
src/qemu/qemu_capabilities.c | 30 ++++
src/qemu/qemu_capabilities.h | 6 +
src/qemu/qemu_command.c | 109 ++++++++++++
src/qemu/qemu_domain.c | 3 +
src/qemu/qemu_domain_address.c | 26 +++
src/qemu/qemu_driver.c | 5 +
src/qemu/qemu_hotplug.c | 3 +
src/qemu/qemu_validate.c | 22 +++
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 11 ++
.../qemu_4.2.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 11 ++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 11 ++
.../qemu_5.0.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 11 ++
tests/domaincapsdata/qemu_5.1.0.sparc.xml | 9 +
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 11 ++
.../qemu_5.2.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_5.2.0.s390x.xml | 11 ++
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 11 ++
.../qemu_6.0.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_6.0.0.s390x.xml | 11 ++
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 11 ++
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 11 ++
.../qemu_6.2.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 11 ++
.../qemu_7.0.0-virt.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 11 ++
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 11 ++
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 11 ++
tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 11 ++
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 11 ++
.../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 12 ++
.../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 12 ++
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 12 ++
.../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 12 ++
.../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 12 ++
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 12 ++
.../caps_4.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 2 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 2 +
.../caps_4.2.0.x86_64.xml | 2 +
.../caps_5.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 2 +
.../caps_5.0.0.riscv64.xml | 2 +
.../caps_5.0.0.x86_64.xml | 2 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 +
.../caps_5.1.0.x86_64.xml | 2 +
.../caps_5.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 2 +
.../caps_5.2.0.riscv64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 2 +
.../caps_5.2.0.x86_64.xml | 2 +
.../caps_6.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 2 +
.../caps_6.0.0.x86_64.xml | 2 +
.../caps_6.1.0.x86_64.xml | 2 +
.../caps_6.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
.../caps_6.2.0.x86_64.xml | 2 +
.../caps_7.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
.../caps_7.0.0.x86_64.xml | 2 +
.../qemucapabilitiesdata/caps_7.1.0.ppc64.xml | 2 +
.../caps_7.1.0.x86_64.xml | 2 +
.../caps_7.2.0.x86_64.xml | 3 +
.../caps_8.0.0.x86_64.xml | 3 +
tests/qemuxml2argvdata/crypto-builtin.xml | 51 ++++++
.../crypto-builtin.x86_64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 2 +
110 files changed, 1321 insertions(+)
create mode 100644 tests/qemuxml2argvdata/crypto-builtin.xml
create mode 120000 tests/qemuxml2xmloutdata/crypto-builtin.x86_64-latest.xml
--
2.34.1
1 year, 10 months
[libvirt PATCH] rpc: don't try to spawn non-existant daemon
by Daniel P. Berrangé
If libvirt is built in client only mode, the libvirtd/virtqemud/etc
daemons won't exist. If the client is told to connect to a local
hypervisor, it'll see the socket doesn't exist, try to spawn the
daemon and then re-try connecting to the socket for a few seconds.
Ultimately this will fail because the daemon doesn't exist and the
user gets an error message
error: Failed to connect socket to '/run/user/1000/libvirt/virtqemud-sock': No such file or directory
technically this is accurate, but it doesn't help identify the root
cause. With this change it will now report
error: binary 'virtqemud' does not exist in $PATH: No such file or directory
and will skip all the socket connect retries
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/rpc/virnetsocket.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 8280bda007..bb2e0c5d3d 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -123,9 +123,19 @@ VIR_ONCE_GLOBAL_INIT(virNetSocket);
#ifndef WIN32
static int virNetSocketForkDaemon(const char *binary)
{
- g_autoptr(virCommand) cmd = virCommandNewArgList(binary,
- "--timeout=120",
- NULL);
+ g_autofree char *binarypath = virFindFileInPath(binary);
+ g_autoptr(virCommand) cmd = NULL;
+
+ if (!binarypath) {
+ virReportSystemError(ENOENT,
+ _("binary '%s' does not exist in $PATH"),
+ binary);
+ return -1;
+ }
+
+ cmd = virCommandNewArgList(binarypath,
+ "--timeout=120",
+ NULL);
virCommandAddEnvPassCommon(cmd);
virCommandAddEnvPass(cmd, "XDG_CACHE_HOME");
--
2.39.0
1 year, 10 months
[PATCH 0/3] update RISC-V QEMU caps for QEMU 8.0.0
by Daniel Henrique Barboza
Hi,
This series updates RISC-V QEMU caps that weren't being updated since
QEMU 5.0.0.
To do that I had to add a RISC-V stub driver in src/cpu to avoid test
failures after the caps update. This is a very bare-bone driver that
is basically a no-op.
I also took the opportunity to enable the RISC-V 'virt' machine type in
domaincapstest.c to increase the test coverage for the architecture.
Daniel Henrique Barboza (3):
src/cpu: add a basic RiscV64 cpu driver
tests: update RISC-V QEMU caps for QEMU 8.0.0
tests: add QEMU RISC-V "virt" machine in domaincapstest
src/cpu/cpu.c | 2 +
src/cpu/cpu_riscv64.c | 59 +
src/cpu/cpu_riscv64.h | 25 +
src/cpu/meson.build | 1 +
.../qemu_5.0.0-tcg-virt.riscv64.xml | 142 +
.../qemu_5.0.0-virt.riscv64.xml | 145 +
.../qemu_5.2.0-tcg-virt.riscv64.xml | 142 +
.../qemu_5.2.0-virt.riscv64.xml | 145 +
.../qemu_8.0.0-tcg-virt.riscv64.xml | 148 +
.../qemu_8.0.0-virt.riscv64.xml | 151 +
tests/domaincapstest.c | 14 +-
.../caps_8.0.0.riscv64.replies | 28554 ++++++++++++++++
.../caps_8.0.0.riscv64.xml | 157 +
...ult-video-type-riscv64.riscv64-latest.args | 11 +-
.../riscv64-virt-graphics.riscv64-latest.args | 45 +-
.../riscv64-virt-headless.riscv64-latest.args | 37 +-
tests/testutilshostcpus.h | 10 +
17 files changed, 29741 insertions(+), 47 deletions(-)
create mode 100644 src/cpu/cpu_riscv64.c
create mode 100644 src/cpu/cpu_riscv64.h
create mode 100644 tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml
create mode 100644 tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml
create mode 100644 tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml
create mode 100644 tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml
create mode 100644 tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml
create mode 100644 tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_8.0.0.riscv64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_8.0.0.riscv64.xml
--
2.39.0
1 year, 10 months
[PATCH] rpc: Fix error message in virNetServerSetClientLimits
by Martin Kletzander
Commit f007940cb25a tried to change the error message so that it is unified
later in 35afa1d2d6c1, but various rewrites missed this particular error message
which does not make sense. Fix it so that it is the same as the other two
messages checking the same thing in this file.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2033879
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/rpc/virnetserver.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index bf0fda04ee89..e97dfe81369f 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -1127,9 +1127,8 @@ virNetServerSetClientLimits(virNetServer *srv,
if (max < max_unauth) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("The overall maximum number of clients waiting "
- "for authentication must not be less than the overall "
- "maximum number of clients"));
+ _("The overall maximum number of clients must not be less "
+ "than the number of clients waiting for authentication"));
return -1;
}
--
2.39.1
1 year, 10 months
[PATCH 0/8] vbox: Report VirtualBox exceptions too
by Michal Privoznik
See 5/8 for motivation.
Michal Prívozník (8):
vbox: Introduce VBOX_QUERY_INTERFACE()
vbox: Introduce IVirtualBoxErrorInfo interface
vbox: Introduce vboxUniformedPFN::GetException()
vbox: Introduce vboxUniformedPFN::ClearException()
vbox: Introduce vboxReportError()
vbox: Replace virReportError() with vboxReportError()
vbox: Move error messages onto a single line
vbox: Stop reporting RC in error messages
src/vbox/vbox_common.c | 1223 +++++++++++++++++----------------
src/vbox/vbox_common.h | 6 +
src/vbox/vbox_tmpl.c | 52 ++
src/vbox/vbox_uniformed_api.h | 11 +
4 files changed, 712 insertions(+), 580 deletions(-)
--
2.39.1
1 year, 10 months
[PATCH 0/3] qemu: Fix alias generation for 'dimm' devices
by Peter Krempa
Peter Krempa (3):
qemu: hotplug: Remove legacy quirk for 'dimm' address generation
qemu: alias: Remove 'oldAlias' argument of qemuAssignDeviceMemoryAlias
qemu: Remove 'memAliasOrderMismatch' field from VM private data
src/qemu/qemu_alias.c | 13 ++++---------
src/qemu/qemu_alias.h | 3 +--
src/qemu/qemu_domain.h | 3 ---
src/qemu/qemu_hotplug.c | 4 +---
src/qemu/qemu_process.c | 24 ------------------------
5 files changed, 6 insertions(+), 41 deletions(-)
--
2.38.1
1 year, 10 months
[PATCH 00/15] vbox: Add support for version 7.0 SDK and drop old
by Michal Privoznik
For full experience you'll need to apply these on top of:
https://listman.redhat.com/archives/libvir-list/2023-January/237248.html
Michal Prívozník (15):
vbox: Drop misleading G_GNUC_UNUSED annotation
vbox: Drop @mediaChangeOnly from vboxDomainAttachDeviceImpl()
vbox: Drop @iid from UIMachine::LaunchVMProcess()
vbox: Drop @iid from UISession::Open()
vbox: Drop @iid from UISession::OpenExisting()
vbox: Drop @data and @name from
UIHost::CreateHostOnlyNetworkInterface()
vbox: Drop UIUSBCommon::Enable()
vbox: Drop UIUSBCommon::GetEnabled()
vbox: Drop support for virtualbox-5.2.0
vbox: Drop support for virtualbox-6.0.0
vbox: Drop @networkName from UIDHCPServer::Start()
vbox: Rename #include guard macro in header files
vbox: add version 7.0 CAPI header
vbox: Add support for version 7.0 SDK
NEWS: Document recent vbox changes
NEWS.rst | 11 +
docs/drvvbox.rst | 2 +-
src/vbox/meson.build | 3 +-
src/vbox/vbox_CAPI_v5_2.h | 26870 ----------------
src/vbox/vbox_CAPI_v6_1.h | 6 +-
.../{vbox_CAPI_v6_0.h => vbox_CAPI_v7_0.h} | 9280 +++++-
src/vbox/vbox_V6_0.c | 13 -
src/vbox/{vbox_V5_2.c => vbox_V7_0.c} | 6 +-
src/vbox/vbox_XPCOMCGlue.h | 2 +-
src/vbox/vbox_common.c | 65 +-
src/vbox/vbox_common.h | 8 +-
src/vbox/vbox_network.c | 5 +-
src/vbox/vbox_storage.c | 10 +-
src/vbox/vbox_tmpl.c | 204 +-
src/vbox/vbox_uniformed_api.h | 15 +-
15 files changed, 8713 insertions(+), 27787 deletions(-)
delete mode 100644 src/vbox/vbox_CAPI_v5_2.h
rename src/vbox/{vbox_CAPI_v6_0.h => vbox_CAPI_v7_0.h} (75%)
delete mode 100644 src/vbox/vbox_V6_0.c
rename src/vbox/{vbox_V5_2.c => vbox_V7_0.c} (68%)
--
2.39.1
1 year, 10 months
[PATCH] network: Increase max route size when checking IPv6 forwarding
by Brooks Swinnerton
In d9ee51e, virNetDevIPCheckIPv6Forwarding was updated to walk the
contents of /proc/net/ipv6_route so that it could check to see if the
RTF_ADDRCONF was set on any IPv6 routes to ultimately determine if
enabling forwarding would result in an error due to accept_ra=1 being
set on the interface.
The implementation added in that commit limited the number of routes
that could be read from /proc/net/ipv6_route to 100_000, each with 150
characters. This is problematic for machines that have a full IPv6
routing table, as the IPv6 routing table has now grown to over 160_000
(it was closer to 100_000 at the time of that commit).
This patch increases the maximum route size from 100_000 to 1_000_000.
While a million routes is somewhat arbitrary, it's meant to be a value
that can be supported for the forseeable future. APNIC, one of the five
regional internet registries, recently published a forecast of IPv6
table growth which anticipates a worst-case growth to 1_000_000 in
January of 2029.
Signed-off-by: Brooks Swinnerton <bswinnerton(a)gmail.com>
---
src/util/virnetdevip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 2eacb64ebe..034b392ee7 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -529,7 +529,7 @@ virNetDevIPCheckIPv6Forwarding(void)
char *cur;
g_autofree char *buf = NULL;
/* lines are 150 chars */
- enum {MAX_ROUTE_SIZE = 150*100000};
+ enum {MAX_ROUTE_SIZE = 150*1000000};
/* This is /proc/sys/net/ipv6/conf/all/accept_ra */
int all_accept_ra = virNetDevIPGetAcceptRA(NULL);
--
2.39.1
1 year, 10 months
[PATCH V2 1/1] qemuProcessEventSubmit : rename vm to event->vm
by Shaleen Bathla
In error case, free event->vm instead of vm.
This makes it easier for the reader to understand what we should free.
Signed-off-by: Shaleen Bathla <shaleen.bathla(a)oracle.com>
---
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ee9f0784d3a3..83b553418068 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -287,7 +287,7 @@ qemuProcessEventSubmit(virDomainObj *vm,
event->data = data;
if (virThreadPoolSendJob(driver->workerPool, 0, event) < 0) {
- virObjectUnref(vm);
+ virObjectUnref(event->vm);
qemuProcessEventFree(event);
}
}
--
2.31.1
1 year, 10 months
[PATCH V2 0/2] define g_autoptr for virNWFilterDef and virNWFilterRuleDef
by Jiang Jiacheng
Define and use g_autoptr() for virNWFilterDef and virNWFilterRuleDef,
and remove unnecessary label/variable.
Those patches are followup with:
https://gitlab.com/libvirt/libvirt/-/commit/a9027d447be789cd11c0aa18ceb83...
diff to v1:
* drop two changes that may cause memory leaks in
'nwfilterDefineXMLFlags' and 'virNWFilterObjListLoadConfig'
Jiang Jiacheng (2):
conf: define g_autoptr for virNWFilterDef and virNWFilterRuleDef
src/tests: use g_autoptr for virNWFilterDef and virNWFilterRuleDef
src/conf/nwfilter_conf.c | 44 +++++++++++++++----------------------
src/conf/nwfilter_conf.h | 2 ++
tests/nwfilterxml2xmltest.c | 22 +++++++------------
3 files changed, 28 insertions(+), 40 deletions(-)
--
2.33.0
1 year, 10 months