Devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 18 participants
- 40097 discussions
11 May '18
Repost of :
https://www.redhat.com/archives/libvir-list/2018-May/msg00251.html
to update patch 2 with the recent capabilities changes. Sync'd up
to commit id 'c9da6cbe'.
Cover from the v3 posting:
v2: https://www.redhat.com/archives/libvir-list/2018-April/msg02234.html
Changes since v2:
* Essentially handle comments from code review of original series from
comments received for patch 6:
https://www.redhat.com/archives/libvir-list/2018-April/msg02240.html
It's a somewhat simplified approach removing the ABI checks and the
adjustment to the genid value as part of domain def copy.
* (NEW) Patch 5 - add a 'genid' domain capability (similar to how Cole
added support for vmcoreinfo). Since the apps need a way to determine
whether this is enabled, this seems to be the best way.
John Ferlan (6):
conf: Add VM Generation ID parse/format support
qemu: Add VM Generation ID device capability
qemu: Alter VM Generation ID for specific startup/launch transitions
qemu: Add VM Generation ID to qemu command line
domcaps: Add 'genid' to domain capabilities
docs: Add news article for VM Generation ID
docs/formatdomain.html.in | 27 +++++++++++
docs/formatdomaincaps.html.in | 7 ++-
docs/news.xml | 13 ++++++
docs/schemas/domaincaps.rng | 7 +++
docs/schemas/domaincommon.rng | 8 ++++
src/conf/domain_capabilities.c | 3 ++
src/conf/domain_capabilities.h | 1 +
src/conf/domain_conf.c | 54 ++++++++++++++++++++++
src/conf/domain_conf.h | 5 ++
src/qemu/qemu_capabilities.c | 6 +++
src/qemu/qemu_capabilities.h | 3 ++
src/qemu/qemu_command.c | 24 ++++++++++
src/qemu/qemu_driver.c | 17 +++++--
src/qemu/qemu_process.c | 46 +++++++++++++++++-
src/qemu/qemu_process.h | 1 +
tests/domaincapsschemadata/basic.xml | 1 +
tests/domaincapsschemadata/bhyve_basic.x86_64.xml | 1 +
tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml | 1 +
tests/domaincapsschemadata/bhyve_uefi.x86_64.xml | 1 +
tests/domaincapsschemadata/full.xml | 1 +
tests/domaincapsschemadata/libxl-xenfv-usb.xml | 1 +
tests/domaincapsschemadata/libxl-xenfv.xml | 1 +
tests/domaincapsschemadata/libxl-xenpv-usb.xml | 1 +
tests/domaincapsschemadata/libxl-xenpv.xml | 1 +
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 +
.../qemu_2.12.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 1 +
.../qemu_2.6.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
.../domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../qemuxml2argvdata/genid-auto.x86_64-latest.args | 30 ++++++++++++
tests/qemuxml2argvdata/genid-auto.xml | 32 +++++++++++++
tests/qemuxml2argvdata/genid.x86_64-latest.args | 30 ++++++++++++
tests/qemuxml2argvdata/genid.xml | 32 +++++++++++++
tests/qemuxml2argvtest.c | 4 ++
tests/qemuxml2xmloutdata/genid-active.xml | 32 +++++++++++++
tests/qemuxml2xmloutdata/genid-auto-active.xml | 32 +++++++++++++
tests/qemuxml2xmloutdata/genid-auto-inactive.xml | 32 +++++++++++++
tests/qemuxml2xmloutdata/genid-inactive.xml | 32 +++++++++++++
tests/qemuxml2xmltest.c | 5 +-
53 files changed, 504 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuxml2argvdata/genid-auto.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/genid-auto.xml
create mode 100644 tests/qemuxml2argvdata/genid.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/genid.xml
create mode 100644 tests/qemuxml2xmloutdata/genid-active.xml
create mode 100644 tests/qemuxml2xmloutdata/genid-auto-active.xml
create mode 100644 tests/qemuxml2xmloutdata/genid-auto-inactive.xml
create mode 100644 tests/qemuxml2xmloutdata/genid-inactive.xml
--
2.14.3
1
6
[libvirt] [PATCH] virsh: Don't skip the first entry when the typed command share same prefix
by Lin Ma 11 May '18
by Lin Ma 11 May '18
11 May '18
Signed-off-by: Lin Ma <lma(a)suse.com>
---
tools/vsh.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index f76076b164..1516e578d9 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -3495,11 +3495,11 @@ cmdComplete(vshControl *ctl, const vshCmd *cmd)
if (!(matches = vshReadlineCompletion(arg, 0, 0)))
goto cleanup;
- /* According to rl_completion_matches documentation, the
- * first entry in @matches array is some dummy substitution
- * string for @arg. Skip it. */
- for (iter = &matches[1]; *iter; iter++)
+ for (iter = matches; *iter; iter++) {
+ if (iter == matches && matches[1])
+ continue;
printf("%s\n", *iter);
+ }
ret = true;
cleanup:
--
2.16.2
2
1
11 May '18
> This one is the "unknown" for me. What happens if you create
> Xzfs/images/vol1 (or your command below) without first creating
Xzfs/images?
Answer: it fails, unless you give the '-p' flag.
-p
Creates all the non-existing parent datasets. Datasets
created in this manner
are automatically mounted according to the mountpoint
property inherited from
their parent. Any property specified on the command line
using the -o option
is ignored. If the target filesystem already exists,
the operation completes
successfully.
Example: given an existing zfs pool called "zfs":
# zfs create zfs/foo/bar
cannot create 'zfs/foo/bar': parent does not exist
# zfs create -p zfs/foo/bar
# zfs list zfs/foo
NAME USED AVAIL REFER MOUNTPOINT
zfs/foo 192K 23.5G 96K /zfs/foo
# zfs list -r zfs/foo
NAME USED AVAIL REFER MOUNTPOINT
zfs/foo 192K 23.5G 96K /zfs/foo
zfs/foo/bar 96K 23.5G 96K /zfs/foo/bar
However, I don't see this as a problem for libvirt. The parent should
already exist when you define the pool, and I expect libvirt will only
create immediate children.
> If one digs into the virStorageBackendZFSBuildPool they will see libvirt
> pool create/build processing would "zpool create $name $path[0...n]"
> where $name is the "source.name" (in your case Xzfs/images) and
> $path[0...n] would be the various paths (in your case tmp/Xzfs)
Just to be clear, creating a zpool ("zpool create") is different to
creating a zfs dataset ("zfs create").
By analogy to LVM: a zpool is like a volume group, and a zfs
dataset/zvol is like a logical volume.
A zpool (or VG) is created from a collection of block devices - or
something which looks like a block device, e.g. a partition or a
loopback-mounted file. Those are $path[0...n] in the above, and would
be called "physical volumes" in LVM.
"zfs create" then creates a dataset (filesystem) or zvol (block device)
which draws space out of the zpool. The analogous operation in LVM is
"lvcreate", although it will only give you a block device - it's up to
you to make a filesystem within it.
In summary:
zpool create ==> vgcreate (*)
zfs create -V ==> lvcreate
(*) LVM also requires you to label the block devices with "pvcreate"
before you can add them to a volume group. zpool create doesn't require
this.
From my point of view, as a libvirt user: I *could* dedicate an entire
zpool to libvirt, but I don't want to. It would mean libvirt has full
ownership of that set of physical disks, and I may want to use the space
for other things as well.
What I want to do is to allow libvirt to use an existing zpool, with a
parent dataset which it can allocate underneath, like this:
zfs create zfs/libvirt
virsh pool-define-as --name zfs --source-name zfs/libvirt --type zfs
(instead of using pool-create/pool-build). This not only makes it clear
which datasets belong to libvirt, but allows me to do things like
storage accounting at the parent dataset level.
And actually, this almost works. It's just the pool refresh which fails,
because it tries to treat "zfs/images" as if it were a zpool. Stripping
off everything up to the first slash for "zpool get" would fix this.
Arguably this uncovers a couple of other related issues to do with error
handling:
- to the end user, "virsh pool-refresh" silently appears to work (unless
you dig down deep into logs), even though the underlying "zpool get"
returns with an error
- by this stage, pool-refresh has already destroyed all existing libvirt
volumes which were previously in the pool
Regards,
Brian.
1
0
[libvirt] [PATCH v3 0/2] rpc: fixing compilation error due to deprecated ssh_get_publickey().
by Julio Faracco 11 May '18
by Julio Faracco 11 May '18
11 May '18
After 0.7.5 release, libssh deprecated ssh_get_publickey() method to
introduce ssh_get_server_publickey(). This commit check if
ssh_get_server_publickey() is available to use. If it is not, it creates
an alias to ssh_get_publickey() during the configuration.
See the error:
make[3]: Entering directory '/home/julio/Desktop/virt/libvirt/src'
CC rpc/libvirt_net_rpc_la-virnetlibsshsession.lo
rpc/virnetlibsshsession.c:217:9: error: 'ssh_get_publickey' is deprecated [-Werror,-Wdeprecated-declarations]
if (ssh_get_publickey(sess->session, &key) != SSH_OK) {
^
/usr/include/libssh/libssh.h:489:1: note: 'ssh_get_publickey' has been explicitly marked deprecated here
SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
^
/usr/include/libssh/libssh.h:99:40: note: expanded from macro 'SSH_DEPRECATED'
^
1 error generated.
Makefile:8604: recipe for target 'rpc/libvirt_net_rpc_la-virnetlibsshsession.lo' failed
Julio Faracco (2):
m4: checking if ssh_get_server_publickey() exists.
rpc: replacing ssh_get_publickey() by ssh_get_server_publickey().
m4/virt-libssh.m4 | 13 +++++++++++++
src/rpc/virnetlibsshsession.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
--
2.17.0
2
3
11 May '18
The only one left are APIs that require virStream.
Pavel Hrdina (5):
domain: Implement MigrateToURI3 method
domain: Implement GetEmulatorPinInfo method
domain: Implement GetSecurityLabelList method
domain: Implement GetVcpuPinInfo method
connect: Implement SaveImageGetXMLDesc method
data/org.libvirt.Connect.xml | 7 ++
data/org.libvirt.Domain.xml | 24 +++++
src/connect.c | 28 ++++++
src/domain.c | 173 +++++++++++++++++++++++++++++++++++
tests/test_domain.py | 9 ++
5 files changed, 241 insertions(+)
--
2.17.0
2
6
[libvirt] [PATCH v5 00/11] Basic implementation of persistent reservations
by Michal Privoznik 11 May '18
by Michal Privoznik 11 May '18
11 May '18
v5 of:
https://www.redhat.com/archives/libvir-list/2018-April/msg00736.html
diff to v4:
- John's review worked in. Partially.
Michal Privoznik (11):
virstoragefile: Introduce virStoragePRDef
qemuDomainDiskChangeSupported: Deny changing reservations
qemu: Introduce pr-manager-helper capability
qemu: Generate pr cmd line at startup
qemu_ns: Allow /dev/mapper/control for PR
qemu_cgroup: Allow /dev/mapper/control for PR
qemu: Introduce pr_helper to qemu.conf
qemu: Start PR daemon on domain startup
qemu_hotplug: Hotplug of reservations
qemu_hotplug: Hotunplug of reservations
qemu: Detect pr-manager-helper capability
docs/formatdomain.html.in | 23 +-
docs/schemas/domaincommon.rng | 34 +--
docs/schemas/storagecommon.rng | 50 +++++
m4/virt-driver-qemu.m4 | 5 +
src/conf/domain_conf.c | 38 ++++
src/libvirt_private.syms | 6 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 4 +
src/qemu/qemu_alias.c | 18 ++
src/qemu/qemu_alias.h | 4 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 33 ++-
src/qemu/qemu_command.c | 134 ++++++++++++
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_conf.c | 7 +-
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 66 ++++++
src/qemu/qemu_domain.h | 5 +
src/qemu/qemu_hotplug.c | 149 ++++++++++++-
src/qemu/qemu_process.c | 232 +++++++++++++++++++++
src/qemu/qemu_process.h | 6 +
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/util/virdevmapper.c | 8 +-
src/util/virstoragefile.c | 164 +++++++++++++++
src/util/virstoragefile.h | 18 ++
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
.../disk-virtio-scsi-reservations.args | 38 ++++
.../disk-virtio-scsi-reservations.xml | 49 +++++
tests/qemuxml2argvtest.c | 4 +
.../disk-virtio-scsi-reservations.xml | 1 +
tests/qemuxml2xmltest.c | 2 +
36 files changed, 1075 insertions(+), 39 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.xml
create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml
--
2.16.1
2
24
This series of patches adds support for the TPM emulator backend that
is available in QEMU and based on swtpm + libtpms. It allows to attach a
TPM 1.2 or 2 to a QEMU VM. sVirt labels are used for labeling the swtpm
process, its Unix socket, and log file with the same label that the
QEMU process gets. Besides that swtpm is added to the emulator cgroup to
restrict its CPU usage.
The device XML can be changed from a TPM 1.2 to a TPM 2 and back to a
TPM 1.2. The device state is not removed during those changes but only
when the domain is undefined.
The swtpm needs persistent storage to store its state. For that I am
using the uuid of the VM as part of the path since the name of the VM
can be changed. Logfiles, PID files, and socket names are based on the
name of the VM, though.
Stefan
Stefan Berger (14):
util: implement virFileReadOffsetQuiet()
util: Implement virStringFilterLines()
conf: Add support for external swtpm TPM emulator to domain XML
qemu: Extend QEMU capabilities with 'tpm-emulator'
util: Implement virFileChownFiles()
security: Add DAC and SELinux security for tpm-emulator
util: Extend virtpm.c with tpm-emulator support
qemu: Extend qemu_conf with tpm-emulator support
qemu: Implement a layer for external devices like tpm-emulator
qemu: Add support for external swtpm TPM emulator
tests: Add test cases for external swtpm TPM emulator
security: Label the external swtpm with SELinux labels
tpm: Add support for choosing emulation of a TPM 2
qemu: Add swtpm to emulator cgroup
docs/formatdomain.html.in | 45 ++
docs/schemas/domaincommon.rng | 17 +
src/conf/domain_audit.c | 2 +
src/conf/domain_conf.c | 70 ++-
src/conf/domain_conf.h | 14 +
src/libvirt_private.syms | 9 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/libvirtd_qemu.aug | 5 +
src/qemu/qemu.conf | 8 +
src/qemu/qemu_capabilities.c | 5 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 54 ++
src/qemu/qemu_cgroup.h | 1 +
src/qemu/qemu_command.c | 40 +-
src/qemu/qemu_conf.c | 43 ++
src/qemu/qemu_conf.h | 6 +
src/qemu/qemu_domain.c | 4 +
src/qemu/qemu_driver.c | 7 +
src/qemu/qemu_extdevice.c | 339 +++++++++++
src/qemu/qemu_extdevice.h | 43 ++
src/qemu/qemu_process.c | 17 +
src/qemu/test_libvirtd_qemu.aug.in | 2 +
src/security/security_dac.c | 6 +
src/security/security_driver.h | 4 +
src/security/security_manager.c | 17 +
src/security/security_manager.h | 3 +
src/security/security_selinux.c | 89 +++
src/security/security_stack.c | 19 +
src/util/virfile.c | 63 +-
src/util/virfile.h | 6 +
src/util/virstring.c | 62 ++
src/util/virstring.h | 3 +
src/util/virtpm.c | 638 ++++++++++++++++++++-
src/util/virtpm.h | 33 +-
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemuxml2argvdata/tpm-emulator-tpm2.args | 27 +
tests/qemuxml2argvdata/tpm-emulator-tpm2.xml | 30 +
tests/qemuxml2argvdata/tpm-emulator.args | 27 +
tests/qemuxml2argvdata/tpm-emulator.xml | 30 +
tests/qemuxml2argvtest.c | 17 +
tests/qemuxml2xmloutdata/tpm-emulator-tpm2.xml | 34 ++
tests/qemuxml2xmloutdata/tpm-emulator.xml | 34 ++
tests/qemuxml2xmltest.c | 1 +
47 files changed, 1866 insertions(+), 16 deletions(-)
create mode 100644 src/qemu/qemu_extdevice.c
create mode 100644 src/qemu/qemu_extdevice.h
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-tpm2.args
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-tpm2.xml
create mode 100644 tests/qemuxml2argvdata/tpm-emulator.args
create mode 100644 tests/qemuxml2argvdata/tpm-emulator.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-emulator-tpm2.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-emulator.xml
--
2.5.5
2
41
10 May '18
Using a QEMU 2.12 tagged tree build and full build, used:
tests/qemucapsprobe /home/qemu/x64_64-softmmu/qemu-system-x86_64 > \
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiestest
VIR_TEST_REGENERATE_OUTPUT=1 tests/domaincapstest
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Seems like a bit of change since 2.12-rc0, but for the most part
it was parameter reorganization and cpudef differences. I'm never
quite sure if it's using something from my host on those or something
that is modeled.
I did make a somewhat feeble attempt at doing something similar for
other arches, but gave up because I never could figure out the magic
incantation or rpm's to install in order to get libvirt to actually
build on a "fresh" aarch64 system (it's where I started). I found even
just cloning the libvirt.git repo resulted in a number "modified" tests/
virhostcpudata/linux-test*/node/node*/cpu* files that were modified and
then attempting an autogen.sh would fail because README got deleted.
If someone wants to do all 4 in one commit - I'm happy to drop this.
Just figured I'd get the ball rolling before the end of the month.
tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 14 +-
.../caps_2.12.0.x86_64.replies | 328 +++++++++++++--------
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 57 ++--
3 files changed, 235 insertions(+), 164 deletions(-)
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
index d0e2866c49..9d752a0146 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
@@ -23,10 +23,11 @@
<cpu>
<mode name='host-passthrough' supported='yes'/>
<mode name='host-model' supported='yes'>
- <model fallback='forbid'>Haswell-noTSX</model>
+ <model fallback='forbid'>Haswell-noTSX-IBRS</model>
<vendor>Intel</vendor>
<feature policy='require' name='vme'/>
<feature policy='require' name='ss'/>
+ <feature policy='require' name='vmx'/>
<feature policy='require' name='f16c'/>
<feature policy='require' name='rdrand'/>
<feature policy='require' name='hypervisor'/>
@@ -36,6 +37,7 @@
<feature policy='require' name='pdpe1gb'/>
<feature policy='require' name='abm'/>
<feature policy='require' name='invtsc'/>
+ <feature policy='require' name='ibpb'/>
</mode>
<mode name='custom' supported='yes'>
<model usable='yes'>qemu64</model>
@@ -51,13 +53,13 @@
<model usable='yes'>core2duo</model>
<model usable='no'>athlon</model>
<model usable='yes'>Westmere</model>
- <model usable='no'>Westmere-IBRS</model>
+ <model usable='yes'>Westmere-IBRS</model>
<model usable='no'>Skylake-Server</model>
<model usable='no'>Skylake-Server-IBRS</model>
<model usable='no'>Skylake-Client</model>
<model usable='no'>Skylake-Client-IBRS</model>
<model usable='yes'>SandyBridge</model>
- <model usable='no'>SandyBridge-IBRS</model>
+ <model usable='yes'>SandyBridge-IBRS</model>
<model usable='yes'>Penryn</model>
<model usable='no'>Opteron_G5</model>
<model usable='no'>Opteron_G4</model>
@@ -65,12 +67,12 @@
<model usable='yes'>Opteron_G2</model>
<model usable='yes'>Opteron_G1</model>
<model usable='yes'>Nehalem</model>
- <model usable='no'>Nehalem-IBRS</model>
+ <model usable='yes'>Nehalem-IBRS</model>
<model usable='yes'>IvyBridge</model>
- <model usable='no'>IvyBridge-IBRS</model>
+ <model usable='yes'>IvyBridge-IBRS</model>
<model usable='no'>Haswell</model>
<model usable='yes'>Haswell-noTSX</model>
- <model usable='no'>Haswell-noTSX-IBRS</model>
+ <model usable='yes'>Haswell-noTSX-IBRS</model>
<model usable='no'>Haswell-IBRS</model>
<model usable='no'>EPYC</model>
<model usable='no'>EPYC-IBPB</model>
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
index c086e04afd..a5ffffc0b7 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
@@ -2,14 +2,13 @@
"QMP": {
"version": {
"qemu": {
- "micro": 90,
- "minor": 11,
+ "micro": 0,
+ "minor": 12,
"major": 2
},
- "package": "v2.12.0-rc0"
+ "package": "v2.12.0"
},
"capabilities": [
- "oob"
]
}
}
@@ -23,11 +22,11 @@
{
"return": {
"qemu": {
- "micro": 90,
- "minor": 11,
+ "micro": 0,
+ "minor": 12,
"major": 2
},
- "package": "v2.12.0-rc0"
+ "package": "v2.12.0"
},
"id": "libvirt-2"
}
@@ -536,7 +535,7 @@
{
"return": {
- "fd": 19,
+ "fd": 17,
"fdset-id": 0
},
"id": "libvirt-5"
@@ -735,6 +734,10 @@
"name": "virtio-keyboard-pci",
"parent": "virtio-input-hid-pci"
},
+ {
+ "name": "xen-sysbus",
+ "parent": "bus"
+ },
{
"name": "i440FX",
"parent": "pci-device"
@@ -767,6 +770,10 @@
"name": "chardev-pty",
"parent": "chardev"
},
+ {
+ "name": "xen-apic",
+ "parent": "apic-common"
+ },
{
"name": "SUNW,fdtwo",
"parent": "base-sysbus-fdc"
@@ -1023,6 +1030,10 @@
"name": "pc-testdev",
"parent": "isa-device"
},
+ {
+ "name": "xen-backend",
+ "parent": "xen-sysdev"
+ },
{
"name": "Haswell-noTSX-IBRS-x86_64-cpu",
"parent": "x86_64-cpu"
@@ -1063,6 +1074,10 @@
"name": "virtio-balloon-pci",
"parent": "virtio-pci"
},
+ {
+ "name": "chardev-socket",
+ "parent": "chardev"
+ },
{
"name": "iothread",
"parent": "object"
@@ -1072,13 +1087,9 @@
"parent": "isa-device"
},
{
- "name": "chardev-socket",
+ "name": "chardev-mux",
"parent": "chardev"
},
- {
- "name": "486-x86_64-cpu",
- "parent": "x86_64-cpu"
- },
{
"name": "pc-q35-2.7-machine",
"parent": "generic-pc-machine"
@@ -1088,8 +1099,8 @@
"parent": "generic-pc-machine"
},
{
- "name": "chardev-mux",
- "parent": "chardev"
+ "name": "486-x86_64-cpu",
+ "parent": "x86_64-cpu"
},
{
"name": "filter-redirector",
@@ -1223,14 +1234,14 @@
"name": "chardev-msmouse",
"parent": "chardev"
},
- {
- "name": "pc-q35-2.9-machine",
- "parent": "generic-pc-machine"
- },
{
"name": "chardev-pipe",
"parent": "chardev-fd"
},
+ {
+ "name": "pc-q35-2.9-machine",
+ "parent": "generic-pc-machine"
+ },
{
"name": "pc-i440fx-1.7-machine",
"parent": "generic-pc-machine"
@@ -1419,6 +1430,10 @@
"name": "chardev-file",
"parent": "chardev-fd"
},
+ {
+ "name": "xen-sysdev",
+ "parent": "sys-bus-device"
+ },
{
"name": "intel-iommu",
"parent": "x86-iommu"
@@ -1483,6 +1498,10 @@
"name": "ccid-bus",
"parent": "bus"
},
+ {
+ "name": "xenpv-machine",
+ "parent": "machine"
+ },
{
"name": "EPYC-IBPB-x86_64-cpu",
"parent": "x86_64-cpu"
@@ -1815,6 +1834,10 @@
"name": "pc-i440fx-2.2-machine",
"parent": "generic-pc-machine"
},
+ {
+ "name": "xen-pci-passthrough",
+ "parent": "pci-device"
+ },
{
"name": "cryptodev-backend",
"parent": "object"
@@ -1947,10 +1970,18 @@
"name": "virtio-scsi-pci",
"parent": "virtio-pci"
},
+ {
+ "name": "piix3-ide",
+ "parent": "pci-ide"
+ },
{
"name": "ES1370",
"parent": "pci-device"
},
+ {
+ "name": "xen-pvdevice",
+ "parent": "pci-device"
+ },
{
"name": "virtio-pci-bus",
"parent": "virtio-bus"
@@ -1960,8 +1991,8 @@
"parent": "pcie-port"
},
{
- "name": "piix3-ide",
- "parent": "pci-ide"
+ "name": "xenfv-machine",
+ "parent": "generic-pc-machine"
},
{
"name": "pci-testdev",
@@ -2015,6 +2046,10 @@
"name": "pc-i440fx-2.6-machine",
"parent": "generic-pc-machine"
},
+ {
+ "name": "xen-platform",
+ "parent": "pci-device"
+ },
{
"name": "chardev-serial",
"parent": "chardev-fd"
@@ -2111,6 +2146,10 @@
"name": "isa-applesmc",
"parent": "isa-device"
},
+ {
+ "name": "xen-accel",
+ "parent": "accel"
+ },
{
"name": "secret",
"parent": "object"
@@ -3192,102 +3231,93 @@
{
"return": [
{
- "name": "serial",
- "type": "str"
- },
- {
- "name": "port_index",
+ "name": "min_io_size",
"type": "uint16"
},
{
- "name": "dpofua",
+ "name": "removable",
"description": "on/off",
"type": "bool"
},
{
- "name": "bootindex",
- "type": "int32"
- },
- {
- "name": "logical_block_size",
- "description": "A power of two between 512 and 32768",
- "type": "uint16"
+ "name": "channel",
+ "type": "uint32"
},
{
- "name": "discard_granularity",
- "type": "uint32"
+ "name": "serial",
+ "type": "str"
},
{
"name": "lun",
"type": "uint32"
},
{
- "name": "max_unmap_size",
- "type": "uint64"
+ "name": "dpofua",
+ "description": "on/off",
+ "type": "bool"
},
{
- "name": "drive",
- "description": "Node name or ID of a block device to use as a backend",
+ "name": "ver",
"type": "str"
},
{
- "name": "port_wwn",
- "type": "uint64"
- },
- {
- "name": "write-cache",
- "description": "on/off/auto",
- "type": "OnOffAuto"
- },
- {
- "name": "share-rw",
- "type": "bool"
- },
- {
- "name": "opt_io_size",
+ "name": "scsi-id",
"type": "uint32"
},
{
- "name": "min_io_size",
+ "name": "logical_block_size",
+ "description": "A power of two between 512 and 32768",
"type": "uint16"
},
{
- "name": "product",
+ "name": "drive",
+ "description": "Node name or ID of a block device to use as a backend",
"type": "str"
},
{
- "name": "scsi-id",
- "type": "uint32"
+ "name": "scsi_version",
+ "type": "int32"
},
{
- "name": "channel",
+ "name": "werror",
+ "description": "Error handling policy, report/ignore/enospc/stop/auto",
+ "type": "BlockdevOnError"
+ },
+ {
+ "name": "discard_granularity",
"type": "uint32"
},
{
- "name": "vendor",
- "type": "str"
+ "name": "port_wwn",
+ "type": "uint64"
},
{
- "name": "wwn",
+ "name": "max_unmap_size",
"type": "uint64"
},
{
- "name": "werror",
+ "name": "rerror",
"description": "Error handling policy, report/ignore/enospc/stop/auto",
"type": "BlockdevOnError"
},
{
- "name": "removable",
- "description": "on/off",
+ "name": "max_io_size",
+ "type": "uint64"
+ },
+ {
+ "name": "wwn",
+ "type": "uint64"
+ },
+ {
+ "name": "share-rw",
"type": "bool"
},
{
- "name": "rerror",
- "description": "Error handling policy, report/ignore/enospc/stop/auto",
- "type": "BlockdevOnError"
+ "name": "product",
+ "type": "str"
},
{
- "name": "ver",
+ "name": "vendor",
"type": "str"
},
{
@@ -3296,8 +3326,21 @@
"type": "uint16"
},
{
- "name": "max_io_size",
- "type": "uint64"
+ "name": "port_index",
+ "type": "uint16"
+ },
+ {
+ "name": "bootindex",
+ "type": "int32"
+ },
+ {
+ "name": "write-cache",
+ "description": "on/off/auto",
+ "type": "OnOffAuto"
+ },
+ {
+ "name": "opt_io_size",
+ "type": "uint32"
}
],
"id": "libvirt-19"
@@ -4103,6 +4146,11 @@
"name": "vectors",
"type": "uint32"
},
+ {
+ "name": "iommu_platform",
+ "description": "on/off",
+ "type": "bool"
+ },
{
"name": "x-pcie-extcap-init",
"description": "on/off",
@@ -4120,13 +4168,18 @@
"name": "x-ignore-backend-features",
"type": "bool"
},
+ {
+ "name": "stats",
+ "description": "on/off",
+ "type": "bool"
+ },
{
"name": "notify_on_empty",
"description": "on/off",
"type": "bool"
},
{
- "name": "iommu_platform",
+ "name": "virtio-pci-bus-master-bug-migration",
"description": "on/off",
"type": "bool"
},
@@ -4136,7 +4189,7 @@
"type": "bool"
},
{
- "name": "virtio-pci-bus-master-bug-migration",
+ "name": "virgl",
"description": "on/off",
"type": "bool"
},
@@ -4174,19 +4227,29 @@
"name": "yres",
"type": "uint32"
},
+ {
+ "name": "stats",
+ "description": "on/off",
+ "type": "bool"
+ },
{
"name": "iommu_platform",
"description": "on/off",
"type": "bool"
},
{
- "name": "max_outputs",
+ "name": "xres",
"type": "uint32"
},
{
- "name": "xres",
+ "name": "max_outputs",
"type": "uint32"
},
+ {
+ "name": "virgl",
+ "description": "on/off",
+ "type": "bool"
+ },
{
"name": "max_hostmem",
"type": "size"
@@ -4657,6 +4720,11 @@
"name": "pc-i440fx-2.7",
"cpu-max": 255
},
+ {
+ "hotpluggable-cpus": true,
+ "name": "xenfv",
+ "cpu-max": 128
+ },
{
"hotpluggable-cpus": true,
"name": "pc-i440fx-2.3",
@@ -4698,6 +4766,11 @@
"cpu-max": 288,
"alias": "q35"
},
+ {
+ "hotpluggable-cpus": false,
+ "name": "xenpv",
+ "cpu-max": 1
+ },
{
"hotpluggable-cpus": true,
"name": "pc-q35-2.10",
@@ -4947,7 +5020,6 @@
"name": "Westmere-IBRS",
"typename": "Westmere-IBRS-x86_64-cpu",
"unavailable-features": [
- "spec-ctrl"
],
"static": false,
"migration-safe": true
@@ -4997,7 +5069,6 @@
"avx512cd",
"avx512bw",
"avx512vl",
- "spec-ctrl",
"3dnowprefetch",
"xsavec",
"xgetbv1",
@@ -5039,7 +5110,6 @@
"rdseed",
"adx",
"smap",
- "spec-ctrl",
"3dnowprefetch",
"xsavec",
"xgetbv1",
@@ -5061,7 +5131,6 @@
"name": "SandyBridge-IBRS",
"typename": "SandyBridge-IBRS-x86_64-cpu",
"unavailable-features": [
- "spec-ctrl"
],
"static": false,
"migration-safe": true
@@ -5139,7 +5208,6 @@
"name": "Nehalem-IBRS",
"typename": "Nehalem-IBRS-x86_64-cpu",
"unavailable-features": [
- "spec-ctrl"
],
"static": false,
"migration-safe": true
@@ -5156,7 +5224,6 @@
"name": "IvyBridge-IBRS",
"typename": "IvyBridge-IBRS-x86_64-cpu",
"unavailable-features": [
- "spec-ctrl"
],
"static": false,
"migration-safe": true
@@ -5183,7 +5250,6 @@
"name": "Haswell-noTSX-IBRS",
"typename": "Haswell-noTSX-IBRS-x86_64-cpu",
"unavailable-features": [
- "spec-ctrl"
],
"static": false,
"migration-safe": true
@@ -5193,8 +5259,7 @@
"typename": "Haswell-IBRS-x86_64-cpu",
"unavailable-features": [
"hle",
- "rtm",
- "spec-ctrl"
+ "rtm"
],
"static": false,
"migration-safe": true
@@ -5237,7 +5302,6 @@
"misalignsse",
"3dnowprefetch",
"osvw",
- "ibpb",
"xsavec",
"xgetbv1"
],
@@ -5285,7 +5349,6 @@
"rdseed",
"adx",
"smap",
- "spec-ctrl",
"3dnowprefetch"
],
"static": false,
@@ -5300,7 +5363,6 @@
"rdseed",
"adx",
"smap",
- "spec-ctrl",
"3dnowprefetch"
],
"static": false,
@@ -5462,6 +5524,14 @@
},
{
"parameters": [
+ {
+ "name": "rendernode",
+ "type": "string"
+ },
+ {
+ "name": "gl",
+ "type": "boolean"
+ },
{
"name": "head",
"type": "number"
@@ -6163,6 +6233,10 @@
},
{
"parameters": [
+ {
+ "name": "x-oob",
+ "type": "boolean"
+ },
{
"name": "pretty",
"type": "boolean"
@@ -14309,9 +14383,9 @@
"type": "int"
},
{
- "name": "static",
+ "name": "preallocation",
"default": null,
- "type": "bool"
+ "type": "356"
}
],
"meta-type": "object"
@@ -18145,7 +18219,7 @@
"pge": true,
"avx512bitalg": false,
"pdcm": false,
- "model": 63,
+ "model": 60,
"movbe": true,
"nrip-save": false,
"ssse3": true,
@@ -18156,7 +18230,7 @@
"fma": true,
"cx16": true,
"de": true,
- "stepping": 2,
+ "stepping": 3,
"xsave": true,
"clflush": true,
"skinit": false,
@@ -18170,13 +18244,13 @@
"osvw": false,
"apic": true,
"pmm": false,
- "spec-ctrl": false,
+ "spec-ctrl": true,
"tsc-adjust": true,
"kvm-steal-time": true,
"kvmclock": true,
"lwp": false,
"xop": false,
- "ibpb": false,
+ "ibpb": true,
"avx": true,
"ospke": false,
"acpi": false,
@@ -18191,7 +18265,7 @@
"vaes": false,
"xsaves": false,
"lm": true,
- "umip": false,
+ "umip": true,
"pse": true,
"avx2": true,
"sep": true,
@@ -18215,22 +18289,22 @@
"fxsr-opt": false,
"xstore": false,
"rtm": false,
- "kvm-hint-dedicated": true,
+ "kvm-hint-dedicated": false,
"lmce": true,
"perfctr-nb": false,
"rdrand": true,
"rdseed": false,
"avx512-4vnniw": false,
"vme": true,
- "vmx": false,
+ "vmx": true,
"dtes64": false,
"mtrr": true,
"rdtscp": true,
"pse36": true,
- "kvm-pv-tlb-flush": false,
+ "kvm-pv-tlb-flush": true,
"tbm": false,
"wdt": false,
- "model-id": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz",
+ "model-id": "Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz",
"sha-ni": false,
"abm": true,
"avx512pf": false,
@@ -18260,6 +18334,7 @@
"xsavec": false,
"intel-pt": false,
"osxsave": false,
+ "hv-frequencies": false,
"tsc-frequency": 0,
"xd": true,
"hv-vendor-id": "",
@@ -18372,7 +18447,7 @@
"nodeid_msr": false,
"pdcm": false,
"movbe": true,
- "model": 63,
+ "model": 60,
"nrip_save": false,
"nrip-save": false,
"kvm_pv_unhalt": true,
@@ -18385,7 +18460,7 @@
"cx16": true,
"de": true,
"enforce": false,
- "stepping": 2,
+ "stepping": 3,
"xsave": true,
"clflush": true,
"skinit": false,
@@ -18404,7 +18479,7 @@
"pmu": false,
"pmm": false,
"apic": true,
- "spec-ctrl": false,
+ "spec-ctrl": true,
"min-xlevel2": 0,
"tsc-adjust": true,
"tsc_adjust": true,
@@ -18413,7 +18488,7 @@
"kvmclock": true,
"l3-cache": true,
"lwp": false,
- "ibpb": false,
+ "ibpb": true,
"xop": false,
"avx": true,
"ospke": false,
@@ -18431,7 +18506,7 @@
"xsaves": false,
"tcg-cpuid": true,
"lm": true,
- "umip": false,
+ "umip": true,
"pse": true,
"avx2": true,
"sep": true,
@@ -18465,7 +18540,7 @@
"hv-synic": false,
"xstore": false,
"fxsr_opt": false,
- "kvm-hint-dedicated": true,
+ "kvm-hint-dedicated": false,
"rtm": false,
"lmce": true,
"hv-time": false,
@@ -18475,18 +18550,18 @@
"rdrand": true,
"rdseed": false,
"avx512-4vnniw": false,
- "vmx": false,
+ "vmx": true,
"vme": true,
"dtes64": false,
"mtrr": true,
"rdtscp": true,
"pse36": true,
- "kvm-pv-tlb-flush": false,
+ "kvm-pv-tlb-flush": true,
"tbm": false,
"wdt": false,
"pause_filter": false,
"sha-ni": false,
- "model-id": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz",
+ "model-id": "Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz",
"abm": true,
"avx512pf": false,
"xstore-en": false
@@ -18590,7 +18665,7 @@
"pge": true,
"avx512bitalg": false,
"pdcm": false,
- "model": 63,
+ "model": 60,
"movbe": true,
"nrip-save": false,
"ssse3": true,
@@ -18601,7 +18676,7 @@
"fma": true,
"cx16": true,
"de": true,
- "stepping": 2,
+ "stepping": 3,
"xsave": true,
"clflush": true,
"skinit": false,
@@ -18615,13 +18690,13 @@
"osvw": false,
"apic": true,
"pmm": false,
- "spec-ctrl": false,
+ "spec-ctrl": true,
"tsc-adjust": true,
"kvm-steal-time": true,
"kvmclock": true,
"lwp": false,
"xop": false,
- "ibpb": false,
+ "ibpb": true,
"avx": true,
"ospke": false,
"acpi": false,
@@ -18636,7 +18711,7 @@
"vaes": false,
"xsaves": false,
"lm": true,
- "umip": false,
+ "umip": true,
"pse": true,
"avx2": true,
"sep": true,
@@ -18660,22 +18735,22 @@
"fxsr-opt": false,
"xstore": false,
"rtm": false,
- "kvm-hint-dedicated": true,
+ "kvm-hint-dedicated": false,
"lmce": true,
"perfctr-nb": false,
"rdrand": true,
"rdseed": false,
"avx512-4vnniw": false,
"vme": true,
- "vmx": false,
+ "vmx": true,
"dtes64": false,
"mtrr": true,
"rdtscp": true,
"pse36": true,
- "kvm-pv-tlb-flush": false,
+ "kvm-pv-tlb-flush": true,
"tbm": false,
"wdt": false,
- "model-id": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz",
+ "model-id": "Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz",
"sha-ni": false,
"abm": true,
"avx512pf": false,
@@ -18705,6 +18780,7 @@
"xsavec": false,
"intel-pt": false,
"osxsave": false,
+ "hv-frequencies": false,
"tsc-frequency": 0,
"xd": true,
"hv-vendor-id": "",
@@ -18817,7 +18893,7 @@
"nodeid_msr": false,
"pdcm": false,
"movbe": true,
- "model": 63,
+ "model": 60,
"nrip_save": false,
"nrip-save": false,
"kvm_pv_unhalt": true,
@@ -18830,7 +18906,7 @@
"cx16": true,
"de": true,
"enforce": false,
- "stepping": 2,
+ "stepping": 3,
"xsave": true,
"clflush": true,
"skinit": false,
@@ -18849,7 +18925,7 @@
"pmu": false,
"pmm": false,
"apic": true,
- "spec-ctrl": false,
+ "spec-ctrl": true,
"min-xlevel2": 0,
"tsc-adjust": true,
"tsc_adjust": true,
@@ -18858,7 +18934,7 @@
"kvmclock": true,
"l3-cache": true,
"lwp": false,
- "ibpb": false,
+ "ibpb": true,
"xop": false,
"avx": true,
"ospke": false,
@@ -18876,7 +18952,7 @@
"xsaves": false,
"tcg-cpuid": true,
"lm": true,
- "umip": false,
+ "umip": true,
"pse": true,
"avx2": true,
"sep": true,
@@ -18910,7 +18986,7 @@
"hv-synic": false,
"xstore": false,
"fxsr_opt": false,
- "kvm-hint-dedicated": true,
+ "kvm-hint-dedicated": false,
"rtm": false,
"lmce": true,
"hv-time": false,
@@ -18920,18 +18996,18 @@
"rdrand": true,
"rdseed": false,
"avx512-4vnniw": false,
- "vmx": false,
+ "vmx": true,
"vme": true,
"dtes64": false,
"mtrr": true,
"rdtscp": true,
"pse36": true,
- "kvm-pv-tlb-flush": false,
+ "kvm-pv-tlb-flush": true,
"tbm": false,
"wdt": false,
"pause_filter": false,
"sha-ni": false,
- "model-id": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz",
+ "model-id": "Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz",
"abm": true,
"avx512pf": false,
"xstore-en": false
@@ -19744,6 +19820,7 @@
"xsavec": false,
"intel-pt": false,
"osxsave": false,
+ "hv-frequencies": false,
"tsc-frequency": 0,
"xd": true,
"hv-vendor-id": "",
@@ -20189,6 +20266,7 @@
"xsavec": false,
"intel-pt": false,
"osxsave": false,
+ "hv-frequencies": false,
"tsc-frequency": 0,
"xd": true,
"hv-vendor-id": "",
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
index 150fbd21f3..de8445ba56 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
@@ -122,6 +122,7 @@
<flag name='gic-version'/>
<flag name='incoming-defer'/>
<flag name='virtio-gpu'/>
+ <flag name='virtio-gpu.virgl'/>
<flag name='virtio-keyboard'/>
<flag name='virtio-mouse'/>
<flag name='virtio-tablet'/>
@@ -132,6 +133,7 @@
<flag name='vserport-change-event'/>
<flag name='virtio-balloon-pci.deflate-on-oom'/>
<flag name='mptsas1068'/>
+ <flag name='spice-gl'/>
<flag name='qxl.vram64_size_mb'/>
<flag name='chardev-logfile'/>
<flag name='debug-threads'/>
@@ -161,6 +163,7 @@
<flag name='drive-iotune-group'/>
<flag name='query-cpu-model-expansion'/>
<flag name='virtio-net.host_mtu'/>
+ <flag name='spice-rendernode'/>
<flag name='nvdimm'/>
<flag name='pcie-root-port'/>
<flag name='query-cpu-definitions'/>
@@ -196,10 +199,10 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='tpm-crb'/>
- <version>2011090</version>
+ <version>2012000</version>
<kvmVersion>0</kvmVersion>
- <microcodeVersion>390060</microcodeVersion>
- <package>v2.12.0-rc0</package>
+ <microcodeVersion>391479</microcodeVersion>
+ <package>v2.12.0</package>
<arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'>
<property name='phys-bits' type='number' value='0'/>
@@ -216,6 +219,7 @@
<property name='xsavec' type='boolean' value='false'/>
<property name='intel-pt' type='boolean' value='false'/>
<property name='osxsave' type='boolean' value='false'/>
+ <property name='hv-frequencies' type='boolean' value='false'/>
<property name='tsc-frequency' type='number' value='0'/>
<property name='xd' type='boolean' value='true' migratable='yes'/>
<property name='hv-vendor-id' type='string' value=''/>
@@ -328,7 +332,7 @@
<property name='nodeid_msr' type='boolean' value='false'/>
<property name='pdcm' type='boolean' value='false'/>
<property name='movbe' type='boolean' value='true' migratable='yes'/>
- <property name='model' type='number' value='63'/>
+ <property name='model' type='number' value='60'/>
<property name='nrip_save' type='boolean' value='false'/>
<property name='nrip-save' type='boolean' value='false'/>
<property name='kvm_pv_unhalt' type='boolean' value='true' migratable='yes'/>
@@ -341,7 +345,7 @@
<property name='cx16' type='boolean' value='true' migratable='yes'/>
<property name='de' type='boolean' value='true' migratable='yes'/>
<property name='enforce' type='boolean' value='false'/>
- <property name='stepping' type='number' value='2'/>
+ <property name='stepping' type='number' value='3'/>
<property name='xsave' type='boolean' value='true' migratable='yes'/>
<property name='clflush' type='boolean' value='true' migratable='yes'/>
<property name='skinit' type='boolean' value='false'/>
@@ -360,7 +364,7 @@
<property name='pmu' type='boolean' value='false'/>
<property name='pmm' type='boolean' value='false'/>
<property name='apic' type='boolean' value='true' migratable='yes'/>
- <property name='spec-ctrl' type='boolean' value='false'/>
+ <property name='spec-ctrl' type='boolean' value='true' migratable='yes'/>
<property name='min-xlevel2' type='number' value='0'/>
<property name='tsc-adjust' type='boolean' value='true' migratable='yes'/>
<property name='tsc_adjust' type='boolean' value='true' migratable='yes'/>
@@ -369,7 +373,7 @@
<property name='kvmclock' type='boolean' value='true' migratable='yes'/>
<property name='l3-cache' type='boolean' value='true' migratable='yes'/>
<property name='lwp' type='boolean' value='false'/>
- <property name='ibpb' type='boolean' value='false'/>
+ <property name='ibpb' type='boolean' value='true' migratable='yes'/>
<property name='xop' type='boolean' value='false'/>
<property name='avx' type='boolean' value='true' migratable='yes'/>
<property name='ospke' type='boolean' value='false'/>
@@ -387,7 +391,7 @@
<property name='xsaves' type='boolean' value='false'/>
<property name='tcg-cpuid' type='boolean' value='true' migratable='yes'/>
<property name='lm' type='boolean' value='true' migratable='yes'/>
- <property name='umip' type='boolean' value='false'/>
+ <property name='umip' type='boolean' value='true' migratable='yes'/>
<property name='pse' type='boolean' value='true' migratable='yes'/>
<property name='avx2' type='boolean' value='true' migratable='yes'/>
<property name='sep' type='boolean' value='true' migratable='yes'/>
@@ -421,7 +425,7 @@
<property name='hv-synic' type='boolean' value='false'/>
<property name='xstore' type='boolean' value='false'/>
<property name='fxsr_opt' type='boolean' value='false'/>
- <property name='kvm-hint-dedicated' type='boolean' value='true' migratable='yes'/>
+ <property name='kvm-hint-dedicated' type='boolean' value='false'/>
<property name='rtm' type='boolean' value='false'/>
<property name='lmce' type='boolean' value='true' migratable='yes'/>
<property name='hv-time' type='boolean' value='false'/>
@@ -431,18 +435,18 @@
<property name='rdrand' type='boolean' value='true' migratable='yes'/>
<property name='rdseed' type='boolean' value='false'/>
<property name='avx512-4vnniw' type='boolean' value='false'/>
- <property name='vmx' type='boolean' value='false'/>
+ <property name='vmx' type='boolean' value='true' migratable='yes'/>
<property name='vme' type='boolean' value='true' migratable='yes'/>
<property name='dtes64' type='boolean' value='false'/>
<property name='mtrr' type='boolean' value='true' migratable='yes'/>
<property name='rdtscp' type='boolean' value='true' migratable='yes'/>
<property name='pse36' type='boolean' value='true' migratable='yes'/>
- <property name='kvm-pv-tlb-flush' type='boolean' value='false'/>
+ <property name='kvm-pv-tlb-flush' type='boolean' value='true' migratable='yes'/>
<property name='tbm' type='boolean' value='false'/>
<property name='wdt' type='boolean' value='false'/>
<property name='pause_filter' type='boolean' value='false'/>
<property name='sha-ni' type='boolean' value='false'/>
- <property name='model-id' type='string' value='Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz'/>
+ <property name='model-id' type='string' value='Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz'/>
<property name='abm' type='boolean' value='true' migratable='yes'/>
<property name='avx512pf' type='boolean' value='false'/>
<property name='xstore-en' type='boolean' value='false'/>
@@ -462,6 +466,7 @@
<property name='xsavec' type='boolean' value='false'/>
<property name='intel-pt' type='boolean' value='false'/>
<property name='osxsave' type='boolean' value='false'/>
+ <property name='hv-frequencies' type='boolean' value='false'/>
<property name='tsc-frequency' type='number' value='0'/>
<property name='xd' type='boolean' value='true' migratable='yes'/>
<property name='hv-vendor-id' type='string' value=''/>
@@ -720,9 +725,7 @@
<blocker name='3dnow'/>
</cpu>
<cpu type='kvm' name='Westmere' usable='yes'/>
- <cpu type='kvm' name='Westmere-IBRS' usable='no'>
- <blocker name='spec-ctrl'/>
- </cpu>
+ <cpu type='kvm' name='Westmere-IBRS' usable='yes'/>
<cpu type='kvm' name='Skylake-Server' usable='no'>
<blocker name='hle'/>
<blocker name='rtm'/>
@@ -759,7 +762,6 @@
<blocker name='avx512cd'/>
<blocker name='avx512bw'/>
<blocker name='avx512vl'/>
- <blocker name='spec-ctrl'/>
<blocker name='3dnowprefetch'/>
<blocker name='xsavec'/>
<blocker name='xgetbv1'/>
@@ -789,7 +791,6 @@
<blocker name='rdseed'/>
<blocker name='adx'/>
<blocker name='smap'/>
- <blocker name='spec-ctrl'/>
<blocker name='3dnowprefetch'/>
<blocker name='xsavec'/>
<blocker name='xgetbv1'/>
@@ -797,9 +798,7 @@
<blocker name='mpx'/>
</cpu>
<cpu type='kvm' name='SandyBridge' usable='yes'/>
- <cpu type='kvm' name='SandyBridge-IBRS' usable='no'>
- <blocker name='spec-ctrl'/>
- </cpu>
+ <cpu type='kvm' name='SandyBridge-IBRS' usable='yes'/>
<cpu type='kvm' name='Penryn' usable='yes'/>
<cpu type='kvm' name='Opteron_G5' usable='no'>
<blocker name='sse4a'/>
@@ -823,25 +822,18 @@
<cpu type='kvm' name='Opteron_G2' usable='yes'/>
<cpu type='kvm' name='Opteron_G1' usable='yes'/>
<cpu type='kvm' name='Nehalem' usable='yes'/>
- <cpu type='kvm' name='Nehalem-IBRS' usable='no'>
- <blocker name='spec-ctrl'/>
- </cpu>
+ <cpu type='kvm' name='Nehalem-IBRS' usable='yes'/>
<cpu type='kvm' name='IvyBridge' usable='yes'/>
- <cpu type='kvm' name='IvyBridge-IBRS' usable='no'>
- <blocker name='spec-ctrl'/>
- </cpu>
+ <cpu type='kvm' name='IvyBridge-IBRS' usable='yes'/>
<cpu type='kvm' name='Haswell' usable='no'>
<blocker name='hle'/>
<blocker name='rtm'/>
</cpu>
<cpu type='kvm' name='Haswell-noTSX' usable='yes'/>
- <cpu type='kvm' name='Haswell-noTSX-IBRS' usable='no'>
- <blocker name='spec-ctrl'/>
- </cpu>
+ <cpu type='kvm' name='Haswell-noTSX-IBRS' usable='yes'/>
<cpu type='kvm' name='Haswell-IBRS' usable='no'>
<blocker name='hle'/>
<blocker name='rtm'/>
- <blocker name='spec-ctrl'/>
</cpu>
<cpu type='kvm' name='EPYC' usable='no'>
<blocker name='rdseed'/>
@@ -872,7 +864,6 @@
<blocker name='misalignsse'/>
<blocker name='3dnowprefetch'/>
<blocker name='osvw'/>
- <blocker name='ibpb'/>
<blocker name='xsavec'/>
<blocker name='xgetbv1'/>
</cpu>
@@ -895,7 +886,6 @@
<blocker name='rdseed'/>
<blocker name='adx'/>
<blocker name='smap'/>
- <blocker name='spec-ctrl'/>
<blocker name='3dnowprefetch'/>
</cpu>
<cpu type='kvm' name='Broadwell-IBRS' usable='no'>
@@ -904,7 +894,6 @@
<blocker name='rdseed'/>
<blocker name='adx'/>
<blocker name='smap'/>
- <blocker name='spec-ctrl'/>
<blocker name='3dnowprefetch'/>
</cpu>
<cpu type='kvm' name='486' usable='yes'/>
@@ -1210,6 +1199,7 @@
<machine name='pc-i440fx-2.9' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-i440fx-2.6' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-i440fx-2.7' hotplugCpus='yes' maxCpus='255'/>
+ <machine name='xenfv' hotplugCpus='yes' maxCpus='128'/>
<machine name='pc-i440fx-2.3' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-i440fx-2.4' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-i440fx-2.5' hotplugCpus='yes' maxCpus='255'/>
@@ -1218,6 +1208,7 @@
<machine name='pc-i440fx-2.0' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-q35-2.11' hotplugCpus='yes' maxCpus='288'/>
<machine name='pc-q35-2.12' alias='q35' hotplugCpus='yes' maxCpus='288'/>
+ <machine name='xenpv' maxCpus='1'/>
<machine name='pc-q35-2.10' hotplugCpus='yes' maxCpus='288'/>
<machine name='pc-i440fx-1.7' hotplugCpus='yes' maxCpus='255'/>
<machine name='pc-q35-2.9' hotplugCpus='yes' maxCpus='288'/>
--
2.14.3
1
0
10 May '18
Andrea Bolognani (3):
jobs: Enable parallel make everywhere
guests: Set MAKEFLAGS for out-of-the-box parallel make
jobs: Drop explicit parallel make usage
guests/templates/bashrc | 2 ++
jobs/autotools.yaml | 10 +++++-----
jobs/defaults.yaml | 1 -
jobs/perl-makemaker.yaml | 8 ++++----
projects/libvirt.yaml | 4 ++--
projects/osinfo-db.yaml | 4 ++--
6 files changed, 15 insertions(+), 14 deletions(-)
--
2.17.0
1
3
[libvirt] [REPOST PATCH] util: Clean up consumers of virJSONValueArraySize
by John Ferlan 10 May '18
by John Ferlan 10 May '18
10 May '18
Rather than have virJSONValueArraySize return a -1 when the input
is not an array and then splat an error message, let's check for
an array before calling and then change the return to be a size_t
instead of ssize_t.
That means using the helper virJSONValueIsArray as well as using a
more generic error message such as "Malformed <something> array".
In some cases we can remove stack variables and when we cannot,
those variables should be size_t not ssize_t. Alter a few references
of if (!value) to be if (value == 0) instead as well.
Some callers can already assume an array is being worked on based
on the previous call, so there's less to do.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Original:
https://www.redhat.com/archives/libvir-list/2018-April/msg02003.html
Reposting as I found a recent upstream changes created some simple
merge conflicts and it's never clear if applying what was there can
be applied on top even with git am -3, so I figured I would just repost.
As noted previously, based off a review of the Coverity work from Peter:
https://www.redhat.com/archives/libvir-list/2018-April/msg01613.html
src/locking/lock_daemon.c | 7 ++--
src/logging/log_handler.c | 7 ++--
src/network/bridge_driver.c | 7 ++--
src/qemu/qemu_agent.c | 35 ++++++++++--------
src/qemu/qemu_monitor_json.c | 85 ++++++++++++++++++++-----------------------
src/rpc/virnetdaemon.c | 7 +---
src/rpc/virnetserver.c | 15 +++-----
src/rpc/virnetserverservice.c | 7 ++--
src/util/virjson.c | 5 +--
src/util/virjson.h | 2 +-
src/util/virlockspace.c | 16 ++++----
src/util/virstoragefile.c | 3 +-
tests/testutilsqemuschema.c | 18 +++------
tools/nss/libvirt_nss.c | 3 +-
14 files changed, 97 insertions(+), 120 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 7afff42246..78c33bd29c 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -248,7 +248,6 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged)
virJSONValuePtr child;
virJSONValuePtr lockspaces;
size_t i;
- ssize_t n;
const char *serverNames[] = { "virtlockd" };
if (VIR_ALLOC(lockd) < 0)
@@ -281,13 +280,13 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged)
goto error;
}
- if ((n = virJSONValueArraySize(lockspaces)) < 0) {
+ if (!virJSONValueIsArray(lockspaces)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed lockspaces data from JSON file"));
+ _("Malformed lockspaces array"));
goto error;
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(lockspaces); i++) {
virLockSpacePtr lockspace;
child = virJSONValueArrayGet(lockspaces, i);
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index 40dfa8ecae..5364e06dff 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -292,7 +292,6 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object,
{
virLogHandlerPtr handler;
virJSONValuePtr files;
- ssize_t n;
size_t i;
if (!(handler = virLogHandlerNew(privileged,
@@ -308,13 +307,13 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object,
goto error;
}
- if ((n = virJSONValueArraySize(files)) < 0) {
+ if (!virJSONValueIsArray(files)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed files data from JSON file"));
+ _("Malformed files array"));
goto error;
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(files); i++) {
virLogHandlerLogFilePtr file;
virJSONValuePtr child = virJSONValueArrayGet(files, i);
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index ece7e41d35..4b33e12b30 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -4124,7 +4124,7 @@ networkGetDHCPLeases(virNetworkPtr net,
size_t i, j;
size_t nleases = 0;
int rv = -1;
- ssize_t size = 0;
+ size_t size = 0;
int custom_lease_file_len = 0;
bool need_results = !!leases;
long long currtime = 0;
@@ -4179,11 +4179,12 @@ networkGetDHCPLeases(virNetworkPtr net,
goto error;
}
- if ((size = virJSONValueArraySize(leases_array)) < 0) {
+ if (!virJSONValueIsArray(leases_array)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("couldn't fetch array of leases"));
+ _("Malformed lease_entries array"));
goto error;
}
+ size = virJSONValueArraySize(leases_array);
}
currtime = (long long)time(NULL);
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 4df1bde458..eeede645ef 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -1490,7 +1490,7 @@ qemuAgentGetVCPUs(qemuAgentPtr mon,
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
virJSONValuePtr data = NULL;
- ssize_t ndata;
+ size_t ndata;
if (!(cmd = qemuAgentMakeCommand("guest-get-vcpus", NULL)))
return -1;
@@ -1505,6 +1505,12 @@ qemuAgentGetVCPUs(qemuAgentPtr mon,
goto cleanup;
}
+ if (!virJSONValueIsArray(data)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed guest-get-vcpus data array"));
+ goto cleanup;
+ }
+
ndata = virJSONValueArraySize(data);
if (VIR_ALLOC_N(*info, ndata) < 0)
@@ -1869,15 +1875,14 @@ qemuAgentGetFSInfo(qemuAgentPtr mon, virDomainFSInfoPtr **info,
goto cleanup;
}
- if (virJSONValueGetType(data) != VIR_JSON_TYPE_ARRAY) {
+ if (!virJSONValueIsArray(data)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("guest-get-fsinfo return information was not "
- "an array"));
+ _("Malformed guest-get-fsinfo data array"));
goto cleanup;
}
ndata = virJSONValueArraySize(data);
- if (!ndata) {
+ if (ndata == 0) {
ret = 0;
*info = NULL;
goto cleanup;
@@ -1928,14 +1933,14 @@ qemuAgentGetFSInfo(qemuAgentPtr mon, virDomainFSInfoPtr **info,
goto cleanup;
}
- if (virJSONValueGetType(entry) != VIR_JSON_TYPE_ARRAY) {
+ if (!virJSONValueIsArray(entry)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("guest-get-fsinfo 'disk' data was not an array"));
+ _("Malformed guest-get-fsinfo 'disk' data array"));
goto cleanup;
}
ndisk = virJSONValueArraySize(entry);
- if (!ndisk)
+ if (ndisk == 0)
continue;
if (VIR_ALLOC_N(info_ret[i]->devAlias, ndisk) < 0)
goto cleanup;
@@ -2035,7 +2040,6 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
{
int ret = -1;
size_t i, j;
- ssize_t size = -1;
virJSONValuePtr cmd = NULL;
virJSONValuePtr reply = NULL;
virJSONValuePtr ret_array = NULL;
@@ -2065,17 +2069,16 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
goto cleanup;
}
- if ((size = virJSONValueArraySize(ret_array)) < 0) {
+ if (!virJSONValueIsArray(ret_array)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("qemu agent didn't return an array of interfaces"));
goto cleanup;
}
- for (i = 0; i < size; i++) {
+ for (i = 0; i < virJSONValueArraySize(ret_array); i++) {
virJSONValuePtr tmp_iface = virJSONValueArrayGet(ret_array, i);
virJSONValuePtr ip_addr_arr = NULL;
const char *hwaddr, *ifname_s, *name = NULL;
- ssize_t ip_addr_arr_size;
virDomainInterfacePtr iface = NULL;
/* Shouldn't happen but doesn't hurt to check neither */
@@ -2131,14 +2134,16 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
if (!ip_addr_arr)
continue;
- if ((ip_addr_arr_size = virJSONValueArraySize(ip_addr_arr)) < 0)
- /* Mmm, empty 'ip-address'? */
+ if (!virJSONValueIsArray(ip_addr_arr)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed ip-addresses array"));
goto error;
+ }
/* If current iface already exists, continue with the count */
addrs_count = iface->naddrs;
- for (j = 0; j < ip_addr_arr_size; j++) {
+ for (j = 0; j < virJSONValueArraySize(ip_addr_arr); j++) {
const char *type, *addr;
virJSONValuePtr ip_addr_obj = virJSONValueArrayGet(ip_addr_arr, j);
virDomainIPAddressPtr ip_addr;
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 8176175894..e0ea553c41 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1627,9 +1627,9 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
struct qemuMonitorQueryCpusEntry *cpus = NULL;
int ret = -1;
size_t i;
- ssize_t ncpus;
+ size_t ncpus;
- if ((ncpus = virJSONValueArraySize(data)) <= 0)
+ if ((ncpus = virJSONValueArraySize(data)) == 0)
return -2;
if (VIR_ALLOC_N(cpus, ncpus) < 0)
@@ -3595,7 +3595,7 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
int ret = -1;
const char *tmp;
virJSONValuePtr returnArray, entry, table, element;
- ssize_t nTable;
+ size_t nTable;
size_t i;
virNetDevRxFilterPtr fil = virNetDevRxFilterNew();
@@ -3656,12 +3656,13 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
goto cleanup;
}
if ((!(table = virJSONValueObjectGet(entry, "unicast-table"))) ||
- ((nTable = virJSONValueArraySize(table)) < 0)) {
+ (!virJSONValueIsArray(table))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'unicast-table' array "
"in query-rx-filter response"));
goto cleanup;
}
+ nTable = virJSONValueArraySize(table);
if (VIR_ALLOC_N(fil->unicast.table, nTable))
goto cleanup;
for (i = 0; i < nTable; i++) {
@@ -3697,12 +3698,13 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
goto cleanup;
}
if ((!(table = virJSONValueObjectGet(entry, "multicast-table"))) ||
- ((nTable = virJSONValueArraySize(table)) < 0)) {
+ (!virJSONValueIsArray(table))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'multicast-table' array "
"in query-rx-filter response"));
goto cleanup;
}
+ nTable = virJSONValueArraySize(table);
if (VIR_ALLOC_N(fil->multicast.table, nTable))
goto cleanup;
for (i = 0; i < nTable; i++) {
@@ -3731,12 +3733,13 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
goto cleanup;
}
if ((!(table = virJSONValueObjectGet(entry, "vlan-table"))) ||
- ((nTable = virJSONValueArraySize(table)) < 0)) {
+ (!virJSONValueIsArray(table))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'vlan-table' array "
"in query-rx-filter response"));
goto cleanup;
}
+ nTable = virJSONValueArraySize(table);
if (VIR_ALLOC_N(fil->vlan.table, nTable))
goto cleanup;
for (i = 0; i < nTable; i++) {
@@ -4575,7 +4578,7 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
virJSONValuePtr cmd = NULL;
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
- ssize_t nr_results;
+ size_t nr_results;
size_t i;
virHashTablePtr blockJobs = NULL;
@@ -4591,12 +4594,7 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
goto cleanup;
}
- if ((nr_results = virJSONValueArraySize(data)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("unable to determine array size"));
- goto cleanup;
- }
-
+ nr_results = virJSONValueArraySize(data);
if (!(blockJobs = virHashCreate(nr_results, virHashValueFree)))
goto cleanup;
@@ -5114,7 +5112,7 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
qemuMonitorMachineInfoPtr *infolist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*machines = NULL;
@@ -5206,7 +5204,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
qemuMonitorCPUDefInfoPtr *cpulist = NULL;
- int n = 0;
+ size_t n = 0;
size_t i;
*cpus = NULL;
@@ -5257,7 +5255,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
if (virJSONValueObjectHasKey(child, "unavailable-features")) {
virJSONValuePtr blockers;
size_t j;
- int len;
+ size_t len;
blockers = virJSONValueObjectGetArray(child,
"unavailable-features");
@@ -5494,7 +5492,7 @@ int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
char **commandlist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*commands = NULL;
@@ -5550,7 +5548,7 @@ int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
char **eventlist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*events = NULL;
@@ -5614,7 +5612,7 @@ qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
virJSONValuePtr data = NULL;
virJSONValuePtr array = NULL;
char **paramlist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*params = NULL;
@@ -5646,17 +5644,17 @@ qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
"return data"));
goto cleanup;
}
- qemuMonitorSetOptions(mon, array);
- }
- if ((n = virJSONValueArraySize(array)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("query-command-line-options reply data was not "
- "an array"));
- goto cleanup;
+ if (!virJSONValueIsArray(array)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed query-cmmand-line-options array"));
+ goto cleanup;
+ }
+
+ qemuMonitorSetOptions(mon, array);
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(array); i++) {
virJSONValuePtr child = virJSONValueArrayGet(array, i);
const char *tmp;
@@ -5681,12 +5679,12 @@ qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
if (found)
*found = true;
- if ((n = virJSONValueArraySize(data)) < 0) {
+ if (!virJSONValueIsArray(data)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("query-command-line-options parameter data was not "
- "an array"));
+ _("Malformed query-cmmand-line-options parameters array"));
goto cleanup;
}
+ n = virJSONValueArraySize(data);
/* null-terminated list */
if (VIR_ALLOC_N(paramlist, n + 1) < 0)
@@ -5776,7 +5774,7 @@ int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
char **typelist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*types = NULL;
@@ -5832,7 +5830,7 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
qemuMonitorJSONListPathPtr *pathlist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*paths = NULL;
@@ -6062,7 +6060,7 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
char **proplist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*props = NULL;
@@ -6161,7 +6159,7 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
virJSONValuePtr caps;
char **list = NULL;
size_t i;
- ssize_t n;
+ size_t n;
*capabilities = NULL;
@@ -6272,7 +6270,7 @@ qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon,
virJSONValuePtr caps;
virGICCapability *list = NULL;
size_t i;
- ssize_t n;
+ size_t n;
*capabilities = NULL;
@@ -6495,7 +6493,7 @@ qemuMonitorJSONGetStringArray(qemuMonitorPtr mon, const char *qmpCmd,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
char **list = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*array = NULL;
@@ -6892,14 +6890,11 @@ qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data)
virCPUDataPtr cpudata = NULL;
virCPUx86CPUID cpuid;
size_t i;
- ssize_t n;
-
- n = virJSONValueArraySize(data);
if (!(cpudata = virCPUDataNew(VIR_ARCH_X86_64)))
goto error;
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(data); i++) {
if (qemuMonitorJSONParseCPUx86FeatureWord(virJSONValueArrayGet(data, i),
&cpuid) < 0 ||
virCPUx86DataAddCPUID(cpudata, &cpuid) < 0)
@@ -6960,7 +6955,7 @@ qemuMonitorJSONCheckCPUx86(qemuMonitorPtr mon)
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
size_t i;
- ssize_t n;
+ size_t n;
int ret = -1;
if (!(cmd = qemuMonitorJSONMakeCommand("qom-list",
@@ -7098,7 +7093,7 @@ qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data;
qemuMonitorIOThreadInfoPtr *infolist = NULL;
- ssize_t n = 0;
+ size_t n = 0;
size_t i;
*iothreads = NULL;
@@ -7180,7 +7175,6 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr data = NULL;
qemuMonitorMemoryDeviceInfoPtr meminfo = NULL;
- ssize_t n;
size_t i;
if (!(cmd = qemuMonitorJSONMakeCommand("query-memory-devices", NULL)))
@@ -7198,9 +7192,8 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
goto cleanup;
data = virJSONValueObjectGetArray(reply, "return");
- n = virJSONValueArraySize(data);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(data); i++) {
virJSONValuePtr elem = virJSONValueArrayGet(data, i);
const char *type;
@@ -7666,7 +7659,7 @@ qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon,
size_t *nentries)
{
struct qemuMonitorQueryHotpluggableCpusEntry *info = NULL;
- ssize_t ninfo = 0;
+ size_t ninfo = 0;
int ret = -1;
size_t i;
virJSONValuePtr data;
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index eb0b822545..31b687de12 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -322,12 +322,7 @@ virNetDaemonNewPostExecRestart(virJSONValuePtr object,
goto error;
} else if (virJSONValueIsArray(servers)) {
size_t i;
- ssize_t n = virJSONValueArraySize(servers);
- if (n < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Server count %zd should be positive"), n);
- goto error;
- }
+ size_t n = virJSONValueArraySize(servers);
if (n > nDefServerNames) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Server count %zd greater than default name count %zu"),
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index f4105b1394..5aeb188900 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -411,7 +411,6 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
virJSONValuePtr clients;
virJSONValuePtr services;
size_t i;
- ssize_t n;
unsigned int min_workers;
unsigned int max_workers;
unsigned int priority_workers;
@@ -492,14 +491,13 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
goto error;
}
- n = virJSONValueArraySize(services);
- if (n < 0) {
+ if (!virJSONValueIsArray(services)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed services data in JSON document"));
+ _("Malformed services array"));
goto error;
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(services); i++) {
virNetServerServicePtr service;
virJSONValuePtr child = virJSONValueArrayGet(services, i);
if (!child) {
@@ -525,14 +523,13 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
goto error;
}
- n = virJSONValueArraySize(clients);
- if (n < 0) {
+ if (!virJSONValueIsArray(clients)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed clients data in JSON document"));
+ _("Malformed clients array"));
goto error;
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(clients); i++) {
virNetServerClientPtr client;
virJSONValuePtr child = virJSONValueArrayGet(clients, i);
if (!child) {
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index fb19d09dda..23fc23cab4 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -325,7 +325,7 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj
virNetServerServicePtr svc;
virJSONValuePtr socks;
size_t i;
- ssize_t n;
+ size_t n;
unsigned int max;
if (virNetServerServiceInitialize() < 0)
@@ -358,12 +358,13 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj
goto error;
}
- if ((n = virJSONValueArraySize(socks)) < 0) {
+ if (!virJSONValueIsArray(socks)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("socks field in JSON was not an array"));
+ _("Malformed socks array"));
goto error;
}
+ n = virJSONValueArraySize(socks);
if (VIR_ALLOC_N(svc->socks, n) < 0)
goto error;
svc->nsocks = n;
diff --git a/src/util/virjson.c b/src/util/virjson.c
index dfe00d9280..bb4e3c257b 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -971,12 +971,9 @@ virJSONValueIsArray(virJSONValuePtr array)
}
-ssize_t
+size_t
virJSONValueArraySize(const virJSONValue *array)
{
- if (array->type != VIR_JSON_TYPE_ARRAY)
- return -1;
-
return array->data.array.nvalues;
}
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 0f098892b4..e4a82bdbc8 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -81,7 +81,7 @@ virJSONValuePtr virJSONValueObjectGetByType(virJSONValuePtr object,
bool virJSONValueIsObject(virJSONValuePtr object);
bool virJSONValueIsArray(virJSONValuePtr array);
-ssize_t virJSONValueArraySize(const virJSONValue *array);
+size_t virJSONValueArraySize(const virJSONValue *array);
virJSONValuePtr virJSONValueArrayGet(virJSONValuePtr object, unsigned int element);
virJSONValuePtr virJSONValueArraySteal(virJSONValuePtr object, unsigned int element);
typedef int (*virJSONArrayIteratorFunc)(size_t pos,
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 41af0cdb6d..3364c843aa 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -293,7 +293,6 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
{
virLockSpacePtr lockspace;
virJSONValuePtr resources;
- ssize_t n;
size_t i;
VIR_DEBUG("object=%p", object);
@@ -324,19 +323,19 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
goto error;
}
- if ((n = virJSONValueArraySize(resources)) < 0) {
+ if (!virJSONValueIsArray(resources)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed resources value in JSON document"));
+ _("Malformed resources array"));
goto error;
}
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(resources); i++) {
virJSONValuePtr child = virJSONValueArrayGet(resources, i);
virLockSpaceResourcePtr res;
const char *tmp;
virJSONValuePtr owners;
size_t j;
- ssize_t m;
+ size_t m;
if (VIR_ALLOC(res) < 0)
goto error;
@@ -396,18 +395,19 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
goto error;
}
- if ((m = virJSONValueArraySize(owners)) < 0) {
+ if (!virJSONValueIsArray(owners)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Malformed owners value in JSON document"));
+ _("Malformed owners array"));
virLockSpaceResourceFree(res);
goto error;
}
- res->nOwners = m;
+ m = virJSONValueArraySize(owners);
if (VIR_ALLOC_N(res->owners, res->nOwners) < 0) {
virLockSpaceResourceFree(res);
goto error;
}
+ res->nOwners = m;
for (j = 0; j < res->nOwners; j++) {
unsigned long long int owner;
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index eae1dc01dc..275ab9b54b 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2928,8 +2928,7 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src,
return -1;
nservers = virJSONValueArraySize(server);
-
- if (nservers < 1) {
+ if (nservers == 0) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("at least 1 server is necessary in "
"JSON backing definition for gluster volume"));
diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c
index 21f5d119e8..46bbc4f1e5 100644
--- a/tests/testutilsqemuschema.c
+++ b/tests/testutilsqemuschema.c
@@ -101,11 +101,9 @@ testQEMUSchemaStealObjectMemberByName(const char *name,
{
virJSONValuePtr member;
virJSONValuePtr ret = NULL;
- size_t n;
size_t i;
- n = virJSONValueArraySize(members);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(members); i++) {
member = virJSONValueArrayGet(members, i);
if (STREQ_NULLABLE(name, virJSONValueObjectGetString(member, "name"))) {
@@ -188,7 +186,6 @@ testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root,
virHashTablePtr schema,
virBufferPtr debug)
{
- size_t n;
size_t i;
virJSONValuePtr variants = NULL;
virJSONValuePtr variant;
@@ -203,8 +200,7 @@ testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root,
return -2;
}
- n = virJSONValueArraySize(variants);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(variants); i++) {
variant = virJSONValueArrayGet(variants, i);
if (STREQ_NULLABLE(variantname,
@@ -342,7 +338,6 @@ testQEMUSchemaValidateEnum(virJSONValuePtr obj,
const char *objstr;
virJSONValuePtr values = NULL;
virJSONValuePtr value;
- size_t n;
size_t i;
if (virJSONValueGetType(obj) != VIR_JSON_TYPE_STRING) {
@@ -358,8 +353,7 @@ testQEMUSchemaValidateEnum(virJSONValuePtr obj,
return -2;
}
- n = virJSONValueArraySize(values);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(values); i++) {
value = virJSONValueArrayGet(values, i);
if (STREQ_NULLABLE(objstr, virJSONValueGetString(value))) {
@@ -383,7 +377,6 @@ testQEMUSchemaValidateArray(virJSONValuePtr objs,
const char *elemtypename = virJSONValueObjectGetString(root, "element-type");
virJSONValuePtr elementschema;
virJSONValuePtr obj;
- size_t n;
size_t i;
if (virJSONValueGetType(objs) != VIR_JSON_TYPE_ARRAY) {
@@ -401,8 +394,7 @@ testQEMUSchemaValidateArray(virJSONValuePtr objs,
virBufferAddLit(debug, "[\n");
virBufferAdjustIndent(debug, 3);
- n = virJSONValueArraySize(objs);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < virJSONValueArraySize(objs); i++) {
obj = virJSONValueArrayGet(objs, i);
if (testQEMUSchemaValidateRecurse(obj, elementschema, schema, debug) < 0)
@@ -423,8 +415,8 @@ testQEMUSchemaValidateAlternate(virJSONValuePtr obj,
{
virJSONValuePtr members;
virJSONValuePtr member;
- size_t n;
size_t i;
+ size_t n;
const char *membertype;
virJSONValuePtr memberschema;
int indent;
diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c
index 62fe589bed..ec73ea575a 100644
--- a/tools/nss/libvirt_nss.c
+++ b/tools/nss/libvirt_nss.c
@@ -309,8 +309,7 @@ findLease(const char *name,
}
VIR_DIR_CLOSE(dir);
- if ((nleases = virJSONValueArraySize(leases_array)) < 0)
- goto cleanup;
+ nleases = virJSONValueArraySize(leases_array);
DEBUG("Read %zd leases", nleases);
#if !defined(LIBVIRT_NSS_GUEST)
--
2.14.3
2
1