[PATCH v2 0/9] move checks from parse to validate callbacks
by Daniel Henrique Barboza
Hi,
This is the respin of [1] after the reviews from Michal.
Although we're pushing code to validate callbacks instead of
post parse functions, the idea and motivation is still in line
with [2].
[1] https://www.redhat.com/archives/libvir-list/2020-November/msg01409.html
[2] https://gitlab.com/libvirt/libvirt/-/issues/7
Daniel Henrique Barboza (9):
domain_conf.c: move boot related timeouts check to validate callback
domain_conf.c: move primary video check to validate callback
domain_conf.c: move QXL attributes check to
virDomainVideoDefValidate()
domain_conf.c: move vendor, product and tray checks to validate
callback
domain_conf.c: move smartcard address check to validate callback
domain_conf.c: move blkio path check to validate callback
domain_conf.c: move virDomainPCIControllerOpts checks to validate
callback
domain_conf.c: move pci-root/pcie-root address check to validateCB
domain_conf.c: move idmapEntry checks to validate callback
src/conf/domain_conf.c | 353 +++++++++++-------
tests/qemuxml2argvdata/pci-root-address.err | 2 +-
.../pseries-default-phb-numa-node.err | 2 +-
.../video-multiple-primaries.err | 1 +
.../video-multiple-primaries.xml | 32 ++
tests/qemuxml2argvtest.c | 14 +-
6 files changed, 268 insertions(+), 136 deletions(-)
create mode 100644 tests/qemuxml2argvdata/video-multiple-primaries.err
create mode 100644 tests/qemuxml2argvdata/video-multiple-primaries.xml
--
2.26.2
4 years
[libvirt PATCH 0/3] gitlab: refresh containers
by Daniel P. Berrangé
This syncs with latest state of libvirt-ci.git
Daniel P. Berrang=C3=A9 (3):
gitlab: re-generate container images from lcitool
gitlab: refresh containers with lcitool for fully minimized base
ci: replace "libvirt-" prefix with "ci-" in dockerfiles
.gitlab-ci.yml | 22 +++++++--------
...os-7.Dockerfile =3D> ci-centos-7.Dockerfile} | 21 ++------------
...os-8.Dockerfile =3D> ci-centos-8.Dockerfile} | 22 ++-------------
...Dockerfile =3D> ci-centos-stream.Dockerfile} | 22 ++-------------
... =3D> ci-debian-10-cross-aarch64.Dockerfile} | 22 ++-------------
...e =3D> ci-debian-10-cross-armv6l.Dockerfile} | 22 ++-------------
...e =3D> ci-debian-10-cross-armv7l.Dockerfile} | 22 ++-------------
...ile =3D> ci-debian-10-cross-i686.Dockerfile} | 22 ++-------------
...ile =3D> ci-debian-10-cross-mips.Dockerfile} | 22 ++-------------
...=3D> ci-debian-10-cross-mips64el.Dockerfile} | 22 ++-------------
...e =3D> ci-debian-10-cross-mipsel.Dockerfile} | 22 ++-------------
... =3D> ci-debian-10-cross-ppc64le.Dockerfile} | 22 ++-------------
...le =3D> ci-debian-10-cross-s390x.Dockerfile} | 22 ++-------------
...-10.Dockerfile =3D> ci-debian-10.Dockerfile} | 22 ++-------------
...=3D> ci-debian-sid-cross-aarch64.Dockerfile} | 25 ++---------------
... =3D> ci-debian-sid-cross-armv6l.Dockerfile} | 25 ++---------------
... =3D> ci-debian-sid-cross-armv7l.Dockerfile} | 25 ++---------------
...le =3D> ci-debian-sid-cross-i686.Dockerfile} | 25 ++---------------
...> ci-debian-sid-cross-mips64el.Dockerfile} | 25 ++---------------
... =3D> ci-debian-sid-cross-mipsel.Dockerfile} | 25 ++---------------
...=3D> ci-debian-sid-cross-ppc64le.Dockerfile} | 25 ++---------------
...e =3D> ci-debian-sid-cross-s390x.Dockerfile} | 25 ++---------------
...id.Dockerfile =3D> ci-debian-sid.Dockerfile} | 25 ++---------------
...-32.Dockerfile =3D> ci-fedora-32.Dockerfile} | 24 ++--------------
...-31.Dockerfile =3D> ci-fedora-33.Dockerfile} | 28 ++-----------------
...i-fedora-rawhide-cross-mingw32.Dockerfile} | 24 ++--------------
...i-fedora-rawhide-cross-mingw64.Dockerfile} | 24 ++--------------
...ockerfile =3D> ci-fedora-rawhide.Dockerfile} | 24 ++--------------
....Dockerfile =3D> ci-opensuse-151.Dockerfile} | 23 ++-------------
...4.Dockerfile =3D> ci-ubuntu-1804.Dockerfile} | 22 ++-------------
...4.Dockerfile =3D> ci-ubuntu-2004.Dockerfile} | 22 ++-------------
ci/containers/refresh | 14 +++++-----
32 files changed, 82 insertions(+), 655 deletions(-)
rename ci/containers/{libvirt-centos-7.Dockerfile =3D> ci-centos-7.Dockerfil=
e} (92%)
rename ci/containers/{libvirt-centos-8.Dockerfile =3D> ci-centos-8.Dockerfil=
e} (88%)
rename ci/containers/{libvirt-centos-stream.Dockerfile =3D> ci-centos-stream=
.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-10-cross-aarch64.Dockerfile =3D> ci-deb=
ian-10-cross-aarch64.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-armv6l.Dockerfile =3D> ci-debi=
an-10-cross-armv6l.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-armv7l.Dockerfile =3D> ci-debi=
an-10-cross-armv7l.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-i686.Dockerfile =3D> ci-debian=
-10-cross-i686.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-mips.Dockerfile =3D> ci-debian=
-10-cross-mips.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-mips64el.Dockerfile =3D> ci-de=
bian-10-cross-mips64el.Dockerfile} (91%)
rename ci/containers/{libvirt-debian-10-cross-mipsel.Dockerfile =3D> ci-debi=
an-10-cross-mipsel.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-ppc64le.Dockerfile =3D> ci-deb=
ian-10-cross-ppc64le.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10-cross-s390x.Dockerfile =3D> ci-debia=
n-10-cross-s390x.Dockerfile} (90%)
rename ci/containers/{libvirt-debian-10.Dockerfile =3D> ci-debian-10.Dockerf=
ile} (87%)
rename ci/containers/{libvirt-debian-sid-cross-aarch64.Dockerfile =3D> ci-de=
bian-sid-cross-aarch64.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-armv6l.Dockerfile =3D> ci-deb=
ian-sid-cross-armv6l.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-armv7l.Dockerfile =3D> ci-deb=
ian-sid-cross-armv7l.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-i686.Dockerfile =3D> ci-debia=
n-sid-cross-i686.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-mips64el.Dockerfile =3D> ci-d=
ebian-sid-cross-mips64el.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-mipsel.Dockerfile =3D> ci-deb=
ian-sid-cross-mipsel.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-ppc64le.Dockerfile =3D> ci-de=
bian-sid-cross-ppc64le.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid-cross-s390x.Dockerfile =3D> ci-debi=
an-sid-cross-s390x.Dockerfile} (88%)
rename ci/containers/{libvirt-debian-sid.Dockerfile =3D> ci-debian-sid.Docke=
rfile} (84%)
rename ci/containers/{libvirt-fedora-32.Dockerfile =3D> ci-fedora-32.Dockerf=
ile} (85%)
rename ci/containers/{libvirt-fedora-31.Dockerfile =3D> ci-fedora-33.Dockerf=
ile} (83%)
rename ci/containers/{libvirt-fedora-rawhide-cross-mingw32.Dockerfile =3D> c=
i-fedora-rawhide-cross-mingw32.Dockerfile} (82%)
rename ci/containers/{libvirt-fedora-rawhide-cross-mingw64.Dockerfile =3D> c=
i-fedora-rawhide-cross-mingw64.Dockerfile} (82%)
rename ci/containers/{libvirt-fedora-rawhide.Dockerfile =3D> ci-fedora-rawhi=
de.Dockerfile} (85%)
rename ci/containers/{libvirt-opensuse-151.Dockerfile =3D> ci-opensuse-151.D=
ockerfile} (85%)
rename ci/containers/{libvirt-ubuntu-1804.Dockerfile =3D> ci-ubuntu-1804.Doc=
kerfile} (87%)
rename ci/containers/{libvirt-ubuntu-2004.Dockerfile =3D> ci-ubuntu-2004.Doc=
kerfile} (87%)
--=20
2.28.0
4 years
[PATCH 0/4] qemu: Don't use updated qemuCaps in validation code
by Peter Krempa
See patch 4/4 for the justification.
CI run:
https://gitlab.com/pipo.sk/libvirt/-/pipelines/226815271
since the series is modifying stuff I don't compile usually.
Peter Krempa (4):
virDomainDefValidate: Add per-run 'opaque' data
qemu: validate: Don't check that qemuCaps is non-NULL
qemuValidateDomainDeviceDefFS: Fix block indentation
qemu: validate: Prefer existing qemuCaps
src/bhyve/bhyve_domain.c | 3 +-
src/conf/domain_conf.c | 21 +++---
src/conf/domain_conf.h | 9 ++-
src/qemu/qemu_process.c | 2 +-
src/qemu/qemu_validate.c | 138 ++++++++++++++++++++-------------------
src/qemu/qemu_validate.h | 7 +-
src/vz/vz_driver.c | 6 +-
7 files changed, 103 insertions(+), 83 deletions(-)
--
2.28.0
4 years
[PATCH 0/2] virsh: Fix set-user-sshkeys command
by Michal Privoznik
The first patch is a bug fix, the second is an improvement.
Michal Prívozník (2):
virsh: Fix logical error in cmdSetUserSSHKeys()
virsh: cmdSetUserSSHKeys: Error early if the file doesn't contain any
keys
tools/virsh-domain.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
--
2.26.2
4 years
[PATCH 0/8] qemu: Improve nodename lookup and format index for backup disks
by Peter Krempa
Peter Krempa (8):
qemuDomainDiskLookupByNodename: Simplify node name lookup
qemuDomainGetStorageSourceByDevstr: Use virDomainDiskByTarget
qemuDomainGetStorageSourceByDevstr: Avoid logged errors
backup: Move file format check from parser to qemu driver
virDomainBackupDiskDefParseXML: Use virDomainStorageSourceParseBase
qemuDomainDiskLookupByNodename: Lookup also backup 'store' nodenames
qemuDomainGetStorageSourceByDevstr: Lookup also backup 'store'
nodenames
conf: backup: Format index of 'store'
docs/formatbackup.rst | 4 +
src/conf/backup_conf.c | 46 ++++-------
src/qemu/qemu_backup.c | 10 ++-
src/qemu/qemu_domain.c | 78 ++++++++++++-------
src/qemu/qemu_domain.h | 4 +-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_process.c | 7 +-
.../qemustatusxml2xmldata/backup-pull-in.xml | 2 +-
8 files changed, 89 insertions(+), 64 deletions(-)
--
2.28.0
4 years
[PATCH] qemuxml2argvtest: Add 'nvme' disks into the 'disk-slices' case
by Peter Krempa
Test slices on top of nvme-backed disks.
Note that the changes in seemingly irrelevant parts of the output are
due to re-naming the nodenames.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
.../disk-slices.x86_64-latest.args | 63 ++++++++++++-------
tests/qemuxml2argvdata/disk-slices.xml | 25 ++++++++
.../disk-slices.x86_64-latest.xml | 25 ++++++++
3 files changed, 92 insertions(+), 21 deletions(-)
diff --git a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
index c4e1384f4d..a24b3395e2 100644
--- a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
@@ -30,37 +30,58 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img",\
-"node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw",\
-"offset":1234,"size":321,"file":"libvirt-4-storage"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-4-format,\
+"node-name":"libvirt-6-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw",\
+"offset":1234,"size":321,"file":"libvirt-6-storage"}' \
+-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-6-format,\
id=virtio-disk0,bootindex=1 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img",\
-"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"driver":"raw","node-name":"libvirt-3-slice-sto","offset":9876,\
-"size":123456789,"file":"libvirt-3-storage","auto-read-only":true,\
+"node-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"raw","node-name":"libvirt-5-slice-sto","offset":9876,\
+"size":123456789,"file":"libvirt-5-storage","auto-read-only":true,\
"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow2",\
-"file":"libvirt-3-slice-sto","backing":null}' \
+-blockdev '{"node-name":"libvirt-5-format","read-only":true,"driver":"qcow2",\
+"file":"libvirt-5-slice-sto","backing":null}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/overlay.qcow2",\
-"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2",\
-"file":"libvirt-2-storage","backing":"libvirt-3-format"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x3,drive=libvirt-2-format,\
+"node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"qcow2",\
+"file":"libvirt-4-storage","backing":"libvirt-5-format"}' \
+-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=libvirt-4-format,\
id=virtio-disk1 \
--object secret,id=libvirt-1-format-encryption-secret0,\
+-object secret,id=libvirt-3-format-encryption-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/luks.img",\
-"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"driver":"raw","node-name":"libvirt-1-slice-sto","offset":1234,\
-"size":321,"file":"libvirt-1-storage","auto-read-only":true,\
+"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"raw","node-name":"libvirt-3-slice-sto","offset":1234,\
+"size":321,"file":"libvirt-3-storage","auto-read-only":true,\
"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"luks",\
-"key-secret":"libvirt-1-format-encryption-secret0",\
-"file":"libvirt-1-slice-sto"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x4,drive=libvirt-1-format,\
+-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"luks",\
+"key-secret":"libvirt-3-format-encryption-secret0",\
+"file":"libvirt-3-slice-sto"}' \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=libvirt-3-format,\
id=virtio-disk2 \
+-blockdev '{"driver":"nvme","device":"0000:02:00.0","namespace":1,\
+"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw",\
+"offset":1234,"size":321,"file":"libvirt-2-storage"}' \
+-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=libvirt-2-format,\
+id=virtio-disk3 \
+-object secret,id=libvirt-1-format-encryption-secret0,\
+data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
+keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
+-blockdev '{"driver":"nvme","device":"0001:02:00.0","namespace":2,\
+"node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},\
+"auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"raw","node-name":"libvirt-1-slice-sto","offset":1234,\
+"size":321,"file":"libvirt-1-storage","auto-read-only":true,"discard":"unmap",\
+"cache":{"direct":true,"no-flush":false}}' \
+-blockdev '{"node-name":"libvirt-1-format","read-only":false,\
+"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\
+"encrypt":{"format":"luks","key-secret":"libvirt-1-format-encryption-secret0"},\
+"file":"libvirt-1-slice-sto"}' \
+-device virtio-blk-pci,bus=pci.0,addr=0x7,drive=libvirt-1-format,\
+id=virtio-disk4,write-cache=on \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
diff --git a/tests/qemuxml2argvdata/disk-slices.xml b/tests/qemuxml2argvdata/disk-slices.xml
index 5c6f29d154..1675766a46 100644
--- a/tests/qemuxml2argvdata/disk-slices.xml
+++ b/tests/qemuxml2argvdata/disk-slices.xml
@@ -51,6 +51,31 @@
<backingStore/>
<target dev='vdc' bus='virtio'/>
</disk>
+ <disk type='nvme' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source type='pci' managed='no' namespace='1'>
+ <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ <slices>
+ <slice type='storage' offset='1234' size='321'/>
+ </slices>
+ </source>
+ <target dev='vdd' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </disk>
+ <disk type='nvme' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source type='pci' managed='no' namespace='2'>
+ <address domain='0x0001' bus='0x02' slot='0x00' function='0x0'/>
+ <slices>
+ <slice type='storage' offset='1234' size='321'/>
+ </slices>
+ <encryption format='luks'>
+ <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
+ </encryption>
+ </source>
+ <target dev='vde' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </disk>
<controller type='usb'/>
<controller type='pci' model='pci-root'/>
<memballoon model='virtio'/>
diff --git a/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
index 4f4abcda1f..a02820a104 100644
--- a/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
@@ -57,6 +57,31 @@
<target dev='vdc' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
+ <disk type='nvme' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source type='pci' managed='no' namespace='1'>
+ <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ <slices>
+ <slice type='storage' offset='1234' size='321'/>
+ </slices>
+ </source>
+ <target dev='vdd' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </disk>
+ <disk type='nvme' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source type='pci' managed='no' namespace='2'>
+ <address domain='0x0001' bus='0x02' slot='0x00' function='0x0'/>
+ <slices>
+ <slice type='storage' offset='1234' size='321'/>
+ </slices>
+ <encryption format='luks'>
+ <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
+ </encryption>
+ </source>
+ <target dev='vde' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </disk>
<controller type='usb' index='0' model='piix3-uhci'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
--
2.28.0
4 years
[PATCH] qemuBlockJobInfoTranslate: Take job type from qemuBlockJobDataPtr
by Peter Krempa
Commit f5e8715a8b4 added logic which adds some fake job info when qemu
didn't return anything but in such case the job type would not be set.
Since we already have the proper job type recorded in qemuBlockJobDataPtr
which the caller fetched, we can use this it and also remove the lookup
from the disk which was necessary prior to the conversion to
qemuBlockJobDataPtr.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
I've wanted to fix it before pushing what would become commit f5e8715a8b4
but Michal accidentally pushed it with one of his patches.
src/qemu/qemu_driver.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d8478945d6..5d4697103d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14638,9 +14638,11 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
static int
qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfoPtr rawInfo,
virDomainBlockJobInfoPtr info,
- virDomainDiskDefPtr disk,
+ qemuBlockJobDataPtr job,
bool reportBytes)
{
+ info->type = job->type;
+
/* If the job data is no longer present this means that the job already
* disappeared in qemu (pre-blockdev) but libvirt didn't process the
* finishing yet. Fake a incomplete job. */
@@ -14674,11 +14676,6 @@ qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfoPtr rawInfo,
info->cur > 0)
info->cur -= 1;
- info->type = rawInfo->type;
- if (info->type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT &&
- disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)
- info->type = disk->mirrorJob;
-
if (rawInfo->bandwidth && !reportBytes)
rawInfo->bandwidth = VIR_DIV_UP(rawInfo->bandwidth, 1024 * 1024);
info->bandwidth = rawInfo->bandwidth;
@@ -14737,7 +14734,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
rawInfo = g_hash_table_lookup(blockjobstats, job->name);
- if (qemuBlockJobInfoTranslate(rawInfo, info, disk,
+ if (qemuBlockJobInfoTranslate(rawInfo, info, job,
flags & VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES) < 0)
goto endjob;
--
2.28.0
4 years
[libvirt PATCH] util: add missing FSF copyright statement
by Daniel P. Berrangé
We previous added code for passing FDs which was explicitly derived from
gnulib's passfd code:
commit 17460825f3c78e1635f2beb0165c5a19e3b09f7d
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Fri Jan 17 11:57:17 2020 +0000
src: implement APIs for passing FDs over UNIX sockets
This is a simplified variant of gnulib's passfd module
without the portability code that we do not require.
while the license was unchanged, we mistakenly failed to copy the FSF
copyright header which is required by the license terms.
Reported-by: Bruno Haible <bruno(a)clisp.org>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a trivial fix
src/util/virsocket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/virsocket.c b/src/util/virsocket.c
index 9aa29f1eb6..c8435a1087 100644
--- a/src/util/virsocket.c
+++ b/src/util/virsocket.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2020 Red Hat, Inc.
+ * Copyright (C) 2011-2020 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
--
2.28.0
4 years
[PATCH for-6.0] accel: Wire accel to /machine
by Roman Bolshakov
There's no generic way to query current accel and its properties via QOM
because there's no link between an accel and current machine.
The change adds the link, i.e. if HVF is enabled the following will be
available in QOM:
(qemu) qom-get /machine/accel type
"hvf-accel"
Suggested-by: Markus Armbruster <armbru(a)redhat.com>
Suggested-by: Paolo Bonzini <pbonzini(a)redhat.com>
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
Hi,
this is a follow up patch that deprecates earlier series [1].
An outstanding issue is whether management applications can rely on the
value of /machine/accel/type and output of qom-list-types command [2][3]
to get current and present accels?
i.e. would it be ok if libvirt assumes that everything up to the first
dash in the accel type is the name of the accel (as specified via -M
accel=ACCEL flag) when it performs QEMU probing?
Also, Eduardo and Claudio earlier had ideas to provide cpu-specific
accel subclasses [4][5].
1. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg03944.html
2. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg04212.html
3. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg07062.html
4. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg06513.html
5. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg06741.html
Thanks,
Roman
accel/accel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/accel/accel.c b/accel/accel.c
index cb555e3b06..45c5bf87b1 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -56,10 +56,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
if (ret < 0) {
ms->accelerator = NULL;
*(acc->allowed) = false;
- object_unref(OBJECT(accel));
} else {
object_set_accelerator_compat_props(acc->compat_props);
+ object_property_add_child(OBJECT(ms), "accel", OBJECT(accel));
}
+ object_unref(OBJECT(accel));
return ret;
}
--
2.29.2
4 years