[libvirt] [PATCH v3 0/3] qemu: Support vhost-vsock-ccw
by Boris Fiuczynski
Support the vhost-vsock-ccw device on S390.
Since v2
- instead of reusing CAPS_LATEST adding CAPS_ARCH_LATEST (Peter Krempa)
Since v1
- adjusted vsock command line generation (Ján Tomko)
- added CAPS_LATEST test coverage to s390 (Ján Tomko)
- adjusted new vsock tests to use CAPS_LATEST
Bjoern Walk (1):
tests: qemuxml2argv: add CAPS_ARCH_LATEST macro
Boris Fiuczynski (2):
qemu: Add ccw support for vhost-vsock
news: Update for vhost-vsock-ccw support
docs/news.xml | 8 +++++
src/qemu/qemu_command.c | 8 +++--
src/qemu/qemu_domain.c | 10 ++++--
src/qemu/qemu_domain_address.c | 7 +++-
.../vhost-vsock-ccw-auto.s390x-latest.args | 32 ++++++++++++++++++
.../qemuxml2argvdata/vhost-vsock-ccw-auto.xml | 25 ++++++++++++++
.../vhost-vsock-ccw.s390x-latest.args | 32 ++++++++++++++++++
tests/qemuxml2argvdata/vhost-vsock-ccw.xml | 32 ++++++++++++++++++
tests/qemuxml2argvtest.c | 33 ++++++++++++++-----
.../vhost-vsock-ccw-auto.xml | 32 ++++++++++++++++++
tests/qemuxml2xmloutdata/vhost-vsock-ccw.xml | 1 +
tests/qemuxml2xmltest.c | 5 +++
12 files changed, 212 insertions(+), 13 deletions(-)
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw-auto.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw-auto.xml
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/vhost-vsock-ccw-auto.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-vsock-ccw.xml
--
2.17.0
6 years, 2 months
[libvirt] [PATCH v2 00/35] use GNU C's cleanup attribute in src/util (batch III)
by Sukrit Bhatnagar
This third series of patches also modifies a few files in src/util
to use VIR_AUTOFREE and VIR_AUTOPTR for automatic freeing of memory
and get rid of some VIR_FREE macro invocations and *Free function
calls.
Sukrit Bhatnagar (35):
util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: iscsi: use VIR_AUTOPTR for aggregate types
util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netlink: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netlink: use VIR_AUTOPTR for aggregate types
util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: netdevbridge: use VIR_AUTOPTR for aggregate types
util: macaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdev: use VIR_AUTOPTR for aggregate types
util: socketaddr: define cleanup function using
VIR_DEFINE_AUTOPTR_FUNC
util: socketaddr: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: socketaddr: use VIR_AUTOPTR for aggregate types
util: netdevip: define virNetDevIPAddrFree for use with cleanup macros
util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdevip: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdevip: use VIR_AUTOPTR for aggregate types
util: netdevmacvlan: define cleanup function using
VIR_DEFINE_AUTOPTR_FUNC
util: netdevmacvlan: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: netdevmacvlan: use VIR_AUTOPTR for aggregate types
util: netdevopenvswitch: use VIR_AUTOFREE instead of VIR_FREE for
scalar types
util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types
util: netdevtap: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdevveth: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: netdevveth: use VIR_AUTOPTR for aggregate types
util: numa: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: numa: use VIR_AUTOPTR for aggregate types
util: perf: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: perf: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: pidfile: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: process: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: process: use VIR_AUTOPTR for aggregate types
util: qemu: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: qemu: use VIR_AUTOPTR for aggregate types
src/util/viriscsi.c | 140 ++++------
src/util/virmacaddr.c | 6 +
src/util/virmacaddr.h | 4 +
src/util/virnetdev.c | 604 ++++++++++++++++------------------------
src/util/virnetdev.h | 4 +
src/util/virnetdevbridge.c | 81 ++----
src/util/virnetdevip.c | 227 ++++++---------
src/util/virnetdevip.h | 5 +
src/util/virnetdevmacvlan.c | 22 +-
src/util/virnetdevopenvswitch.c | 98 +++----
src/util/virnetdevtap.c | 11 +-
src/util/virnetdevveth.c | 32 +--
src/util/virnetlink.c | 118 ++++----
src/util/virnetlink.h | 5 +
src/util/virnuma.c | 103 +++----
src/util/virperf.c | 20 +-
src/util/virperf.h | 8 +-
src/util/virpidfile.c | 186 ++++---------
src/util/virprocess.c | 58 ++--
src/util/virqemu.c | 31 +--
src/util/virsocketaddr.c | 113 ++++----
src/util/virsocketaddr.h | 9 +-
22 files changed, 730 insertions(+), 1155 deletions(-)
--
1.8.3.1
6 years, 2 months
Re: [libvirt] [PATCH 0/3] sample: vfio mdev display devices.
by Alex Williamson
On Mon, 9 Apr 2018 12:35:10 +0200
Gerd Hoffmann <kraxel(a)redhat.com> wrote:
> This little series adds three drivers, for demo-ing and testing vfio
> display interface code. There is one mdev device for each interface
> type (mdpy.ko for region and mbochs.ko for dmabuf).
Erik Skultety brought up a good question today regarding how libvirt is
meant to handle these different flavors of display interfaces and
knowing whether a given mdev device has display support at all. It
seems that we cannot simply use the default display=auto because
libvirt needs to specifically configure gl support for a dmabuf type
interface versus not having such a requirement for a region interface,
perhaps even removing the emulated graphics in some cases (though I
don't think we have boot graphics through either solution yet).
Additionally, GVT-g seems to need the x-igd-opregion support
enabled(?), which is a non-starter for libvirt as it's an experimental
option!
Currently the only way to determine display support is through the
VFIO_DEVICE_QUERY_GFX_PLANE ioctl, but for libvirt to probe that on
their own they'd need to get to the point where they could open the
vfio device and perform the ioctl. That means opening a vfio
container, adding the group, setting the iommu type, and getting the
device. I was initially a bit appalled at asking libvirt to do that,
but the alternative is to put this information in sysfs, but doing that
we risk that we need to describe every nuance of the mdev device
through sysfs and it becomes a dumping ground for every possible
feature an mdev device might have.
So I was ready to return and suggest that maybe libvirt should probe
the device to know about these ancillary configuration details, but
then I remembered that both mdev vGPU vendors had external dependencies
to even allow probing the device. KVMGT will fail to open the device
if it's not associated with an instance of KVM and NVIDIA vGPU, I
believe, will fail if the vGPU manager process cannot find the QEMU
instance to extract the VM UUID. (Both of these were bad ideas)
Therefore, how can libvirt know if a given mdev device supports a
display and which type of display it supports, and potentially which
vendor specific options might be required to further enable that
display (if they weren't experimental)? A terrible solution would be
that libvirt hard codes that NVIDIA works with regions and Intel works
with dmabufs, but even then there's a backwards and forwards
compatibility problem, that libvirt needs to support older kernels and
drivers where display support is not present and newer drivers where
perhaps Intel is now doing regions and NVIDIA is supporting dmabuf, so
it cannot simply be assumed based on the vendor. The only solution I see
down that path would be identifying specific {vendor,type} pairs that
support a predefined display type, but that's just absurd to think that
vendors would rev their mdev types to expose this and that libvirt
would keep a database mapping types to features. We also have the name
and description attributes, but these are currently free form, so
libvirt rightfully ignores them entirely. I don't know if we could
create a defined feature string within those free form strings.
Otherwise, it seems we have no choice but to dive into the pool of
exposing such features via sysfs and we'll need to be vigilant of
feature creep or vendor specific features (ex. we're not adding a
feature to indicate an opregion requirement). How should we do this?
Perhaps a bar we can set is that if a feature cannot be discovered
through a standard vfio API, then it is not suitable for this sysfs
API. Such things can be described via our existing mdev vendor
specific attribute interface.
We currently have this sysfs interface:
mdev_supported_types/
|-- $VENDOR_TYPE
| |-- available_instances
| |-- create
| |-- description
| |-- device_api
| |-- devices
| `-- name
ioctls for vfio devices which only provide information include:
VFIO_DEVICE_GET_INFO
VFIO_DEVICE_GET_REGION_INFO
VFIO_DEVICE_GET_IRQ_INFO
VFIO_DEVICE_GET_PCI_HOT_RESET_INFO
VFIO_DEVICE_QUERY_GFX_PLANE
We don't need to support all of these initially, but here's a starting
idea for what this may look like in sysfs:
$VENDOR_TYPE/
|-- available_instances
|-- create
|-- description
|-- device_api
|-- devices
|-- name
`-- vfio-pci
`-- device
|-- gfx_plane
| |-- dmabuf
| `-- region
|-- irqs
| |-- 0
| | |-- count
| | `-- flags
| `-- 1
| |-- count
| `-- flags
`-- regions
|-- 0
| |-- flags
| |-- offset
| `-- size
`-- 3
|-- flags
|-- offset
`-- size
The existing device_api file reports "vfio-pci", so we base the device
API info in a directory named vfio-pci. We're specifically exposing
device information, so we have a device directory. We have a GFX_PLANE
query ioctl, so we have a gfx_plane sub-directory. I imagine the
dmabuf and region files here expose either Y/N or 1/0. I continue on
the example with how we might expose irqs and regions, but even with
regions we can bury down into how is sparse mmap exposed, how are
device specific regions described, etc. Filling this in to completion
without a specific userspace need to expose the information is just an
exercise in bloating the kernel.
That almost begins to look reasonable, but then we can only expose this
for mdev devices, what if we were to hack a back door into a directly
assigned GPU that tracks the location of active display in the
framebuffer and implement the GFX_PLANE interface for that? We have no
sysfs representation for either the template or the actual device for
anything other than mdev. This inconsistency with physically assigned
devices has been one of my arguments against enhancing mdev sysfs.
Thanks to anyone still reading this. Ideas how we might help libvirt
fill this information void so that they can actually configure a VM
with a display device? Thanks,
Alex
6 years, 2 months
[libvirt] [PATCH] qemu: ensure "pc" machine is always used as default if available
by Daniel P. Berrangé
It is increasingly likely that some distro is going to change the
default "x86" machine type in QEMU from "pc" to "q35". This will
certainly break existing applications which write their XML on the
assumption that its using a "pc" machine by default. For example they'll
lack a IDE CDROM and get PCI-X instad of PCI which changes the topology
radically.
Libvirt promises to isolate applications from hypervisor changes that
may cause incompatibilities, so we must ensure that we always use the
"pc" machine type if it is available. Only use QEMU's own reported
default machine type if "pc" does not exist.
Note this change assumes there will always be a "pc" alias as long as a
versioned "pc-XXX" machine type exists. If QEMU were to ship a "pc-XXX"
machine type but not provide the "pc" alias, it is too hard to decide
which to default so. Versioned machine types are supposed to be
considered opaque strings, so we can't apply any sensible ordering
ourselves and QEMU isn't reporting the list of machines in any sensible
ordering itself.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0fb800589a..9eb58afef3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2242,6 +2242,17 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
int ret = -1;
size_t i;
size_t defIdx = 0;
+ ssize_t preferredIdx = -1;
+ const char *preferredAlias = NULL;
+
+ /* Historically QEMU defaulted to 'pc' machine type but in
+ * future might switch 'q35'. Such a change is considered
+ * an ABI break from lbivirt's POV, so we must be sure to
+ * keep 'pc' as default machine no matter what QEMU says.
+ */
+ if (qemuCaps->arch == VIR_ARCH_X86_64 ||
+ qemuCaps->arch == VIR_ARCH_I686)
+ preferredAlias = "pc";
if ((nmachines = qemuMonitorGetMachines(mon, &machines)) < 0)
return -1;
@@ -2263,12 +2274,16 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
mach->maxCpus = machines[i]->maxCpus;
mach->hotplugCpus = machines[i]->hotplugCpus;
+ if (STREQ_NULLABLE(mach->alias, preferredAlias))
+ preferredIdx = qemuCaps->nmachineTypes - 1;
+
if (machines[i]->isDefault)
defIdx = qemuCaps->nmachineTypes - 1;
}
- if (defIdx)
- virQEMUCapsSetDefaultMachine(qemuCaps, defIdx);
+ if (preferredIdx == -1)
+ preferredIdx = defIdx;
+ virQEMUCapsSetDefaultMachine(qemuCaps, preferredIdx);
ret = 0;
--
2.17.1
6 years, 2 months
[libvirt] [PATCH libvirt v2 0/9] Fix virConnectRegisterCloseCallback and get rid of global variables
by Marc Hartmayer
The first part of this patch series fixes the behavior of
virConnectRegisterCloseCallback and converts the testDriver to
virObjectLockable.
The subsequent patches remove the need to have the global variables
'qemuProgram' and 'remoteProgram' in libvirtd.[ch]. They only work in
combination with the fixed behavior of virConnectRegisterCloseCallback.
Changelog:
+ v1->v2:
- Removed accepted patches
- Removed NACKed patches
- Added r-b to patch 5
- Worked in comments
- Rebased
- Added patches 7-9
Marc Hartmayer (9):
virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no
connectRegisterCloseCallback
test: Convert testDriver to virObjectLockable
remote: Add the information which program has to be used to
daemonClientEventCallback
remote: Use domainClientEventCallbacks for
remoteReplayConnectionClosedEvent
rpc: Introduce virNetServerGetProgramLocked helper function
remote/rpc: Use virNetServerGetProgram() to determine the program
rpc: use the return value of virObjectRef directly
remote: remove ATTRIBUTE_UNUSED when attribute is actually used
remote: shrink the critical sections
src/libvirt-host.c | 10 +-
src/libvirt_remote.syms | 1 +
src/remote/remote_daemon.c | 4 +-
src/remote/remote_daemon.h | 3 -
src/remote/remote_daemon_dispatch.c | 264 +++++++++++++++++++++++-------------
src/rpc/gendispatch.pl | 6 +
src/rpc/virnetserver.c | 57 ++++++--
src/rpc/virnetserver.h | 2 +
src/test/test_driver.c | 200 ++++++++++++---------------
9 files changed, 328 insertions(+), 219 deletions(-)
--
2.13.4
6 years, 2 months
[libvirt] [PATCH v1 00/32] use GNU C's cleanup attribute in src/util (batch III)
by Sukrit Bhatnagar
This third series of patches also modifies a few files in src/util
to use VIR_AUTOFREE and VIR_AUTOPTR for automatic freeing of memory
and get rid of some VIR_FREE macro invocations and *Free function
calls.
Sukrit Bhatnagar (32):
util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: iscsi: use VIR_AUTOPTR for aggregate types
util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: macaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdev: use VIR_AUTOPTR for aggregate types
util: socketaddr: define cleanup function using
VIR_DEFINE_AUTOPTR_FUNC
util: socketaddr: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: socketaddr: use VIR_AUTOPTR for aggregate types
util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netdevip: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdevip: use VIR_AUTOPTR for aggregate types
util: netdevmacvlan: define cleanup function using
VIR_DEFINE_AUTOPTR_FUNC
util: netdevmacvlan: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: netdevmacvlan: use VIR_AUTOPTR for aggregate types
util: netdevopenvswitch: use VIR_AUTOFREE instead of VIR_FREE for
scalar types
util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types
util: netdevtap: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: netdevveth: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: netdevveth: use VIR_AUTOPTR for aggregate types
util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: netlink: use VIR_AUTOPTR for aggregate types
util: numa: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: numa: use VIR_AUTOPTR for aggregate types
util: perf: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: perf: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: pidfile: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: process: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: process: use VIR_AUTOPTR for aggregate types
util: qemu: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: qemu: use VIR_AUTOPTR for aggregate types
src/util/viriscsi.c | 99 ++++------
src/util/virmacaddr.c | 6 +
src/util/virmacaddr.h | 4 +
src/util/virnetdev.c | 412 +++++++++++++++-------------------------
src/util/virnetdev.h | 4 +
src/util/virnetdevbridge.c | 45 ++---
src/util/virnetdevip.c | 157 ++++++---------
src/util/virnetdevip.h | 4 +
src/util/virnetdevmacvlan.c | 41 ++--
src/util/virnetdevopenvswitch.c | 131 +++++--------
src/util/virnetdevtap.c | 11 +-
src/util/virnetdevveth.c | 33 ++--
src/util/virnetlink.c | 62 +++---
src/util/virnuma.c | 107 ++++-------
src/util/virperf.c | 20 +-
src/util/virperf.h | 8 +-
src/util/virpidfile.c | 185 ++++++------------
src/util/virprocess.c | 68 +++----
src/util/virqemu.c | 50 ++---
src/util/virsocketaddr.c | 113 +++++------
src/util/virsocketaddr.h | 9 +-
21 files changed, 610 insertions(+), 959 deletions(-)
--
1.8.3.1
6 years, 2 months
[libvirt] [PATCH 00/55] qemu: Add support for -blockdev
by Peter Krempa
In this version everything except blockjobs should work properly.
Stats were fixed so that they are properly extracted from the new output
in qemu. Additionally I've also fixed the disk resize API which I forgot
last time.
The blockjobs support is still missing so they either will not work or
will mess up internal state. That means that the last patch still should
not be pushed leaving this feature dormant until we achieve full feature
parity.
Peter Krempa (55):
tests: qemumonitorjson: Simplify debugging of 'blockInfo' test
qemu: Improve errors in qemuDomainBlockResize
qemu: monitor: Remove unsupported function check for 'block_resize'
qemu: monitor: Remove useless 'locked' property from struct
qemuDomainDiskInfo
tests: qemucapabilities: Update capability data for qemu 3.0.0
Revert "qemu: monitor: Add the 'query-nodes' argument for
query-blockstats"
qemu: monitor: Reuse qemuMonitorJSONQueryBlock in
qemuMonitorJSONBlockIoThrottleInfo
qemu: monitor: Allow using 'id' instead of 'device' for
'block_set_io_throttle'
qemu: monitor: Allow using 'qdev' instead of 'device' for getting disk
throttling
qemu: monitor: Add 'nodename' argument for 'block_resize'
tests: qemu: Drop disk from hostdev-mdev tests
tests: qemuxml2argv: Fork CAPS_LATEST test cases for 'blockdev'
tests: qemu: Add test data for backing chains and indexes
qemu: hotplug: Don't generate alias when detaching disk
util: virqemu: Simplify debugging if building QOM object with missing
args
qemu: caps: Add capability for using the blockdev infrastructure
qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs where we can't support
it
qemu: domain: Don't redetect backing chain when using -blockdev
qemu: process: Don't detect nodenames when we support -blockdev
conf: domain: Format out user provided backing chains in XML
qemu: domain: Add infrastructure to generate block node names
conf: Implement private data formatting and parsing for disks
conf: Allow formatting and parsing of 'index' for disk source image
qemu: Use proper backingIndex when reporting stats for backing chain
qemu: Add field to store QDEV path of a disk in private data
qemu: alias: Generate QDEV name of the block backend for disks
qemu: domain: Add field for storing node name for copy-on-read
qemu: proces: assign node names for user defined backing chains
qemu: block: Add generator for the 'copy-on-read' blockdev driver
qemu: domain: Prepare qemuDomainDiskGetBackendAlias for -blockdev
qemu: command: format disk source commandline for -blockdev
qemu: command: Add helper to check if disk throttling is enabled
qemu: process: Setup disk io throttling for -blockdev
qemu: driver: Use QOM backend name for disk IO throttling APIs
qemu: driver: Prepare qemuDomainBlockResize for blockdev
qemu: hotplug: Prepare for blockdev-add/blockdev-del with backing
chains
qemu: monitor: Add APIs for cdrom tray handling for -blockdev
qemu: hotplug: Implement removable media change for -blockdev
qemu: driver: Don't copy disk alias in qemuDomainBlocksStatsGather
qemu: Explicitly find disks for stats totals
qemu: monitor: Retrieve blockstats also by qdev and node-names
qemu: monitor: Add APIs for refreshing disk capacity when using
-blockdev
qemu: driver: Don't pass 'virDomainDiskDefPtr' to
qemuDomainGetStatsOneBlock
qemu: monitor: Extract 'write-threshold' automatically for -blockdev
qemu: Extract exporting of disk block statistics
qemu: Extract exporting of the header for block stats
qemu: Export stats relevant for the frontend separately
qemu: Refactor control flow in qemuDomainGetStatsBlockExportDisk
qemu: Report frontend stats only for the frontend entry
qemu: Export stats relevant for the storage backend
qemu: monitor: Report data also for 'qdev' entry in
qemuMonitorJSONGetBlockInfo
qemu: Use QOM path with query-block when using -blockdev
qemu: driver: Allow using blockdev with qemuDomainBlocksStatsGather
qemu: driver: Prepare qemuDomainGetStatsBlock (bulk disk stats) for
-blockdev
DO NOT APPLY: Enable QEMU_CAPS_BLOCKDEV if 'query-blockstats' works
with -blockdev
docs/formatdomain.html.in | 7 +-
docs/schemas/domaincommon.rng | 19 +
src/conf/domain_conf.c | 89 +++-
src/conf/domain_conf.h | 7 +
src/qemu/qemu_alias.c | 86 ++-
src/qemu/qemu_alias.h | 3 +-
src/qemu/qemu_block.c | 24 +-
src/qemu/qemu_block.h | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 94 +++-
src/qemu/qemu_command.h | 3 +
src/qemu/qemu_domain.c | 173 +++++-
src/qemu/qemu_domain.h | 10 +-
src/qemu/qemu_driver.c | 419 +++++++++++----
src/qemu/qemu_hotplug.c | 175 +++++-
src/qemu/qemu_monitor.c | 98 +++-
src/qemu/qemu_monitor.h | 33 +-
src/qemu/qemu_monitor_json.c | 395 +++++++++++---
src/qemu/qemu_monitor_json.h | 33 +-
src/qemu/qemu_process.c | 82 ++-
src/util/virqemu.c | 5 +-
.../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 591 +++------------------
tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 9 +-
tests/qemumonitorjsontest.c | 34 +-
tests/qemustatusxml2xmldata/modern-in.xml | 6 +
tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args | 37 ++
tests/qemuxml2argvdata/disk-aio.x86_64-latest.args | 19 +-
.../disk-backing-chains-index.x86_64-2.12.0.args | 1 +
.../disk-backing-chains-index.x86_64-latest.args | 1 +
.../qemuxml2argvdata/disk-backing-chains-index.xml | 145 +++++
.../disk-backing-chains-noindex.x86_64-2.12.0.args | 58 ++
.../disk-backing-chains-noindex.x86_64-latest.args | 163 ++++++
.../disk-backing-chains-noindex.xml | 145 +++++
.../qemuxml2argvdata/disk-cache.x86_64-2.12.0.args | 50 ++
.../qemuxml2argvdata/disk-cache.x86_64-latest.args | 50 +-
.../disk-cdrom-network.x86_64-2.12.0.args | 41 ++
.../disk-cdrom-network.x86_64-latest.args | 32 +-
.../disk-cdrom-tray.x86_64-2.12.0.args | 39 ++
.../disk-cdrom-tray.x86_64-latest.args | 24 +-
.../qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args | 35 ++
.../qemuxml2argvdata/disk-cdrom.x86_64-latest.args | 17 +-
.../disk-copy_on_read.x86_64-2.12.0.args | 41 ++
.../disk-copy_on_read.x86_64-latest.args | 19 +-
.../disk-detect-zeroes.x86_64-2.12.0.args | 37 ++
.../disk-detect-zeroes.x86_64-latest.args | 17 +-
.../disk-error-policy.x86_64-2.12.0.args | 41 ++
.../disk-error-policy.x86_64-latest.args | 30 +-
.../disk-floppy.x86_64-2.12.0.args | 35 ++
.../disk-network-gluster.x86_64-2.12.0.args | 44 ++
.../disk-network-gluster.x86_64-latest.args | 32 +-
.../disk-network-iscsi.x86_64-2.12.0.args | 63 +++
.../disk-network-iscsi.x86_64-latest.args | 58 +-
.../disk-network-nbd.x86_64-2.12.0.args | 46 ++
.../disk-network-nbd.x86_64-latest.args | 41 +-
.../disk-network-rbd.x86_64-2.12.0.args | 61 +++
.../disk-network-rbd.x86_64-latest.args | 67 ++-
.../disk-network-sheepdog.x86_64-2.12.0.args | 35 ++
.../disk-network-sheepdog.x86_64-latest.args | 16 +-
.../disk-network-source-auth.x86_64-2.12.0.args | 47 ++
.../disk-network-source-auth.x86_64-latest.args | 30 +-
.../disk-network-tlsx509.x86_64-2.12.0.args | 59 ++
.../disk-network-tlsx509.x86_64-latest.args | 61 ++-
.../disk-readonly-disk.x86_64-2.12.0.args | 34 ++
.../disk-readonly-disk.x86_64-latest.args | 14 +-
.../disk-shared.x86_64-2.12.0.args | 37 ++
.../disk-shared.x86_64-latest.args | 18 +-
...isk-virtio-scsi-reservations.x86_64-2.12.0.args | 43 ++
...isk-virtio-scsi-reservations.x86_64-latest.args | 20 +-
.../floppy-drive-fat.x86_64-2.12.0.args | 33 ++
.../hostdev-mdev-display-missing-graphics.xml | 6 -
...v-display-spice-egl-headless.x86_64-latest.args | 2 -
.../hostdev-mdev-display-spice-egl-headless.xml | 6 -
...ev-mdev-display-spice-opengl.x86_64-latest.args | 2 -
.../hostdev-mdev-display-spice-opengl.xml | 6 -
...dev-display-vnc-egl-headless.x86_64-latest.args | 2 -
.../hostdev-mdev-display-vnc-egl-headless.xml | 6 -
.../hostdev-mdev-display-vnc.x86_64-latest.args | 2 -
.../qemuxml2argvdata/hostdev-mdev-display-vnc.xml | 6 -
tests/qemuxml2argvdata/hostdev-mdev-display.xml | 6 -
.../hostdev-mdev-invalid-target-address.xml | 5 -
.../qemuxml2argvdata/hostdev-mdev-precreated.args | 2 -
tests/qemuxml2argvdata/hostdev-mdev-precreated.xml | 6 -
.../hostdev-mdev-src-address-invalid.xml | 6 -
tests/qemuxml2argvtest.c | 24 +
.../disk-backing-chains-inactive.xml | 35 ++
.../disk-backing-chains-index-active.xml | 156 ++++++
.../disk-backing-chains-index-inactive.xml | 156 ++++++
.../disk-backing-chains-noindex-active.xml | 156 ++++++
.../disk-backing-chains-noindex-inactive.xml | 156 ++++++
tests/qemuxml2xmloutdata/disk-mirror-inactive.xml | 4 +
.../disk-mirror-old-inactive.xml | 4 +
tests/qemuxml2xmloutdata/hostdev-mdev-display.xml | 6 -
.../qemuxml2xmloutdata/hostdev-mdev-precreated.xml | 6 -
tests/qemuxml2xmltest.c | 2 +
95 files changed, 4017 insertions(+), 1087 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args
create mode 120000 tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args
create mode 120000 tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-index.xml
create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.xml
create mode 100644 tests/qemuxml2argvdata/disk-cache.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-network.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-copy_on_read.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-error-policy.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-gluster.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-nbd.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-readonly-disk.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-shared.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2argvdata/floppy-drive-fat.x86_64-2.12.0.args
create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml
--
2.16.2
6 years, 2 months
[libvirt] [PATCH] qemu: Check sev capability pointer before using it
by Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1612009
Check sev capability pointer in function qemuGetSEVInfoToParams to avoid
null pointer dereferences.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/qemu/qemu_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fb0d4a8c7a..3daaef586f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -21452,6 +21452,12 @@ qemuGetSEVInfoToParams(virQEMUCapsPtr qemuCaps,
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
+ if (!sev) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("SEV is not supported in this guest"));
+ return -1;
+ }
+
if (virTypedParamsAddString(&sevParams, &n, &maxpar,
VIR_NODE_SEV_PDH, sev->pdh) < 0)
return -1;
--
2.18.0
6 years, 2 months
[libvirt] [PATCH] docs: formatdomain: fix spacing before parentheses
by Ján Tomko
Multiple cputune elements specified microseconds as the unit
without putting a space before the parenthesis.
There were also other occurrences.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
docs/formatdomain.html.in | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 19b73125e1..b63467bd91 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -820,7 +820,7 @@
<dt><code>period</code></dt>
<dd>
The optional <code>period</code> element specifies the enforcement
- interval(unit: microseconds). Within <code>period</code>, each vCPU of
+ interval (unit: microseconds). Within <code>period</code>, each vCPU of
the domain will not be allowed to consume more than <code>quota</code>
worth of runtime. The value should be in range [1000, 1000000]. A period
with value 0 means no value.
@@ -830,7 +830,7 @@
<dt><code>quota</code></dt>
<dd>
The optional <code>quota</code> element specifies the maximum allowed
- bandwidth(unit: microseconds). A domain with <code>quota</code> as any
+ bandwidth (unit: microseconds). A domain with <code>quota</code> as any
negative value indicates that the domain has infinite bandwidth for
vCPU threads, which means that it is not bandwidth controlled. The value
should be in range [1000, 18446744073709551] or less than 0. A quota
@@ -863,8 +863,8 @@
<dt><code>emulator_period</code></dt>
<dd>
The optional <code>emulator_period</code> element specifies the enforcement
- interval(unit: microseconds). Within <code>emulator_period</code>, emulator
- threads(those excluding vCPUs) of the domain will not be allowed to consume
+ interval (unit: microseconds). Within <code>emulator_period</code>, emulator
+ threads (those excluding vCPUs) of the domain will not be allowed to consume
more than <code>emulator_quota</code> worth of runtime. The value should be
in range [1000, 1000000]. A period with value 0 means no value.
<span class="since">Only QEMU driver support since 0.10.0</span>
@@ -872,7 +872,7 @@
<dt><code>emulator_quota</code></dt>
<dd>
The optional <code>emulator_quota</code> element specifies the maximum
- allowed bandwidth(unit: microseconds) for domain's emulator threads(those
+ allowed bandwidth (unit: microseconds) for domain's emulator threads (those
excluding vCPUs). A domain with <code>emulator_quota</code> as any negative
value indicates that the domain has infinite bandwidth for emulator threads
(those excluding vCPUs), which means that it is not bandwidth controlled.
@@ -884,7 +884,7 @@
<dt><code>iothread_period</code></dt>
<dd>
The optional <code>iothread_period</code> element specifies the
- enforcement interval(unit: microseconds) for IOThreads. Within
+ enforcement interval (unit: microseconds) for IOThreads. Within
<code>iothread_period</code>, each IOThread of the domain will
not be allowed to consume more than <code>iothread_quota</code>
worth of runtime. The value should be in range [1000, 1000000].
@@ -894,7 +894,7 @@
<dt><code>iothread_quota</code></dt>
<dd>
The optional <code>iothread_quota</code> element specifies the maximum
- allowed bandwidth(unit: microseconds) for IOThreads. A domain with
+ allowed bandwidth (unit: microseconds) for IOThreads. A domain with
<code>iothread_quota</code> as any negative value indicates that the
domain IOThreads have infinite bandwidth, which means that it is
not bandwidth controlled. The value should be in range
@@ -4385,8 +4385,8 @@
<p>
USB, PCI and SCSI devices attached to the host can be passed through
to the guest using the <code>hostdev</code> element.
- <span class="since">since after 0.4.4 for USB, 0.6.0 for PCI(KVM only)
- and 1.0.6 for SCSI(KVM only)</span>:
+ <span class="since">since after 0.4.4 for USB, 0.6.0 for PCI (KVM only)
+ and 1.0.6 for SCSI (KVM only)</span>:
</p>
<pre>
--
2.13.6
6 years, 2 months
[libvirt] [PATCH] qemu: qemuDomainChangeNet: validity checks should be done before XML autocompletion
by Katerina Koukiou
We need to first perform the checks for changed/missing elements
and then we can overwrite the missing ones. Otherwise we might
falsely report successfull update, because some elements got
overwritten before the validity checks.
https://bugzilla.redhat.com/show_bug.cgi?id=1599513
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 43 ++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 1488f0a7c2..8d98c149e2 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3445,23 +3445,9 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
goto cleanup;
}
- /* info: if newdev->info is empty, fill it in from olddev,
- * otherwise verify that it matches - nothing is allowed to
- * change. (There is no helper function to do this, so
- * individually check the few feidls of virDomainDeviceInfo that
- * are relevant in this case).
+ /* info: Nothing is allowed to change. First check for changes and
+ * then fill the missing newdev->info from olddev.
*/
- if (!virDomainDeviceAddressIsValid(&newdev->info,
- VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
- virDomainDeviceInfoCopy(&newdev->info, &olddev->info) < 0) {
- goto cleanup;
- }
- if (!virPCIDeviceAddressEqual(&olddev->info.addr.pci,
- &newdev->info.addr.pci)) {
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
- _("cannot modify network device guest PCI address"));
- goto cleanup;
- }
/* grab alias from olddev if not set in newdev */
if (!newdev->info.alias &&
VIR_STRDUP(newdev->info.alias, olddev->info.alias) < 0)
@@ -3469,26 +3455,51 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
/* device alias is checked already in virDomainDefCompatibleDevice */
+ if (newdev->info.rombar == VIR_TRISTATE_BOOL_ABSENT)
+ newdev->info.rombar = olddev->info.rombar;
if (olddev->info.rombar != newdev->info.rombar) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device rom bar setting"));
goto cleanup;
}
+
+ if (!newdev->info.romfile &&
+ VIR_STRDUP(newdev->info.romfile, olddev->info.romfile) < 0)
+ goto cleanup;
if (STRNEQ_NULLABLE(olddev->info.romfile, newdev->info.romfile)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network rom file"));
goto cleanup;
}
+
+ if (newdev->info.bootIndex == 0)
+ newdev->info.bootIndex = olddev->info.bootIndex;
if (olddev->info.bootIndex != newdev->info.bootIndex) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device boot index setting"));
goto cleanup;
}
+
+ if (newdev->info.romenabled == VIR_TRISTATE_BOOL_ABSENT)
+ newdev->info.romenabled = olddev->info.romenabled;
if (olddev->info.romenabled != newdev->info.romenabled) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device rom enabled setting"));
goto cleanup;
}
+
+ /* if pci addr is missing or is invalid we overwrite all info struct */
+ if (!virDomainDeviceAddressIsValid(&newdev->info,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
+ virDomainDeviceInfoCopy(&newdev->info, &olddev->info) < 0) {
+ goto cleanup;
+ }
+ if (!virPCIDeviceAddressEqual(&olddev->info.addr.pci,
+ &newdev->info.addr.pci)) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("cannot modify network device guest PCI address"));
+ goto cleanup;
+ }
/* (end of device info checks) */
if (STRNEQ_NULLABLE(olddev->filter, newdev->filter) ||
--
2.17.1
6 years, 2 months