[libvirt PATCH 0/2] A few fixes in error messages
by Jiri Denemark
These fixes were separated from my "Use permutable format strings in
translations" series. There are more VIR_PCI_DEVICE_ADDRESS_FMT cases
fixed here compared to the format strings series as not all of them were
identified by either syntax check or libvirt-pot-check.
Jiri Denemark (2):
Drop excess whitespace from error messages
Do not use VIR_PCI_DEVICE_ADDRESS_FMT in translations
src/conf/domain_conf.c | 6 ++----
src/libxl/libxl_driver.c | 15 +++++----------
src/qemu/qemu_hotplug.c | 14 ++++----------
src/util/virnetdevvportprofile.c | 3 +--
src/util/virsocketaddr.c | 3 +--
5 files changed, 13 insertions(+), 28 deletions(-)
--
2.40.0
1 year, 7 months
Re: Re: [PATCH RFC 20/21] conf: Add possibility to configure multiple iothreads per disk
by Stefan Hajnoczi
Hi Peter,
> + - The optional ``iothreads`` sub-element allows specifying multiple IOThreads
> + via the ``iothread`` sub-element with attribute ``id`` the disk will use
> + for I/O operations. Optionally the ``iothread`` element can have multiple
> + ``queue`` subelements specifying that given iothread should be used to
> + handle given queues. :since:`Since XXXXXX`.
Although this says that the ``queue`` sub-elements are optional, it
may be clearer to add another sentence that explains the device will
automatically assign virtqueues to the given ``iothread`` sub-elements
when ``queue`` is not given. That answers the question of "what is the
behavior of omitting ``queue``?".
> + <driver name='qemu' queues='2'>
> + <iothreads>
> + <iothread id='1'>
> + <queue id='1'/>
> + </iothread>
> + <iothread id='2'>
> + <queue id='1'/>
> + </iothread>
Each queue can only be assigned to 1 IOThread, so <queue id='1'/>
cannot be assigned to multiple IOThreads.
Thank you,
Stefan
1 year, 7 months
Plans for the next release
by Jiri Denemark
We are getting close to the next release of libvirt. To aim for the
release on Mar 31 (in the evening since Apr 1 is Saturday) I suggest
entering the freeze on Monday Mar 27 and tagging RC2 on Wednesday Mar 29
in the afternoon.
I hope this works for everyone.
Jirka
1 year, 7 months
[PATCH] tests: Compile virgdbusmock.c with GIO_COMPILATION enabled
by Michal Privoznik
There are couple of g_dbus_*() functions we provide an
alternative implementation for in our virgdbusmock.c. However,
these functions are declared in gio/gdbusconnection.h as:
GIO_AVAILABLE_IN_ALL
GDBusConnection *g_bus_get_sync (GBusType bus_type,
GCancellable *cancellable,
GError **error);
where GIO_AVAILABLE_IN_ALL is declared as (in
/gio/gio-visibility.h):
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(GIO_STATIC_COMPILATION)
# define _GIO_EXPORT __declspec(dllexport)
# define _GIO_IMPORT __declspec(dllimport)
#elif __GNUC__ >= 4
# define _GIO_EXPORT __attribute__((visibility("default")))
# define _GIO_IMPORT
#else
# define _GIO_EXPORT
# define _GIO_IMPORT
#endif
#ifdef GIO_COMPILATION
# define _GIO_API _GIO_EXPORT
#else
# define _GIO_API _GIO_IMPORT
#endif
#define _GIO_EXTERN _GIO_API extern
#define GIO_AVAILABLE_IN_ALL _GIO_EXTERN
Now, on mingw the functions we mock are declared with dllimport
attribute which makes the compiler unhappy:
../tests/virgdbusmock.c:25:24: error: 'g_bus_get_sync'
redeclared without dllimport attribute: previous dllimport
ignored [-Werror=attributes]
The solution is to do what glib does when it compiles the gio
module: set GIO_COMPILATION macro which in turn annotates the
function with dllexport attribute.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/meson.build | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/meson.build b/tests/meson.build
index 0fd3bc62cf..6be806f4ae 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -65,6 +65,10 @@ else
endif
+virgdbusmock_dep = declare_dependency(
+ compile_args: [ '-DGIO_COMPILATION' ]
+)
+
# mock_libs:
# each entry is a dictionary with following items:
# * name - mock library name which is also used as default source file name (required)
@@ -78,7 +82,7 @@ mock_libs = [
{ 'name': 'virdnsmasqmock' },
{ 'name': 'virfilecachemock' },
{ 'name': 'virfirewallmock' },
- { 'name': 'virgdbusmock' },
+ { 'name': 'virgdbusmock', 'deps': [ virgdbusmock_dep] },
{ 'name': 'virhostcpumock' },
{ 'name': 'virhostdevmock' },
{ 'name': 'virnetdaemonmock' },
--
2.39.2
1 year, 8 months
[PATCH] storage_file_probe: change maximum len value in vmdk4GetBackingStore
by Анастасия Белова
From: Anastasia Belova <abelova(a)astralinux.ru>
desc length should be always less than VIR_STORAGE_MAX_HEADER.
If len = VIR_STORAGE_MAX_HEADER, desc may be out of bounds.
Fixes: 296032bfb2 ("util: extract storage file probe code into virtstoragefileprobe.c")
Signed-off-by: Anastasia Belova <abelova(a)astralinux.ru>
---
src/storage_file/storage_file_probe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/storage_file/storage_file_probe.c b/src/storage_file/storage_file_probe.c
index 9465af5d96..0dcc9c2c54 100644
--- a/src/storage_file/storage_file_probe.c
+++ b/src/storage_file/storage_file_probe.c
@@ -586,8 +586,8 @@ vmdk4GetBackingStore(char **res,
return BACKING_STORE_INVALID;
len = buf_size - 0x200;
- if (len > VIR_STORAGE_MAX_HEADER)
- len = VIR_STORAGE_MAX_HEADER;
+ if (len >= VIR_STORAGE_MAX_HEADER)
+ len = VIR_STORAGE_MAX_HEADER - 1;
memcpy(desc, buf + 0x200, len);
desc[len] = '\0';
start = strstr(desc, prefix);
--
2.30.2
1 year, 8 months
[PATCH 0/5] Consistently use 'libvirt.org' instead of 'www.libvirt.org' and update links to subprojects
by Peter Krempa
Note that the required DNS changes for the subproject pages are not live
yet.
Peter Krempa (5):
Use 'libvirt.org' instead of 'www.libvirt.org'
docs: Update link to the php bindings project webpage
docs: Update links to the libvirt-ocaml bindings project webpage
docs: Update links to the libvirt-ruby bindings project webpage
docs: java: Use new hostname for the sub-project
docs/apps.rst | 2 +-
docs/bindings.rst | 8 ++++----
docs/docs.rst | 6 +++---
docs/downloads.rst | 2 +-
docs/java.rst | 2 +-
docs/manpages/libvirtd.rst | 2 +-
docs/manpages/virt-admin.rst | 2 +-
docs/manpages/virt-pki-query-dn.rst | 2 +-
docs/manpages/virt-pki-validate.rst | 2 +-
docs/manpages/virt-qemu-sev-validate.rst | 2 +-
docs/manpages/virtbhyved.rst | 4 ++--
docs/manpages/virtinterfaced.rst | 4 ++--
docs/manpages/virtlxcd.rst | 4 ++--
docs/manpages/virtnetworkd.rst | 4 ++--
docs/manpages/virtnodedevd.rst | 4 ++--
docs/manpages/virtnwfilterd.rst | 4 ++--
docs/manpages/virtproxyd.rst | 2 +-
docs/manpages/virtqemud.rst | 4 ++--
docs/manpages/virtsecretd.rst | 4 ++--
docs/manpages/virtstoraged.rst | 4 ++--
docs/manpages/virtvboxd.rst | 4 ++--
docs/manpages/virtvzd.rst | 4 ++--
docs/manpages/virtxend.rst | 4 ++--
docs/meson.build | 1 -
docs/php.rst | 23 -----------------------
docs/styleguide.rst | 2 +-
docs/testapi.rst | 2 +-
src/libvirt-domain-checkpoint.c | 2 +-
src/libvirt-domain.c | 2 +-
29 files changed, 44 insertions(+), 68 deletions(-)
delete mode 100644 docs/php.rst
--
2.39.2
1 year, 8 months
[libvirt PATCH] cpu-data.py: Filter out apic current logical processor
by Tim Wiederhake
Commit 10b5e789c5 attempts to filter out the logical processor id
in the generated data to remove noise and irrelevant changes in the
output.
cpuid-leaf 0x0B may have more than two sub-leaves though. Filter out
logical processor id from all sub-leaves of 0x0B and 0x1F (superset
of the information in 0x0B).
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
tests/cputestdata/cpu-data.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py
index 498e07b2f7..b5641f7c16 100755
--- a/tests/cputestdata/cpu-data.py
+++ b/tests/cputestdata/cpu-data.py
@@ -107,11 +107,14 @@ def gather_cpuid_leaves_kcpuid(output):
def gather_cpuid_leaves(args):
def mask(regs, eax_in, ecx_in, eax_mask, ebx_mask, ecx_mask, edx_mask):
- if regs["eax_in"] == eax_in and regs["ecx_in"] == ecx_in:
- regs["eax"] &= eax_mask
- regs["ebx"] &= ebx_mask
- regs["ecx"] &= ecx_mask
- regs["edx"] &= edx_mask
+ if eax_in != regs["eax_in"]:
+ return
+ if ecx_in != regs["ecx_in"] and ecx_in is not None:
+ return
+ regs["eax"] &= eax_mask
+ regs["ebx"] &= ebx_mask
+ regs["ecx"] &= ecx_mask
+ regs["edx"] &= edx_mask
cpuid = args.path_to_cpuid or "cpuid"
try:
@@ -132,8 +135,8 @@ def gather_cpuid_leaves(args):
for regs in reglist:
# local apic id. Pretend to always run on logical processor #0.
mask(regs, 0x01, 0x00, 0xffffffff, 0x00ffffff, 0xffffffff, 0xffffffff)
- mask(regs, 0x0b, 0x00, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00)
- mask(regs, 0x0b, 0x01, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00)
+ mask(regs, 0x0b, None, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000)
+ mask(regs, 0x1f, None, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000)
yield regs
--
2.39.2
1 year, 8 months
[PATCH] qemu: Add vhost-user-blk unix socket to support server mode
by Zhenguo Yao
qemu support server mode when using vhost-user-blk disk.
Let libvirt to support this.
Signed-off-by: Zhenguo Yao <yaozhenguo1(a)gmail.com>
---
src/conf/domain_conf.c | 14 ++++++++++++++
src/conf/schemas/domaincommon.rng | 8 ++++++++
.../disk-vhostuser-numa.x86_64-4.2.0.args | 6 ++++--
.../disk-vhostuser-numa.x86_64-latest.args | 6 ++++--
tests/qemuxml2argvdata/disk-vhostuser-numa.xml | 9 +++++++--
.../disk-vhostuser.x86_64-latest.args | 6 ++++--
tests/qemuxml2argvdata/disk-vhostuser.xml | 9 +++++++--
.../disk-vhostuser.x86_64-latest.xml | 12 +++++++++---
8 files changed, 57 insertions(+), 13 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a5578324b9..61addbe222 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7283,6 +7283,7 @@ virDomainDiskSourceVHostUserParse(xmlNodePtr node,
{
g_autofree char *type = virXMLPropString(node, "type");
g_autofree char *path = virXMLPropString(node, "path");
+ g_autofree char *mode = virXMLPropString(node, "mode");
if (!type) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@@ -7313,6 +7314,17 @@ virDomainDiskSourceVHostUserParse(xmlNodePtr node,
ctxt) < 0) {
return -1;
}
+ if (mode && STREQ(mode, "server")) {
+ src->vhostuser->data.nix.listen = true;
+ if (src->vhostuser->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_YES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("'reconnect' attribute unsupported "
+ "'server' mode for `<disk type='vhostuser'>`"));
+ return -1;
+ }
+ } else if (mode && STREQ(mode, "client")) {
+ src->vhostuser->data.nix.listen = false;
+ }
return 0;
}
@@ -22121,6 +22133,8 @@ virDomainDiskSourceVhostuserFormat(virBuffer *attrBuf,
virBufferAddLit(attrBuf, " type='unix'");
virBufferAsprintf(attrBuf, " path='%s'", vhostuser->data.nix.path);
+ if (vhostuser->data.nix.listen)
+ virBufferAsprintf(attrBuf, " mode='%s'", "server");
virDomainChrSourceReconnectDefFormat(childBuf, &vhostuser->data.nix.reconnect);
}
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index a57dd212ab..d926195d69 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -2359,6 +2359,14 @@
<attribute name="path">
<ref name="absFilePath"/>
</attribute>
+ <optional>
+ <attribute name="mode">
+ <choice>
+ <value>server</value>
+ <value>client</value>
+ </choice>
+ </attribute>
+ </optional>
<optional>
<ref name="reconnect"/>
</optional>
diff --git a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
index 4480266e75..afd0be4ea5 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
+++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
@@ -31,9 +31,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-chardev socket,id=chr-vu-virtio-disk0,path=/tmp/vhost1.sock \
-device vhost-user-blk-pci,bus=pci.0,addr=0x2,chardev=chr-vu-virtio-disk0,id=virtio-disk0,bootindex=1 \
--chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \
+-chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,server=on,wait=off \
-device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x3,chardev=chr-vu-virtio-disk1,id=virtio-disk1 \
+-chardev socket,id=chr-vu-virtio-disk2,path=/tmp/vhost1.sock,reconnect=10 \
+-device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x4,chardev=chr-vu-virtio-disk2,id=virtio-disk2 \
-audiodev '{"id":"audio1","driver":"none"}' \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args
index 75b3232dad..ea4b227328 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args
@@ -31,9 +31,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-chardev socket,id=chr-vu-virtio-disk0,path=/tmp/vhost1.sock \
-device '{"driver":"vhost-user-blk-pci","bus":"pci.0","addr":"0x2","chardev":"chr-vu-virtio-disk0","id":"virtio-disk0","bootindex":1}' \
--chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \
+-chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,server=on,wait=off \
-device '{"driver":"vhost-user-blk-pci","iommu_platform":true,"ats":true,"packed":true,"bus":"pci.0","addr":"0x3","chardev":"chr-vu-virtio-disk1","id":"virtio-disk1"}' \
+-chardev socket,id=chr-vu-virtio-disk2,path=/tmp/vhost1.sock,reconnect=10 \
+-device '{"driver":"vhost-user-blk-pci","iommu_platform":true,"ats":true,"packed":true,"bus":"pci.0","addr":"0x4","chardev":"chr-vu-virtio-disk2","id":"virtio-disk2"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x4"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x5"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-vhostuser-numa.xml b/tests/qemuxml2argvdata/disk-vhostuser-numa.xml
index 49efbae0a2..1135b51b8a 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser-numa.xml
+++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.xml
@@ -23,10 +23,15 @@
</disk>
<disk type='vhostuser' device='disk'>
<driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
- <source type='unix' path='/tmp/vhost1.sock'>
+ <source type='unix' path='/tmp/vhost1.sock' mode='server'/>
+ <target dev='vdb' bus='virtio'/>
+ </disk>
+ <disk type='vhostuser' device='disk'>
+ <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
+ <source type='unix' path='/tmp/vhost1.sock' mode='client'>
<reconnect enabled='yes' timeout='10'/>
</source>
- <target dev='vdb' bus='virtio'/>
+ <target dev='vdc' bus='virtio'/>
</disk>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
index 31428fc697..4391776b88 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
@@ -30,9 +30,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-chardev socket,id=chr-vu-virtio-disk0,path=/tmp/vhost1.sock \
-device '{"driver":"vhost-user-blk-pci","bus":"pci.0","addr":"0x2","chardev":"chr-vu-virtio-disk0","id":"virtio-disk0","bootindex":1}' \
--chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \
+-chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,server=on,wait=off \
-device '{"driver":"vhost-user-blk-pci","iommu_platform":true,"ats":true,"packed":true,"bus":"pci.0","addr":"0x3","chardev":"chr-vu-virtio-disk1","id":"virtio-disk1"}' \
+-chardev socket,id=chr-vu-virtio-disk2,path=/tmp/vhost1.sock,reconnect=10 \
+-device '{"driver":"vhost-user-blk-pci","iommu_platform":true,"ats":true,"packed":true,"bus":"pci.0","addr":"0x4","chardev":"chr-vu-virtio-disk2","id":"virtio-disk2"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x4"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x5"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.xml b/tests/qemuxml2argvdata/disk-vhostuser.xml
index a0a3df4dd0..33fc0b885e 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser.xml
+++ b/tests/qemuxml2argvdata/disk-vhostuser.xml
@@ -21,10 +21,15 @@
</disk>
<disk type='vhostuser' device='disk'>
<driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
- <source type='unix' path='/tmp/vhost1.sock'>
+ <source type='unix' path='/tmp/vhost1.sock' mode='server'/>
+ <target dev='vdb' bus='virtio'/>
+ </disk>
+ <disk type='vhostuser' device='disk'>
+ <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
+ <source type='unix' path='/tmp/vhost1.sock' mode='client'>
<reconnect enabled='yes' timeout='10'/>
</source>
- <target dev='vdb' bus='virtio'/>
+ <target dev='vdc' bus='virtio'/>
</disk>
</devices>
</domain>
diff --git a/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
index c64621fe93..cd955570f3 100644
--- a/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
@@ -27,13 +27,19 @@
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</disk>
+ <disk type='vhostuser' device='disk' snapshot='no'>
+ <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
+ <source type='unix' path='/tmp/vhost1.sock' mode='server'/>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </disk>
<disk type='vhostuser' device='disk' snapshot='no'>
<driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
<source type='unix' path='/tmp/vhost1.sock'>
<reconnect enabled='yes' timeout='10'/>
</source>
- <target dev='vdb' bus='virtio'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ <target dev='vdc' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
@@ -43,7 +49,7 @@
<input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/>
<memballoon model='virtio'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>
--
2.32.0
1 year, 8 months
[libvirt PATCH 0/3] qemu: Fix firmware selection backwards compatibility
by Andrea Bolognani
Andrea Bolognani (3):
tests: Introduce DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE()
tests: Add firmware-auto-efi-abi-update-aarch64 test case
qemu: Default to raw firmware for existing domains
src/qemu/qemu_domain.c | 17 +++++++++++++++++
...irmware-auto-efi-aarch64.aarch64-latest.args | 8 ++++----
...-efi-abi-update-aarch64.aarch64-latest.args} | 0
.../firmware-auto-efi-abi-update-aarch64.xml | 17 +++++++++++++++++
.../pvpanic-pci-aarch64.aarch64-latest.args | 8 ++++----
...c-pci-no-address-aarch64.aarch64-latest.args | 8 ++++----
.../virtio-iommu-aarch64.aarch64-latest.args | 8 ++++----
tests/qemuxml2argvtest.c | 6 ++++++
...firmware-auto-efi-aarch64.aarch64-latest.xml | 4 ++--
...o-efi-abi-update-aarch64.aarch64-latest.xml} | 0
.../pvpanic-pci-aarch64.aarch64-latest.xml | 4 ++--
...ic-pci-no-address-aarch64.aarch64-latest.xml | 4 ++--
.../virtio-iommu-aarch64.aarch64-latest.xml | 4 ++--
tests/qemuxml2xmltest.c | 6 ++++++
14 files changed, 70 insertions(+), 24 deletions(-)
copy tests/qemuxml2argvdata/{firmware-auto-efi-aarch64.aarch64-latest.args => firmware-auto-efi-abi-update-aarch64.aarch64-latest.args} (100%)
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
copy tests/qemuxml2xmloutdata/{firmware-auto-efi-aarch64.aarch64-latest.xml => firmware-auto-efi-abi-update-aarch64.aarch64-latest.xml} (100%)
--
2.39.2
1 year, 8 months
[PATCH] virauth: Report error on empty auth result
by Michal Privoznik
When opening a connection, it may be necessary to provide user
credentials, or some additional info (e.g. whether to trust an
ssh key). We have a special API for that: virConnectOpenAuth()
where and additional callback can be passed. This callback is
then called with _virConnectCredential struct filled partially
and it's callback's responsibility to get desired data (e.g. by
prompting user) and store it into .result member of the struct.
But we document the callback behaviour as:
If an interaction cannot be filled, fill in NULL and 0.
(meaning fill in NULL and return 0)
But this does not really fly with the way callback is called. So
far, we have three places where the callback is called:
1) remoteAuthInteract()
2) virAuthGetUsernamePath()
3) virAuthAskCredential()
Now, 1) just grabs whatever the client side provided and sends it
to the other side via RPC. All interesting work takes place at 2)
and 3). And the usual pattern in which these two are called is:
if (!(cred = wrapper()))
return -1;
where wrapper() is a function that firstly tries to get data from
a config file or URI itself. The wrappers are named
virAuthGetUsername() for virAuthGetUsernamePath() and
virAuthGetPassword() for virAuthAskCredential().
All wrappers do report error on failure. Except, when the user
provided callback set the struct member to NULL. Then they both
return NULL without setting any error. This then leads to the
generic error message:
error : An error occurred, but the cause is unknown
Since we failed to get desired credential data, we can't proceed
(what data should we pass down to the auth layer, say ssh?) and
have to fail. But, we can produce an error message that'll
hopefully point users in the right direction.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2181235
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virauth.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index 7b4a1bd8a5..d1f32f8e6d 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -176,7 +176,8 @@ virAuthGetUsernamePath(const char *path,
cred.result = NULL;
cred.resultlen = 0;
- if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
+ if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0 ||
+ !cred.result) {
virReportError(VIR_ERR_AUTH_FAILED, "%s",
_("Username request failed"));
VIR_FREE(cred.result);
@@ -310,7 +311,8 @@ virAuthAskCredential(virConnectAuthPtr auth,
ret->prompt = prompt;
- if (auth->cb(ret, 1, auth->cbdata) < 0) {
+ if (auth->cb(ret, 1, auth->cbdata) < 0 ||
+ !ret->result) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("failed to retrieve user response for authentication callback"));
return NULL;
--
2.39.2
1 year, 8 months