[libvirt] [PATCH 0/9] qemu: Reflect USB controller model in guest XML
by Andrea Bolognani
Patches 1-3 take care of some tiny nits; patches 4-7 clean
up the test suite and add some new test cases that cover
the code changed by subsequent patches.
Patch 8 implements the feature advertised in the subject :)
Patch 9 gets rid of some code that's no longer necessary
after the changes.
Andrea Bolognani (9):
tests: qemuxml2argv: Remove useless GIC flags
tests: qemuxml2argv: Fix usb-too-long-port-path-invalid
tests: qemuxml2xml: Fix disk-mirror
tests: qemuxml2xml: Use WHEN_BOTH for most tests
tests: qemuxml2xml: Pass capabilities to DO_TEST()
tests: qemuxml2xml: Use DO_TEST() for most tests
tests: qemuxml2xml: Add some USB test cases
qemu: domain: Reflect USB controller model in guest XML
qemu: command: Simplify USB controller model selection
src/qemu/qemu_command.c | 60 +-
src/qemu/qemu_domain.c | 20 +
tests/qemuxml2argvtest.c | 16 +-
.../qemuxml2xmlout-ppc64-usb-controller-legacy.xml | 31 +
.../qemuxml2xmlout-ppc64-usb-controller.xml | 31 +
.../qemuxml2xmlout-usb-controller-default-q35.xml | 37 +
.../qemuxml2xmlout-usb-controller-explicit-q35.xml | 37 +
.../qemuxml2xmlout-usb-controller.xml | 27 +
.../qemuxml2xmloutdata/qemuxml2xmlout-usb-none.xml | 25 +
.../qemuxml2xmlout-usb-piix3-controller.xml | 27 +
tests/qemuxml2xmltest.c | 932 ++++++++++-----------
11 files changed, 728 insertions(+), 515 deletions(-)
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-controller-default-q35.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-controller-explicit-q35.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-controller.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-none.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-piix3-controller.xml
--
2.7.4
8 years, 3 months
[libvirt] [PATCH 0/2] Couple of virschematest fixes
by Michal Privoznik
It's true that rewriting this into C made this test run faster.
But maybe too much to my taste.
Michal Privoznik (2):
virschematest: Initialize @data
virschematest: Make sure that validator is initialized
tests/virschematest.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
--
2.8.4
8 years, 3 months
[libvirt] [PATCH v2] schema: Don't validate paths
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1353296
On UNIX like systems there are no constraints on what characters
can be in file/dir names (except for NULL, obviously). Moreover,
some values that we think of as paths (e.g. disk source) are not
necessarily paths at all. For instance, some hypervisors take
that as an arbitrary identifier and corresponding file is then
looked up by hypervisor in its table. Instead of trying to fix
our regular expressions (and forgetting to include yet another
character there), lets drop the validation completely.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
- Instead of adding some more chars to whitelist, drop it
docs/schemas/basictypes.rng | 8 ++---
.../domainschemadata/domain-disk-source-space.xml | 36 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 4 deletions(-)
create mode 100644 tests/domainschemadata/domain-disk-source-space.xml
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 474ad77..1b4f980 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -247,25 +247,25 @@
<define name="filePath">
<data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param>
+ <param name="pattern">.+</param>
</data>
</define>
<define name="dirPath">
<data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param>
+ <param name="pattern">.+</param>
</data>
</define>
<define name="absFilePath">
<data type="string">
- <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param>
+ <param name="pattern">/.+</param>
</data>
</define>
<define name="absDirPath">
<data type="string">
- <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%]*</param>
+ <param name="pattern">/.*</param>
</data>
</define>
diff --git a/tests/domainschemadata/domain-disk-source-space.xml b/tests/domainschemadata/domain-disk-source-space.xml
new file mode 100644
index 0000000..553b6c7
--- /dev/null
+++ b/tests/domainschemadata/domain-disk-source-space.xml
@@ -0,0 +1,36 @@
+<domain type='kvm'>
+ <name>dummy</name>
+ <uuid>aa86471a-e67b-41b1-8d7d-2dc37c2ac5ec</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source file='/a/path/with some space in it.iso'/>
+ <target dev='hda' bus='ide'/>
+ <readonly/>
+ <boot order='1'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ </devices>
+</domain>
--
2.8.4
8 years, 3 months
[libvirt] [PATCH] conf: Fix initialization value of 'multi' in PCI address
by Xian Han Yu
Signed-off-by: Xian Han Yu <xhyubj(a)linux.vnet.ibm.com>
---
src/conf/node_device_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index a23d8ef..96fdb6f 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1163,7 +1163,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
goto cleanup;
for (i = 0; i < nAddrNodes; i++) {
- virPCIDeviceAddress addr = { 0, 0, 0, 0, 0 };
+ virPCIDeviceAddress addr = { 0, 0, 0, 0, false };
if (virPCIDeviceAddressParseXML(addrNodes[i], &addr) < 0)
goto cleanup;
if (VIR_ALLOC(pciAddr) < 0)
--
2.5.5
8 years, 3 months
[libvirt] [PATCH] schema: Allow spaces in paths
by Michal Privoznik
Since ages filesystems allowed to have space characters in
filenames and even directory names. In fact, on all major
filesystems out there you can have whatever character you like
except NULL. There's no reason why we should forbid users to not
have spaces in their filenames. Moreover, if we do that only on
RNG schema level while our XML parser/formatter crunches that
happily.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/schemas/basictypes.rng | 8 ++---
.../domainschemadata/domain-disk-source-space.xml | 36 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 4 deletions(-)
create mode 100644 tests/domainschemadata/domain-disk-source-space.xml
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 474ad77..f2b7930 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -247,25 +247,25 @@
<define name="filePath">
<data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param>
+ <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/% ]+</param>
</data>
</define>
<define name="dirPath">
<data type="string">
- <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param>
+ <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/% ]+</param>
</data>
</define>
<define name="absFilePath">
<data type="string">
- <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param>
+ <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,: ]+</param>
</data>
</define>
<define name="absDirPath">
<data type="string">
- <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%]*</param>
+ <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/% ]*</param>
</data>
</define>
diff --git a/tests/domainschemadata/domain-disk-source-space.xml b/tests/domainschemadata/domain-disk-source-space.xml
new file mode 100644
index 0000000..553b6c7
--- /dev/null
+++ b/tests/domainschemadata/domain-disk-source-space.xml
@@ -0,0 +1,36 @@
+<domain type='kvm'>
+ <name>dummy</name>
+ <uuid>aa86471a-e67b-41b1-8d7d-2dc37c2ac5ec</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source file='/a/path/with some space in it.iso'/>
+ <target dev='hda' bus='ide'/>
+ <readonly/>
+ <boot order='1'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ </devices>
+</domain>
--
2.8.4
8 years, 3 months
[libvirt] [PATCH 0/5] Introduce NVDIMM support
by Michal Privoznik
NVDIMM was introduced to qemu in v2.6.0-rc0~248^2~25. So it's
been a while since then.
It's not the next big thing, but it is very interesting feature
enabling higher performance as reading/writing to the module (and
subsequently to the file on the host) does not require a VMEXIT.
It can be used to access host files directly bypassing page cache
whilst doing so.
How to test the feature?
1) you need PMEM enabled kernel:
CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=m
CONFIG_ACPI_NFIT=m
2) Create a file in the host:
truncate -s 512M /tmp/nvdimm
3) Add the following to the domain XML:
<memory model='nvdimm' memAccess='shared'>
<source>
<path>/tmp/nvdimm</path>
</source>
<target>
<size unit='KiB'>523264</size>
<node>0</node>
</target>
</memory>
4) Start the domain and write something into the NVDIMM module:
(guest) $ echo 'Hello world' > /dev/pmem0
5) From the host, check the file has changed:
(host) $ hexdump -C /tmp/nvdimm
Want to watch very interesting video while reviewing?
https://youtu.be/Vit3-PjbN9M
Michal Privoznik (5):
Introduce NVDIMM memory model
qemu: Introduce QEMU_CAPS_DEVICE_NVDIMM
qemu: Implement NVDIMM
conf: Introduce memAccess to <memory/>
qemu: Implement memAccess for <memory/> banks
docs/formatdomain.html.in | 41 ++++++--
docs/schemas/domaincommon.rng | 51 ++++++----
src/conf/domain_conf.c | 112 ++++++++++++++++-----
src/conf/domain_conf.h | 4 +
src/libvirt_private.syms | 2 +
src/qemu/qemu_alias.c | 12 ++-
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 87 +++++++++++-----
src/qemu/qemu_command.h | 2 +
src/qemu/qemu_domain.c | 29 ++++--
src/qemu/qemu_hotplug.c | 3 +-
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
.../qemuxml2argv-hugepages-numa.args | 5 +-
.../qemuxml2argv-hugepages-pages.args | 24 ++---
.../qemuxml2argv-hugepages-pages2.args | 8 +-
.../qemuxml2argv-hugepages-pages3.args | 4 +-
.../qemuxml2argv-hugepages-shared.args | 22 ++--
.../qemuxml2argv-memory-hotplug-dimm-addr.args | 5 +-
.../qemuxml2argv-memory-hotplug-dimm.args | 5 +-
...muxml2argv-memory-hotplug-nvdimm-memAccess.args | 26 +++++
...emuxml2argv-memory-hotplug-nvdimm-memAccess.xml | 49 +++++++++
.../qemuxml2argv-memory-hotplug-nvdimm.args | 25 +++++
.../qemuxml2argv-memory-hotplug-nvdimm.xml | 49 +++++++++
tests/qemuxml2argvtest.c | 6 +-
25 files changed, 452 insertions(+), 123 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-memAccess.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-memAccess.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.xml
--
2.8.4
8 years, 3 months
[libvirt] Failing build on rawhide
by Martin Kletzander
So after updating my fedora-rawhide machines, I started receiving an
interesting error:
In file included from /usr/include/features.h:397:0,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:28,
from ../gnulib/lib/stdio.h:43,
from util/vircgroup.c:26:
/usr/include/sys/sysmacros.h:88:1: note: declared here
__SYSMACROS_DEFINE_MINOR (__SYSMACROS_FST_IMPL_TEMPL)
^
util/vircgroup.c: In function 'virCgroupAllowDevicePath':
util/vircgroup.c:2944:33: error: '__major_from_sys_types' is deprecated:
In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
For historical compatibility, it is currently defined by
<sys/types.h> as well, but we plan to remove this soon.
To use `major', include <sys/sysmacros.h> directly.
If you did not intend to use a system-defined macro `major',
you should #undef it after including <sys/types.h>.
[-Werror=deprecated-declarations]
major(sb.st_rdev),
^~~~~
It looks like we might need to reorder the includes, but whatever I do,
I still get the warning. Updating gnulib doesn't help, so either we
need to #undef minor/major/makedev, or maybe gnulib needs to fix that
(my guess inspired by the include stack above).
So I figured I just post my findings here and let others continue the
wondering so that I can do some more useful stuff.
Have a nice day,
Martin
8 years, 3 months
[libvirt] [PATCHv2 00/11] qemu: allow disabling certain virtio revisions
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1227354
v1: https://www.redhat.com/archives/libvir-list/2016-July/msg01235.html
v2:
* probe for the qemu capability
* add the attribute to virtio1-only devices such as virtio-gpu
and virtio-input devices
* allow multiple revisions to be specified
Ján Tomko (11):
Use separate buffer for <input> subelements
Add virtio revision attribute to memballoon
Add virtio revision attribute to disks
Add virtio revision attribute to controllers
Add virtio revision attribute to filesystems
Add virtio revision attribute to interfaces
Add virtio revision to rng devices
Add virtio revision attribute to video
Add virtio revision attribute to input devices
Introduce QEMU_CAPS_DEVICE_VIRTIO_REVISION
qemu: format options for enforcing virtio revisions
docs/formatdomain.html.in | 69 ++++++++++
docs/schemas/domaincommon.rng | 37 ++++++
src/conf/domain_conf.c | 148 +++++++++++++++++++--
src/conf/domain_conf.h | 16 +++
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 56 ++++++++
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
.../qemuxml2argv-virtio-revision.args | 62 +++++++++
.../qemuxml2argv-virtio-revision.xml | 113 ++++++++++++++++
tests/qemuxml2argvtest.c | 11 ++
.../qemuxml2xmlout-virtio-revision.xml | 113 ++++++++++++++++
tests/qemuxml2xmltest.c | 2 +
19 files changed, 630 insertions(+), 11 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml
--
2.7.3
8 years, 3 months
[libvirt] [PATCH 0/6] Use more PCIe, less legacy PCI slots
by Laine Stump
These patches use three methods to get more of the PCI devices onto PCIe
slots on Q35 and aarch64/virt machinetypes:
1) When virtio devices can present themselves as PCIe if they're
plugged into a PCIe controller, do that. (This capability is
detected by looking for presence of the "disable-modern" option on
the virtio-net device. If you have a better idea for how to detect
it, please let me know.)
2) Any devices that aren't hotpluggable anyway will no longer request
a hotplug-capable slot. This, along with a change to auto-assign
legacy PCI devices to pcie-root (as long as they don't require
hotplug) means the devices will now be assigned to pcie-root.
3) Also using the fact that devices that won't be hotplugged can be
assigned to pcie-root, the devices that *do* support hotplug have a
new optional subelement "<hotplug require='no'/>" (it defaults to
"yes" for historical reasons). If hotplug require is set to 'no',
even a PCI device can be auto-assigned to pcie-root.
I haven't yet removed the dmi-to-pci-bridge that is added by default,
and we still will only auto-add pci-bridge (so if you're adding a
virtio device without <hostplug require='no'/> then you will also need
to add a <controller type='pci' model='pcie-root-port'/> to plug it
into).
These 6 patches together resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=1330024
They need to be applied on top of the series I sent on Friday:
https://www.redhat.com/archives/libvir-list/2016-August/msg00380.html
Laine Stump (6):
conf: restrict what type of buses will accept a pci-bridge
conf: permit auto-assignment of *non-hotpluggable* PCI devices to
pcie-root
qemu: add capabilities bit for virtio-net "disable-modern" option
conf: new <hotplug require='yes|no'/> element for hotpluggable devices
qemu: don't require a hotpluggable slot for devices that can't be
hotplugged
qemu: auto-assign virtio devices to PCIe slots when appropriate
docs/formatdomain.html.in | 37 +++++++
docs/schemas/domaincommon.rng | 17 +++
src/conf/device_conf.h | 15 +++
src/conf/domain_addr.c | 44 ++++++--
src/conf/domain_addr.h | 4 +-
src/conf/domain_conf.c | 28 +++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain_address.c | 94 ++++++++++++++--
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-autoindex.args | 22 ++--
.../qemuxml2argv-bios-nvram-secure.args | 2 +-
.../qemuxml2argv-machine-smm-opt.args | 2 +-
.../qemuxml2argv-q35-hotpluggable.args | 50 +++++++++
.../qemuxml2argv-q35-hotpluggable.xml | 62 +++++++++++
.../qemuxml2argv-q35-pm-disable-fallback.args | 3 +-
.../qemuxml2argv-q35-pm-disable.args | 3 +-
.../qemuxml2argv-q35-usb2-multi.args | 10 +-
.../qemuxml2argv-q35-usb2-reorder.args | 10 +-
.../qemuxml2argv-q35-virtio-pcie.args | 54 +++++++++
.../qemuxml2argv-q35-virtio-pcie.xml | 69 ++++++++++++
tests/qemuxml2argvtest.c | 18 +++
.../qemuxml2xmlout-autoindex.xml | 18 +--
.../qemuxml2xmlout-q35-hotpluggable.xml | 103 +++++++++++++++++
.../qemuxml2xmlout-q35-usb2-multi.xml | 8 +-
.../qemuxml2xmlout-q35-usb2-reorder.xml | 8 +-
.../qemuxml2xmlout-q35-virtio-pcie.xml | 123 +++++++++++++++++++++
tests/qemuxml2xmltest.c | 15 +++
34 files changed, 765 insertions(+), 64 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pcie.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pcie.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-hotpluggable.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pcie.xml
--
2.7.4
8 years, 3 months