[libvirt] domXML modeling question
by Jim Fehlig
There have been a few requests [1][2] to support Xen's max_grant_frames setting
in libvirt domXML, but I'm not quite sure how to model it. The documentation [3]
on this setting states:
Specify the maximum number of grant frames the domain is allowed to have. This
value controls how many pages the domain is able to grant access to for other
domains, needed e.g. for the operation of paravirtualized devices. The default
is settable via xl.conf(5).
It smells of a <memtune> setting, e.g. the amount of memory a domain can share,
but doesn't map to any of the existing settings. A new subelement <shared_limit>
doesn't feel right. Does anyone suggest a better way of modeling max_grant_frames?
Another option I considered is setting the value based on number of PV devices,
but I think that flies in the face of libvirt's policy of not dictating policy.
Regardless of domain config modeling I can work on a driver-wide setting in
libxl.conf, similar to Xen's xl.conf(5) global.
Regards,
Jim
[1] https://www.redhat.com/archives/libvir-list/2018-April/msg00216.html
[2] https://www.redhat.com/archives/libvirt-users/2019-January/msg00011.html
[3]
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/man/xl.cfg.5.pod.i...
5 years, 8 months
[libvirt] [PATCH v1 00/15] Firmware auto selection
by Michal Privoznik
Libvirt allows specifying firmware for domains for quite some time now.
However, problem for mgmt applications is that they do not know which
firmware to chose as all they see are their paths and from that it's
impossible to tell whether one of them supports say secure boot.
This problem was addressed by qemu where Lazslo and Daniel created a
document, specification which describes metadata for each individual
firmware image. In the description (which itself is a JSON file for easy
machine parsing) then it's specified whether the firmware it's
describing supports secureboot, s3/s4 states, it it's bios or efi, and
so on.
These patches take advantage of that, and even though the description
files are not picked up by that many distributions yet, it allows users
to not care about putting specific firmware path into their domain XML.
It's as easy as:
<os firmware='efi'>
<loader secure='yes'/>
</os>
to have libvirt pick up OVMF image with secure enabled boot (and enabled
System Management Mode at the same time).
The metadata specification lives under
qemu.git/docs/interop/firmware.json and I highly recommend you go and
read it before reviewing (unless you're Laszlo or Daniel in which case
you already know what the document says).
As usual, you can find my patches at my github:
https://github.com/zippy2/libvirt/commits/firmware_v1
Michal Prívozník (15):
virmock: Initialize both symbols in VIR_MOCK_REAL_INIT_ALT
qemu_domain: Separate NVRAM VAR store file name generation
qemu_capabilities: Expose qemu <-> libvirt arch translators
virDomainLoaderDefParseXML: Allow loader path to be NULL
conf: Introduce VIR_DOMAIN_LOADER_TYPE_NONE
conf: Introduce firmware attribute to <os/>
qemu: Introduce basic skeleton for parsing firmware description
test: Introduce qemufirmwaretest
qemu_firmware: Introduce qemuFirmwareFetchConfigs
qemufirmwaretest: Test qemuFirmwareFetchConfigs()
qemu_firmware: Introduce qemuFirmwareFillDomain()
qemu_process: Call qemuFirmwareFillDomain
qemuDomainDefValidate: Don't require SMM if automatic firmware
selection enabled
qemu: Enable firmware autoselection
qemuxml2argvtest: Test os.firmware autoselection
docs/formatdomain.html.in | 22 +-
docs/schemas/domaincommon.rng | 12 +-
src/conf/domain_conf.c | 113 +-
src/conf/domain_conf.h | 15 +-
src/libvirt_private.syms | 2 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/qemu_capabilities.c | 4 +-
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 1 +
src/qemu/qemu_domain.c | 34 +-
src/qemu/qemu_domain.h | 4 +
src/qemu/qemu_firmware.c | 1285 +++++++++++++++++
src/qemu/qemu_firmware.h | 50 +
src/qemu/qemu_process.c | 5 +
tests/Makefile.am | 14 +-
tests/domaincapsschemadata/full.xml | 1 +
.../etc/qemu/firmware/40-ovmf-sb.json | 1 +
.../etc/qemu/firmware/60-ovmf.json | 0
.../user/.config/qemu/firmware/10-bios.json | 0
.../usr/share/qemu/firmware/40-bios.json | 35 +
.../usr/share/qemu/firmware/50-ovmf-sb.json | 36 +
.../usr/share/qemu/firmware/60-ovmf.json | 35 +
.../usr/share/qemu/firmware/70-aavmf.json | 35 +
tests/qemufirmwaretest.c | 129 ++
...arch64-os-firmware-efi.aarch64-latest.args | 37 +
.../aarch64-os-firmware-efi.xml | 30 +
.../os-firmware-bios.x86_64-latest.args | 39 +
tests/qemuxml2argvdata/os-firmware-bios.xml | 68 +
...os-firmware-efi-secboot.x86_64-latest.args | 42 +
.../os-firmware-efi-secboot.xml | 68 +
.../os-firmware-efi.x86_64-latest.args | 42 +
tests/qemuxml2argvdata/os-firmware-efi.xml | 68 +
tests/qemuxml2argvtest.c | 17 +
.../aarch64-os-firmware-efi.xml | 1 +
tests/qemuxml2xmloutdata/os-firmware-bios.xml | 1 +
.../os-firmware-efi-secboot.xml | 1 +
tests/qemuxml2xmloutdata/os-firmware-efi.xml | 1 +
tests/qemuxml2xmltest.c | 27 +
tests/virmock.h | 5 +-
39 files changed, 2255 insertions(+), 30 deletions(-)
create mode 100644 src/qemu/qemu_firmware.c
create mode 100644 src/qemu/qemu_firmware.h
create mode 120000 tests/qemufirmwaredata/etc/qemu/firmware/40-ovmf-sb.json
create mode 100644 tests/qemufirmwaredata/etc/qemu/firmware/60-ovmf.json
create mode 100644 tests/qemufirmwaredata/home/user/.config/qemu/firmware/10-bios.json
create mode 100644 tests/qemufirmwaredata/usr/share/qemu/firmware/40-bios.json
create mode 100644 tests/qemufirmwaredata/usr/share/qemu/firmware/50-ovmf-sb.json
create mode 100644 tests/qemufirmwaredata/usr/share/qemu/firmware/60-ovmf.json
create mode 100644 tests/qemufirmwaredata/usr/share/qemu/firmware/70-aavmf.json
create mode 100644 tests/qemufirmwaretest.c
create mode 100644 tests/qemuxml2argvdata/aarch64-os-firmware-efi.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/aarch64-os-firmware-efi.xml
create mode 100644 tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/os-firmware-bios.xml
create mode 100644 tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/os-firmware-efi-secboot.xml
create mode 100644 tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/os-firmware-efi.xml
create mode 120000 tests/qemuxml2xmloutdata/aarch64-os-firmware-efi.xml
create mode 120000 tests/qemuxml2xmloutdata/os-firmware-bios.xml
create mode 120000 tests/qemuxml2xmloutdata/os-firmware-efi-secboot.xml
create mode 120000 tests/qemuxml2xmloutdata/os-firmware-efi.xml
--
2.19.2
5 years, 8 months
[libvirt] [PATCH 0/3] tests: Clean up qemuxml2xml a bit
by Andrea Bolognani
Just your average yak shaving, really.
Andrea Bolognani (3):
tests: Rename some qemuxml2xml output files for clarity
tests: Use WHEN_BOTH in qemuxml2xml whenever possible
tests: Add -inactive suffix when appropriate for qemuxml2xml
...ml => channel-unix-source-path-active.xml} | 3 +
... => channel-unix-source-path-inactive.xml} | 0
...mmit.xml => disk-active-commit-active.xml} | 0
...it.xml => disk-active-commit-inactive.xml} | 8 +-
.../disk-backing-chains-noindex-inactive.xml | 156 ------------------
...ve.xml => disk-backing-chains-noindex.xml} | 0
...ror-old.xml => disk-mirror-old-active.xml} | 0
...> seclabel-dynamic-baselabel-inactive.xml} | 0
...> seclabel-dynamic-labelskip-inactive.xml} | 0
...eclabel-dynamic-none-relabel-inactive.xml} | 0
...=> seclabel-dynamic-override-inactive.xml} | 0
... => seclabel-dynamic-relabel-inactive.xml} | 0
...l => seclabel-static-labelskip-active.xml} | 0
...=> seclabel-static-labelskip-inactive.xml} | 5 +-
tests/qemuxml2xmltest.c | 6 +-
15 files changed, 11 insertions(+), 167 deletions(-)
copy tests/qemuxml2xmloutdata/{channel-unix-source-path.xml => channel-unix-source-path-active.xml} (86%)
rename tests/qemuxml2xmloutdata/{channel-unix-source-path.xml => channel-unix-source-path-inactive.xml} (100%)
copy tests/qemuxml2xmloutdata/{disk-active-commit.xml => disk-active-commit-active.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-active-commit.xml => disk-active-commit-inactive.xml} (86%)
delete mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml
rename tests/qemuxml2xmloutdata/{disk-backing-chains-noindex-active.xml => disk-backing-chains-noindex.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-mirror-old.xml => disk-mirror-old-active.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-dynamic-baselabel.xml => seclabel-dynamic-baselabel-inactive.xml} (100%)
copy tests/qemuxml2xmloutdata/{seclabel-dynamic-labelskip.xml => seclabel-dynamic-labelskip-inactive.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-dynamic-none-relabel.xml => seclabel-dynamic-none-relabel-inactive.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-dynamic-override.xml => seclabel-dynamic-override-inactive.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-dynamic-relabel.xml => seclabel-dynamic-relabel-inactive.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-static-labelskip.xml => seclabel-static-labelskip-active.xml} (100%)
rename tests/qemuxml2xmloutdata/{seclabel-dynamic-labelskip.xml => seclabel-static-labelskip-inactive.xml} (90%)
--
2.20.1
5 years, 8 months
[libvirt] [jenkins-ci PATCH v6 0/4] Add support for cross compiling libvirt via Debian
by Daniel P. Berrangé
Changed in v6:
- Use a static mapping for arch info
- Split out data file changes from code changes
- Change arch suffix to a prefix
Changed in v5:
- Remove redundant formatter class
- Update commit message
- Update readme
- Move misplaced patch chunk
- Dont set "dest" in arg when not needed
- Use metavar for subparser
Changed in v4:
- Pull in change to use argparse sub-parsers
- Refactor way architecture specific package rules are stored
to be in the main package mappings data
Changed in v3:
- Remove sheepdog more generally
- Use .format() style printf
- Split config to cross-build.yml
- Make glusterfs name per-distro customized
- Misc code style changes
- Rename fields in cross-build.yml
- Don't use crossbuild-essential packages
Changed in v2:
- Fix multiple package name mistakes
- Modify lcitool to generate cross-arch docker files
- Add --no-install-recommended flag to apt-get
- Add DEBIAN_FRONTEND=noninteractive env to apt-get
- Improve error reporting in lcitool
- Add make rule for generating dockerfiles locally
Daniel P. Berrangé (4):
mappings: extend mapping to allow per-arch entries
mappings: filter arch usage for libnuma / xen
lcitool: support generating cross compiler dockerfiles
mappings: mark packages using foreign arch for cross builds
guests/lcitool | 117 ++++++++++++++++++++-
guests/playbooks/update/tasks/packages.yml | 32 ++++++
guests/vars/mappings.yml | 106 ++++++++++++++++++-
3 files changed, 249 insertions(+), 6 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH 00/26] cpu_x86: Add multiple signatures for CPU models
by Jiri Denemark
CPU signatures in the cpu_map serve as a hint for CPUID to CPU model
matching algorithm. If the CPU signatures matches any CPU model in the
cpu_map, this model will be the preferred one.
This works out well and solved several mismatches, but in real world
CPUs which should match a single CPU model may be produced with several
different signatures. For example, low voltage Broadwell CPUs for
laptops and Broadwell CPUs for servers differ in CPU model numbers while
we should detect them all as Broadwell CPU model.
This patch adds support for storing several signatures for a single CPU
model to make this hint useful for more CPUs. Later commits will provide
additional signatures for existing CPU models, which will correct some
results in our CPU test suite.
The list of signatures corresponding to each CPU model were generated by
consulting the following sites:
https://en.wikichip.org/wiki/intel/cpuid
http://www.cpu-world.com/cgi-bin/CPUID.pl
https://ark.intel.com/content/www/us/en/ark.html
Jiri Denemark (26):
cputest: Make sure generated files pass syntax-check
cputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4
cputest: Add data for Intel(R) Core(TM) i7-7600U
cputest: Add data for Intel(R) Xeon(R) CPU E7540
cputest: Add data for Intel(R) Xeon(R) CPU E5-2650
cpu_x86: Separate ancestor model parsing from x86ModelParse
cpu_x86: Separate signature parsing from x86ModelParse
cpu_x86: Separate vendor parsing from x86ModelParse
cpu_x86: Separate feature list parsing from x86ModelParse
cpu_x86: Make sure CPU model names are unique in cpu_map
cpu_x86: Allow multiple signatures for a CPU model
qemu_capabilities: Inroduce virQEMUCapsGetCPUModelX86Data
qemu_capabilities: Introduce virQEMUCapsGetCPUModelInfo
qemu_capabilities: Use virQEMUCapsGetCPUModelInfo
cpu_x86: Add virCPUx86DataGetSignature for tests
cpu_map: Add hex representation of signatures
cputest: Test CPU signatures
cpu_map: Add more signatures for Conroe CPU model
cpu_map: Add more signatures for Penryn CPU model
cpu_map: Add more signatures for Nehalem CPU models
cpu_map: Add more signatures for Westmere CPU model
cpu_map: Add more signatures for SandyBridge CPU models
cpu_map: Add more signatures for IvyBridge CPU models
cpu_map: Add more signatures for Haswell CPU models
cpu_map: Add more signatures for Broadwell CPU models
cpu_map: Add more signatures for Skylake-Client CPU models
src/cpu/cpu_x86.c | 345 +++--
src/cpu/cpu_x86.h | 5 +
src/cpu_map/x86_Broadwell-IBRS.xml | 5 +-
src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 5 +-
src/cpu_map/x86_Broadwell-noTSX.xml | 5 +-
src/cpu_map/x86_Broadwell.xml | 5 +-
src/cpu_map/x86_Conroe.xml | 3 +-
src/cpu_map/x86_EPYC-IBRS.xml | 2 +-
src/cpu_map/x86_EPYC.xml | 2 +-
src/cpu_map/x86_Haswell-IBRS.xml | 5 +-
src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 5 +-
src/cpu_map/x86_Haswell-noTSX.xml | 5 +-
src/cpu_map/x86_Haswell.xml | 5 +-
src/cpu_map/x86_Icelake-Client.xml | 2 +-
src/cpu_map/x86_Icelake-Server.xml | 2 +-
src/cpu_map/x86_IvyBridge-IBRS.xml | 3 +-
src/cpu_map/x86_IvyBridge.xml | 3 +-
src/cpu_map/x86_Nehalem-IBRS.xml | 5 +-
src/cpu_map/x86_Nehalem.xml | 5 +-
src/cpu_map/x86_Opteron_G1.xml | 2 +-
src/cpu_map/x86_Opteron_G2.xml | 2 +-
src/cpu_map/x86_Opteron_G3.xml | 2 +-
src/cpu_map/x86_Opteron_G4.xml | 2 +-
src/cpu_map/x86_Opteron_G5.xml | 2 +-
src/cpu_map/x86_Penryn.xml | 3 +-
src/cpu_map/x86_SandyBridge-IBRS.xml | 3 +-
src/cpu_map/x86_SandyBridge.xml | 3 +-
src/cpu_map/x86_Skylake-Client-IBRS.xml | 7 +-
src/cpu_map/x86_Skylake-Client.xml | 7 +-
src/cpu_map/x86_Skylake-Server-IBRS.xml | 2 +-
src/cpu_map/x86_Skylake-Server.xml | 2 +-
src/cpu_map/x86_Westmere-IBRS.xml | 2 +-
src/cpu_map/x86_Westmere.xml | 4 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 91 +-
src/qemu/qemu_capspriv.h | 8 +
tests/cputest.c | 96 ++
tests/cputestdata/cpu-reformat.py | 2 +-
tests/cputestdata/x86_64-cpuid-A10-5800K.sig | 4 +
tests/cputestdata/x86_64-cpuid-Atom-D510.sig | 4 +
tests/cputestdata/x86_64-cpuid-Atom-N450.sig | 4 +
.../cputestdata/x86_64-cpuid-Core-i5-2500.sig | 4 +
.../x86_64-cpuid-Core-i5-2540M.sig | 4 +
.../x86_64-cpuid-Core-i5-4670T.sig | 4 +
.../x86_64-cpuid-Core-i5-650-json.xml | 9 +-
.../cputestdata/x86_64-cpuid-Core-i5-650.sig | 4 +
.../cputestdata/x86_64-cpuid-Core-i5-6600.sig | 4 +
.../x86_64-cpuid-Core-i7-2600-xsaveopt.sig | 4 +
.../cputestdata/x86_64-cpuid-Core-i7-2600.sig | 4 +
.../x86_64-cpuid-Core-i7-3520M.sig | 4 +
.../x86_64-cpuid-Core-i7-3740QM.sig | 4 +
.../cputestdata/x86_64-cpuid-Core-i7-3770.sig | 4 +
.../x86_64-cpuid-Core-i7-4510U.sig | 4 +
.../x86_64-cpuid-Core-i7-4600U.sig | 4 +
.../x86_64-cpuid-Core-i7-5600U-arat.sig | 4 +
.../x86_64-cpuid-Core-i7-5600U-ibrs.sig | 4 +
.../x86_64-cpuid-Core-i7-5600U.sig | 4 +
.../x86_64-cpuid-Core-i7-7600U-disabled.xml | 6 +
.../x86_64-cpuid-Core-i7-7600U-enabled.xml | 8 +
.../x86_64-cpuid-Core-i7-7600U-guest.xml | 28 +
.../x86_64-cpuid-Core-i7-7600U-host.xml | 29 +
.../x86_64-cpuid-Core-i7-7600U-json.xml | 13 +
.../x86_64-cpuid-Core-i7-7600U.json | 755 +++++++++++
.../x86_64-cpuid-Core-i7-7600U.sig | 4 +
.../x86_64-cpuid-Core-i7-7600U.xml | 47 +
.../cputestdata/x86_64-cpuid-Core-i7-7700.sig | 4 +
.../cputestdata/x86_64-cpuid-Core2-E6850.sig | 4 +
.../cputestdata/x86_64-cpuid-Core2-Q9500.sig | 4 +
.../x86_64-cpuid-EPYC-7601-32-Core-ibpb.sig | 4 +
.../x86_64-cpuid-EPYC-7601-32-Core.sig | 4 +
tests/cputestdata/x86_64-cpuid-FX-8150.sig | 4 +
.../cputestdata/x86_64-cpuid-Opteron-1352.sig | 4 +
.../cputestdata/x86_64-cpuid-Opteron-2350.sig | 4 +
.../cputestdata/x86_64-cpuid-Opteron-6234.sig | 4 +
.../cputestdata/x86_64-cpuid-Opteron-6282.sig | 4 +
.../x86_64-cpuid-Pentium-P6100-guest.xml | 10 +-
.../x86_64-cpuid-Pentium-P6100.sig | 4 +
tests/cputestdata/x86_64-cpuid-Phenom-B95.sig | 4 +
.../x86_64-cpuid-Ryzen-7-1800X-Eight-Core.sig | 4 +
tests/cputestdata/x86_64-cpuid-Xeon-5110.sig | 4 +
.../x86_64-cpuid-Xeon-E3-1245-v5.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2609-v3.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2623-v4-guest.xml | 11 +-
.../x86_64-cpuid-Xeon-E5-2623-v4-json.xml | 11 +-
.../x86_64-cpuid-Xeon-E5-2623-v4.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2630-v3.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2630-v4-disabled.xml | 7 +
.../x86_64-cpuid-Xeon-E5-2630-v4-enabled.xml | 8 +
.../x86_64-cpuid-Xeon-E5-2630-v4-guest.xml | 34 +
.../x86_64-cpuid-Xeon-E5-2630-v4-host.xml | 35 +
.../x86_64-cpuid-Xeon-E5-2630-v4-json.xml | 14 +
.../x86_64-cpuid-Xeon-E5-2630-v4.json | 596 +++++++++
.../x86_64-cpuid-Xeon-E5-2630-v4.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2630-v4.xml | 43 +
.../x86_64-cpuid-Xeon-E5-2650-disabled.xml | 5 +
.../x86_64-cpuid-Xeon-E5-2650-enabled.xml | 8 +
.../x86_64-cpuid-Xeon-E5-2650-guest.xml | 29 +
.../x86_64-cpuid-Xeon-E5-2650-host.xml | 30 +
.../x86_64-cpuid-Xeon-E5-2650-json.xml | 14 +
.../x86_64-cpuid-Xeon-E5-2650-v3.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2650-v4-guest.xml | 11 +-
.../x86_64-cpuid-Xeon-E5-2650-v4-json.xml | 11 +-
.../x86_64-cpuid-Xeon-E5-2650-v4.sig | 4 +
.../x86_64-cpuid-Xeon-E5-2650.json | 931 ++++++++++++++
.../cputestdata/x86_64-cpuid-Xeon-E5-2650.sig | 4 +
.../cputestdata/x86_64-cpuid-Xeon-E5-2650.xml | 34 +
.../x86_64-cpuid-Xeon-E7-4820-guest.xml | 8 +-
.../x86_64-cpuid-Xeon-E7-4820-json.xml | 8 +-
.../cputestdata/x86_64-cpuid-Xeon-E7-4820.sig | 4 +
.../x86_64-cpuid-Xeon-E7-4830-json.xml | 9 +-
.../cputestdata/x86_64-cpuid-Xeon-E7-4830.sig | 4 +
.../x86_64-cpuid-Xeon-E7-8890-v3.sig | 4 +
.../x86_64-cpuid-Xeon-E7540-disabled.xml | 5 +
.../x86_64-cpuid-Xeon-E7540-enabled.xml | 7 +
.../x86_64-cpuid-Xeon-E7540-guest.xml | 25 +
.../x86_64-cpuid-Xeon-E7540-host.xml | 26 +
.../x86_64-cpuid-Xeon-E7540-json.xml | 14 +
.../cputestdata/x86_64-cpuid-Xeon-E7540.json | 1117 +++++++++++++++++
tests/cputestdata/x86_64-cpuid-Xeon-E7540.sig | 4 +
tests/cputestdata/x86_64-cpuid-Xeon-E7540.xml | 30 +
.../x86_64-cpuid-Xeon-Gold-5115.sig | 4 +
.../x86_64-cpuid-Xeon-Gold-6148.sig | 4 +
tests/cputestdata/x86_64-cpuid-Xeon-W3520.sig | 4 +
tests/cputestdata/x86_64-cpuid-Xeon-X5460.sig | 4 +
124 files changed, 4634 insertions(+), 206 deletions(-)
create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-D510.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-N450.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-650.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3520M.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U.json
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7600U.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-7700.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-Q9500.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-EPYC-7601-32-Core-ibpb.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-EPYC-7601-32-Core.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-FX-8150.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-1352.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6282.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Pentium-P6100.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-5110.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v3.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-guest.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-host.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-json.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4.json
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-host.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v3.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650.json
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-8890-v3.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540-disabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540-enabled.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540-guest.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540-host.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540-json.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540.json
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7540.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520.sig
create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-X5460.sig
--
2.21.0
5 years, 8 months
[libvirt] [PATCH v2 0/6] Alter domain_conf to make use of autofree
by John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2019-February/msg01160.html
Changes since v1:
* Push patch 1
* Split patch 2 to follow code review guidance:
* (Patch1) Pull out virDomainEmulatorPinDefParseXML changes to
use VIR_STEAL_PTR
* (Patch2) Use VIR_AUTOPTR(virBitmap)
* (Patch3) Handle a couple cases where goto's no longer necessary
* Drop Patch 3
* Split Patch 4 to follow code review guidance:
* (Patch4) Remove unused variables
* (Patch5) Just use VIR_AUTOFREE
* (Patch6) Handle the removal of goto logic that's no longer necessary
John Ferlan (6):
conf: Rework virDomainEmulatorPinDefParseXML
conf: Use VIR_AUTOPTR(virBitmap) in domain_conf
conf: Clean up some unnecessary goto paths
conf: Remove a few unused variables in domain_conf
conf: Use VIR_AUTOFREE in domain_conf
conf: Clean up some unnecessary goto paths
src/conf/domain_conf.c | 1937 ++++++++++++++--------------------------
1 file changed, 676 insertions(+), 1261 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [jenkins-ci PATCH v5 0/5] Add support for cross compiling libvirt via Debian
by Daniel P. Berrangé
Changed in v5:
- Remove redundant formatter class
- Update commit message
- Update readme
- Move misplaced patch chunk
- Dont set "dest" in arg when not needed
- Use metavar for subparser
Changed in v4:
- Pull in change to use argparse sub-parsers
- Refactor way architecture specific package rules are stored
to be in the main package mappings data
Changed in v3:
- Remove sheepdog more generally
- Use .format() style printf
- Split config to cross-build.yml
- Make glusterfs name per-distro customized
- Misc code style changes
- Rename fields in cross-build.yml
- Don't use crossbuild-essential packages
Changed in v2:
- Fix multiple package name mistakes
- Modify lcitool to generate cross-arch docker files
- Add --no-install-recommended flag to apt-get
- Add DEBIAN_FRONTEND=noninteractive env to apt-get
- Improve error reporting in lcitool
- Add make rule for generating dockerfiles locally
Daniel P. Berrangé (5):
lcitool: use subparsers for commands
lcitool: avoid repetition when expanding package mappings
lcitool: avoid intermediate list of packages
mappings: extend mapping to allow per-arch entries
lcitool: support generating cross compiler dockerfiles
guests/README.markdown | 18 +-
guests/host_vars/libvirt-debian-9/main.yml | 44 ++++
guests/host_vars/libvirt-debian-sid/main.yml | 45 ++++
guests/lcitool | 230 +++++++++++++------
guests/playbooks/update/tasks/packages.yml | 32 +++
guests/vars/mappings.yml | 101 +++++++-
6 files changed, 381 insertions(+), 89 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] util: Use VIR_AUTOUNREF for virstoragefile
by John Ferlan
Let's make use of the auto __cleanup capabilities cleaning up any
now unnecessary goto paths.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
BTW: I did try this with a linked travis-ci and github branch, and it
worked for me. I'm avoiding altering virStorageFileMetadataNew...
src/util/virstoragefile.c | 130 +++++++++++++++-----------------------
1 file changed, 52 insertions(+), 78 deletions(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index b2e308d81d..003183bf76 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1205,11 +1205,11 @@ virStorageFileGetMetadataFromFD(const char *path,
{
virStorageSourcePtr ret = NULL;
- virStorageSourcePtr meta = NULL;
ssize_t len = VIR_STORAGE_MAX_HEADER;
struct stat sb;
int dummy;
VIR_AUTOFREE(char *) buf = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
if (!backingFormat)
backingFormat = &dummy;
@@ -1231,21 +1231,21 @@ virStorageFileGetMetadataFromFD(const char *path,
meta->type = VIR_STORAGE_TYPE_DIR;
meta->format = VIR_STORAGE_FILE_DIR;
VIR_STEAL_PTR(ret, meta);
- goto cleanup;
+ return ret;
}
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
virReportSystemError(errno, _("cannot seek to start of '%s'"), meta->path);
- goto cleanup;
+ return NULL;
}
if ((len = virFileReadHeaderFD(fd, len, &buf)) < 0) {
virReportSystemError(errno, _("cannot read header '%s'"), meta->path);
- goto cleanup;
+ return NULL;
}
if (virStorageFileGetMetadataInternal(meta, buf, len, backingFormat) < 0)
- goto cleanup;
+ return NULL;
if (S_ISREG(sb.st_mode))
meta->type = VIR_STORAGE_TYPE_FILE;
@@ -1253,9 +1253,6 @@ virStorageFileGetMetadataFromFD(const char *path,
meta->type = VIR_STORAGE_TYPE_BLOCK;
VIR_STEAL_PTR(ret, meta);
-
- cleanup:
- virObjectUnref(meta);
return ret;
}
@@ -2243,7 +2240,8 @@ virStorageSourcePtr
virStorageSourceCopy(const virStorageSource *src,
bool backingChain)
{
- virStorageSourcePtr def = NULL;
+ virStorageSourcePtr ret = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
if (!(def = virStorageSourceNew()))
return NULL;
@@ -2282,60 +2280,57 @@ virStorageSourceCopy(const virStorageSource *src,
VIR_STRDUP(def->compat, src->compat) < 0 ||
VIR_STRDUP(def->tlsAlias, src->tlsAlias) < 0 ||
VIR_STRDUP(def->tlsCertdir, src->tlsCertdir) < 0)
- goto error;
+ return NULL;
if (src->nhosts) {
if (!(def->hosts = virStorageNetHostDefCopy(src->nhosts, src->hosts)))
- goto error;
+ return NULL;
def->nhosts = src->nhosts;
}
if (src->srcpool &&
!(def->srcpool = virStorageSourcePoolDefCopy(src->srcpool)))
- goto error;
+ return NULL;
if (src->features &&
!(def->features = virBitmapNewCopy(src->features)))
- goto error;
+ return NULL;
if (src->encryption &&
!(def->encryption = virStorageEncryptionCopy(src->encryption)))
- goto error;
+ return NULL;
if (src->perms &&
!(def->perms = virStoragePermsCopy(src->perms)))
- goto error;
+ return NULL;
if (src->timestamps &&
!(def->timestamps = virStorageTimestampsCopy(src->timestamps)))
- goto error;
+ return NULL;
if (virStorageSourceSeclabelsCopy(def, src) < 0)
- goto error;
+ return NULL;
if (src->auth &&
!(def->auth = virStorageAuthDefCopy(src->auth)))
- goto error;
+ return NULL;
if (src->pr &&
!(def->pr = virStoragePRDefCopy(src->pr)))
- goto error;
+ return NULL;
if (virStorageSourceInitiatorCopy(&def->initiator, &src->initiator))
- goto error;
+ return NULL;
if (backingChain && src->backingStore) {
if (!(def->backingStore = virStorageSourceCopy(src->backingStore,
true)))
- goto error;
+ return NULL;
}
- return def;
-
- error:
- virObjectUnref(def);
- return NULL;
+ VIR_STEAL_PTR(ret, def);
+ return ret;
}
@@ -2601,27 +2596,28 @@ static virStorageSourcePtr
virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent,
const char *rel)
{
- virStorageSourcePtr def;
+ virStorageSourcePtr ret = NULL;
VIR_AUTOFREE(char *) dirname = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
if (!(def = virStorageSourceNew()))
return NULL;
/* store relative name */
if (VIR_STRDUP(def->relPath, parent->backingStoreRaw) < 0)
- goto error;
+ return NULL;
if (!(dirname = mdir_name(parent->path))) {
virReportOOMError();
- goto error;
+ return NULL;
}
if (STRNEQ(dirname, "/")) {
if (virAsprintf(&def->path, "%s/%s", dirname, rel) < 0)
- goto error;
+ return NULL;
} else {
if (virAsprintf(&def->path, "/%s", rel) < 0)
- goto error;
+ return NULL;
}
if (virStorageSourceGetActualType(parent) == VIR_STORAGE_TYPE_NETWORK) {
@@ -2632,25 +2628,20 @@ virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent,
if (parent->nhosts) {
if (!(def->hosts = virStorageNetHostDefCopy(parent->nhosts,
parent->hosts)))
- goto error;
+ return NULL;
def->nhosts = parent->nhosts;
}
if (VIR_STRDUP(def->volume, parent->volume) < 0)
- goto error;
+ return NULL;
} else {
/* set the type to _FILE, the caller shall update it to the actual type */
def->type = VIR_STORAGE_TYPE_FILE;
}
- cleanup:
- return def;
-
- error:
- virObjectUnref(def);
- def = NULL;
- goto cleanup;
+ VIR_STEAL_PTR(ret, def);
+ return ret;
}
@@ -3648,8 +3639,9 @@ virStorageSourcePtr
virStorageSourceNewFromBackingAbsolute(const char *path)
{
const char *json;
- virStorageSourcePtr def;
+ virStorageSourcePtr ret = NULL;
int rc;
+ VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
if (!(def = virStorageSourceNew()))
return NULL;
@@ -3658,7 +3650,7 @@ virStorageSourceNewFromBackingAbsolute(const char *path)
def->type = VIR_STORAGE_TYPE_FILE;
if (VIR_STRDUP(def->path, path) < 0)
- goto error;
+ return NULL;
} else {
def->type = VIR_STORAGE_TYPE_NETWORK;
@@ -3673,7 +3665,7 @@ virStorageSourceNewFromBackingAbsolute(const char *path)
rc = virStorageSourceParseBackingColon(def, path);
if (rc < 0)
- goto error;
+ return NULL;
virStorageSourceNetworkAssignDefaultPorts(def);
@@ -3686,11 +3678,8 @@ virStorageSourceNewFromBackingAbsolute(const char *path)
}
}
- return def;
-
- error:
- virObjectUnref(def);
- return NULL;
+ VIR_STEAL_PTR(ret, def);
+ return ret;
}
@@ -3698,7 +3687,8 @@ virStorageSourcePtr
virStorageSourceNewFromBacking(virStorageSourcePtr parent)
{
struct stat st;
- virStorageSourcePtr def;
+ virStorageSourcePtr ret = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
if (virStorageIsRelative(parent->backingStoreRaw))
def = virStorageSourceNewFromBackingRelative(parent,
@@ -3721,17 +3711,14 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
/* copy parent's labelling and other top level stuff */
if (virStorageSourceInitChainElement(def, parent, true) < 0)
- goto error;
+ return NULL;
def->readonly = true;
def->detected = true;
}
- return def;
-
- error:
- virObjectUnref(def);
- return NULL;
+ VIR_STEAL_PTR(ret, def);
+ return ret;
}
@@ -3872,9 +3859,8 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
ssize_t len,
bool probe)
{
- int ret = -1;
- virStorageSourcePtr meta = NULL;
int format = src->format;
+ VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
/* Raw files: capacity is physical size. For all other files: if
* the metadata has a capacity, use that, otherwise fall back to
@@ -3884,12 +3870,12 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk format for %s and probing is disabled"),
src->path);
- goto cleanup;
+ return -1;
}
if ((format = virStorageFileProbeFormatFromBuf(src->path,
buf, len)) < 0)
- goto cleanup;
+ return -1;
src->format = format;
}
@@ -3902,17 +3888,13 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
if (src->encryption && meta->encryption)
src->encryption->payload_offset = meta->encryption->payload_offset;
} else {
- goto cleanup;
+ return -1;
}
if (src->encryption && src->encryption->payload_offset != -1)
src->capacity -= src->encryption->payload_offset * 512;
- ret = 0;
-
- cleanup:
- virObjectUnref(meta);
- return ret;
+ return 0;
}
@@ -4849,10 +4831,10 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
int ret = -1;
const char *uniqueName;
ssize_t headerLen;
- virStorageSourcePtr backingStore = NULL;
int backingFormat;
int rv;
VIR_AUTOFREE(char *) buf = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) backingStore = NULL;
VIR_DEBUG("path=%s format=%d uid=%u gid=%u",
src->path, src->format,
@@ -4935,7 +4917,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
if (virStorageSourceHasBacking(src))
src->backingStore->id = depth;
virStorageFileDeinit(src);
- virObjectUnref(backingStore);
return ret;
}
@@ -5004,11 +4985,10 @@ int
virStorageFileGetBackingStoreStr(virStorageSourcePtr src,
char **backing)
{
- virStorageSourcePtr tmp = NULL;
ssize_t headerLen;
- int ret = -1;
int rv;
VIR_AUTOFREE(char *) buf = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) tmp = NULL;
*backing = NULL;
@@ -5032,17 +5012,11 @@ virStorageFileGetBackingStoreStr(virStorageSourcePtr src,
}
if (!(tmp = virStorageSourceCopy(src, false)))
- goto cleanup;
+ return -1;
if (virStorageFileGetMetadataInternal(tmp, buf, headerLen, NULL) < 0)
- goto cleanup;
+ return -1;
VIR_STEAL_PTR(*backing, tmp->backingStoreRaw);
-
- ret = 0;
-
- cleanup:
- virObjectUnref(tmp);
-
- return ret;
+ return 0;
}
--
2.20.1
5 years, 8 months
[libvirt] [PATCH v2 0/7] fix snapshot --redefine bugs (incremental backup saga)
by Eric Blake
John pointed out that patch 2 of my original bug fix did too
much in one patch. Now that we are in freeze for 5.1, I've
proposed two variants of the same fix: patch 1 is the bare
minimum to fix the bug and nothing else, while patches 3-7
are more in line with my v1 patch at doing other refactoring
work along the way (but now split into multiple logical steps)
that will prove useful for my other pending snapshot improvements
(https://www.redhat.com/archives/libvir-list/2019-February/msg01350.html,
but now 5.2 material).
I'm proposing both variants for comparison, although I already
suspect the answer will be 'use patch 1 for 5.1, then rebase
what remains of patches 3-7 into the other snapshot cleanups
for 5.2'.
variant2 is cleaner than my v1 patch 2/2 in that I no longer have
to use a default: label to hack around gcc's enum sanity checking
within a switch statement, but it required introducing a large
mechanical rename of all use of snapshot state values.
Eric Blake (7):
qemu: Fix snapshot redefine vs. domain state bug
Revert "qemu: Fix snapshot redefine vs. domain state bug"
qemu: Refactor check for _LIVE vs. _REDEFINE
qemu: Factor out qemuDomainSnapshotValidate() helper
snapshot: Rework virDomainSnapshotState enum
qemu: Use virDomainSnapshotState for switch statements
qemu: Fix snapshot redefine vs. domain state bug
src/conf/snapshot_conf.h | 21 ++++-
src/conf/snapshot_conf.c | 28 +++----
src/qemu/qemu_driver.c | 160 +++++++++++++++++++++++----------------
src/test/test_driver.c | 20 ++---
src/vbox/vbox_common.c | 4 +-
5 files changed, 137 insertions(+), 96 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] xml: nodedev: add class info for pci capability
by Nikolay Shirokovskiy
This info can be useful to filter devices visible
to mgmt clients so that they won't see devices that
unsafe/not meaningful to pass thru.
Provide class info the way it is provided by udev or
kernel that is as single 6-digit hexadecimal.
Class element is not optional. I guess this should not
break users that use virNodeDeviceCreateXML because
they probably specify only scsi_host capability on
input and then node device driver gets other capabilities
from udev after device appeared.
HAL driver does not get support for the new element in
this patch.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
docs/formatnode.html.in | 5 +++++
docs/schemas/nodedev.rng | 5 +++++
src/conf/node_device_conf.c | 13 +++++++++++++
tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml | 1 +
tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml | 1 +
tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml | 1 +
tests/nodedevschemadata/pci_0000_02_10_7_sriov.xml | 1 +
.../nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml | 1 +
.../pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml | 1 +
tests/nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml | 1 +
.../pci_0000_02_10_7_sriov_zero_vfs_max_count.xml | 1 +
tests/nodedevschemadata/pci_1002_71c4.xml | 1 +
tests/nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml | 1 +
tests/nodedevschemadata/pci_8086_10c9_sriov_pf.xml | 1 +
tests/nodedevschemadata/pci_8086_4238_pcie_wireless.xml | 1 +
tests/nodedevschemadata/pci_82579LM_network_adapter.xml | 1 +
16 files changed, 36 insertions(+)
diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in
index 29244a8..b72d7db 100644
--- a/docs/formatnode.html.in
+++ b/docs/formatnode.html.in
@@ -70,6 +70,10 @@
<dd>Describes a device on the host's PCI bus. Sub-elements
include:
<dl>
+ <dt><code>class</code></dt>
+ <dd>Combined class, subclass and
+ programming interface codes as 6-digit hexadecimal number.
+ <span class="since">Since 5.1.0</span></dd>
<dt><code>domain</code></dt>
<dd>Which domain the device belongs to.</dd>
<dt><code>bus</code></dt>
@@ -381,6 +385,7 @@
<name>igb</name>
</driver>
<capability type='pci'>
+ <class>0x020000</class>
<domain>0</domain>
<bus>2</bus>
<slot>0</slot>
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index 0498489..0f45d79 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -133,6 +133,11 @@
<value>pci</value>
</attribute>
+ <element name='class'>
+ <data type="string">
+ <param name="pattern">0x[0-9a-fA-F]{6}</param>
+ </data>
+ </element>
<element name='domain'>
<ref name='unsignedLong'/>
</element>
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 1b1f57d..d2f5183 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -208,6 +208,7 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf,
{
size_t i;
+ virBufferAsprintf(buf, "<class>0x%.6x</class>\n", data->pci_dev.class);
virBufferAsprintf(buf, "<domain>%d</domain>\n",
data->pci_dev.domain);
virBufferAsprintf(buf, "<bus>%d</bus>\n", data->pci_dev.bus);
@@ -1644,6 +1645,18 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
orignode = ctxt->node;
ctxt->node = node;
+ if (virNodeDevCapsDefParseHexId("string(./class[1])", ctxt,
+ &pci_dev->class, def,
+ _("no PCI class supplied for '%s'"),
+ _("invalid PCI class supplied for '%s'")) < 0)
+ goto out;
+
+ if (pci_dev->class > 0xFFFFFF) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("invalid PCI class supplied for '%s'"), def->name);
+ goto out;
+ }
+
if (virNodeDevCapsDefParseULong("number(./domain[1])", ctxt,
&pci_dev->domain, def,
_("no PCI domain ID supplied for '%s'"),
diff --git a/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml b/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml
index 5150fd1..387fce7 100644
--- a/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml
+++ b/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml
@@ -2,6 +2,7 @@
<name>pci_0000_00_02_0</name>
<parent>computer</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>0</bus>
<slot>2</slot>
diff --git a/tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml b/tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml
index c1be9f7..b07d14f 100644
--- a/tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml
+++ b/tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml
@@ -2,6 +2,7 @@
<name>pci_0000_00_1c_0</name>
<parent>computer</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>0</bus>
<slot>28</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml b/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml
index a2d5756..8e71e3f 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_sriov.xml b/tests/nodedevschemadata/pci_0000_02_10_7_sriov.xml
index 8f243b4..6fa2b40 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_sriov.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_sriov.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml
index 9e8dace..74036a6 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml
index 4e6323a..c30c0d0 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml
index 355eaaa..096055e 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_zero_vfs_max_count.xml b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_zero_vfs_max_count.xml
index e9eb122..8259cd0 100644
--- a/tests/nodedevschemadata/pci_0000_02_10_7_sriov_zero_vfs_max_count.xml
+++ b/tests/nodedevschemadata/pci_0000_02_10_7_sriov_zero_vfs_max_count.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_10_7</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>16</slot>
diff --git a/tests/nodedevschemadata/pci_1002_71c4.xml b/tests/nodedevschemadata/pci_1002_71c4.xml
index 6d5d85b..2039e22 100644
--- a/tests/nodedevschemadata/pci_1002_71c4.xml
+++ b/tests/nodedevschemadata/pci_1002_71c4.xml
@@ -2,6 +2,7 @@
<name>pci_1002_71c4</name>
<parent>pci_8086_27a1</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>1</bus>
<slot>0</slot>
diff --git a/tests/nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml b/tests/nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml
index 8e89900..3ffe53b 100644
--- a/tests/nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml
+++ b/tests/nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml
@@ -2,6 +2,7 @@
<name>pci_0000_00_03_0</name>
<parent>computer</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>0</bus>
<slot>3</slot>
diff --git a/tests/nodedevschemadata/pci_8086_10c9_sriov_pf.xml b/tests/nodedevschemadata/pci_8086_10c9_sriov_pf.xml
index 6e1dc86..6bd1292 100644
--- a/tests/nodedevschemadata/pci_8086_10c9_sriov_pf.xml
+++ b/tests/nodedevschemadata/pci_8086_10c9_sriov_pf.xml
@@ -2,6 +2,7 @@
<name>pci_0000_02_00_0</name>
<parent>pci_0000_00_04_0</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>2</bus>
<slot>0</slot>
diff --git a/tests/nodedevschemadata/pci_8086_4238_pcie_wireless.xml b/tests/nodedevschemadata/pci_8086_4238_pcie_wireless.xml
index 18172e9..59f5ec8 100644
--- a/tests/nodedevschemadata/pci_8086_4238_pcie_wireless.xml
+++ b/tests/nodedevschemadata/pci_8086_4238_pcie_wireless.xml
@@ -2,6 +2,7 @@
<name>pci_0000_03_00_0</name>
<parent>pci_0000_00_1c_1</parent>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>3</bus>
<slot>0</slot>
diff --git a/tests/nodedevschemadata/pci_82579LM_network_adapter.xml b/tests/nodedevschemadata/pci_82579LM_network_adapter.xml
index 6e154d6..96a4c51 100644
--- a/tests/nodedevschemadata/pci_82579LM_network_adapter.xml
+++ b/tests/nodedevschemadata/pci_82579LM_network_adapter.xml
@@ -5,6 +5,7 @@
<name>e1000e</name>
</driver>
<capability type='pci'>
+ <class>0xffffff</class>
<domain>0</domain>
<bus>0</bus>
<slot>25</slot>
--
1.8.3.1
5 years, 8 months