Changeset
docs/drvnodedev.html.in                            |  21 ++++-
docs/formatdomain.html.in                          |  20 +++-
docs/news.xml                                      |   9 ++
docs/schemas/domaincommon.rng                      |   5 +-
src/libvirt_private.syms                           |   1 +
src/qemu/qemu_capabilities.c                       |  23 +++++
src/qemu/qemu_capabilities.h                       |   5 +
src/qemu/qemu_command.c                            |  37 ++++++--
src/qemu/qemu_domain.c                             |   2 +-
src/qemu/qemu_domain_address.c                     |  32 +++++--
src/qemu/qemu_hostdev.c                            |   3 +-
src/qemu/qemu_hotplug.c                            |   4 +-
src/util/virhostdev.c                              |  26 ++++--
src/util/virhostdev.h                              |   3 +
src/util/virmdev.c                                 |   3 +-
src/util/virmdev.h                                 |   1 +
.../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  28 ++++--
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   3 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies |  28 ++++--
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   3 +-
.../qemucapabilitiesdata/caps_2.12.0.s390x.replies |  31 +++++--
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   3 +
.../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  24 +++--
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   3 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  28 ++++--
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   3 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  28 ++++--
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   3 +-
tests/qemuhotplugtest.c                            |   2 +-
...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml |  29 ++++++
...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml |  23 +++++
.../hostdev-subsys-mdev-vfio-ccw.args              |  23 +++++
.../hostdev-subsys-mdev-vfio-ccw.xml               |  22 +++++
tests/qemuxml2argvtest.c                           | 102 ++++++++++++---------
.../hostdev-subsys-mdev-vfio-ccw.xml               |  28 ++++++
tests/qemuxml2xmltest.c                            |  31 ++++---
36 files changed, 491 insertions(+), 149 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
Git apply log
Switched to a new branch '20180411154959.228209-1-shalini@linux.vnet.ibm.com'
Applying: qemu: introduce capability for virtual-css-bridge
Applying: qemu: introduce vfio-ccw capability
Applying: util: virhostdev: add virHostdevIsMdevDevice()
Applying: qemu: vfio-ccw device address generation
Applying: qemu: command line generation for vfio-ccw device
Applying: tests: tests for vfio-ccw passthrough
Applying: docs: documentation for vfio-ccw passthrough
Applying: news: documentation of new feature
To https://github.com/patchew-project/libvirt
 * [new tag]         patchew/20180411154959.228209-1-shalini@linux.vnet.ibm.com -> patchew/20180411154959.228209-1-shalini@linux.vnet.ibm.com
Test passed: syntax-check

loading

[libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Let us support the basic channel I/O passthrough infrastructure based on
vfio, which have been introduced in QEMU 2.10. The current focus is to
support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
device.

Shalini Chellathurai Saroja (8):
  qemu: introduce capability for virtual-css-bridge
  qemu: introduce vfio-ccw capability
  util: virhostdev: add virHostdevIsMdevDevice()
  qemu: vfio-ccw device address generation
  qemu: command line generation for vfio-ccw device
  tests: tests for vfio-ccw passthrough
  docs: documentation for vfio-ccw passthrough
  news: documentation of new feature

 docs/drvnodedev.html.in                            |  21 ++++-
 docs/formatdomain.html.in                          |  20 +++-
 docs/news.xml                                      |   9 ++
 docs/schemas/domaincommon.rng                      |   5 +-
 src/libvirt_private.syms                           |   1 +
 src/qemu/qemu_capabilities.c                       |  23 +++++
 src/qemu/qemu_capabilities.h                       |   5 +
 src/qemu/qemu_command.c                            |  37 ++++++--
 src/qemu/qemu_domain.c                             |   2 +-
 src/qemu/qemu_domain_address.c                     |  32 +++++--
 src/qemu/qemu_hostdev.c                            |   3 +-
 src/qemu/qemu_hotplug.c                            |   4 +-
 src/util/virhostdev.c                              |  26 ++++--
 src/util/virhostdev.h                              |   3 +
 src/util/virmdev.c                                 |   3 +-
 src/util/virmdev.h                                 |   1 +
 .../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  28 ++++--
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   3 +-
 .../qemucapabilitiesdata/caps_2.11.0.s390x.replies |  28 ++++--
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   3 +-
 .../qemucapabilitiesdata/caps_2.12.0.s390x.replies |  31 +++++--
 tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   3 +
 .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  24 +++--
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   3 +-
 .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  28 ++++--
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   3 +-
 .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  28 ++++--
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   3 +-
 tests/qemuhotplugtest.c                            |   2 +-
 ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml |  29 ++++++
 ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml |  23 +++++
 .../hostdev-subsys-mdev-vfio-ccw.args              |  23 +++++
 .../hostdev-subsys-mdev-vfio-ccw.xml               |  22 +++++
 tests/qemuxml2argvtest.c                           | 102 ++++++++++++---------
 .../hostdev-subsys-mdev-vfio-ccw.xml               |  28 ++++++
 tests/qemuxml2xmltest.c                            |  31 ++++---
 36 files changed, 491 insertions(+), 149 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml

-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Shalini Chellathurai Saroja, 13 weeks ago

On 04/11/2018 05:49 PM, Shalini Chellathurai Saroja wrote:
> Let us support the basic channel I/O passthrough infrastructure based on
> vfio, which have been introduced in QEMU 2.10. The current focus is to
> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
> device.

There is a temporary delay with our mail reception. The answer to the 
question below is as follows.

Quick question: Does "current focus" mean "we have only tested it with
ECKD DASD", or "we only allow passthrough of 3990/3390 devices"?

yes, it means we have only tested it with ECKD DASD device. The libvirt 
implementation supports all the devices which are supported by QEMU.

Thanks.

>
> Shalini Chellathurai Saroja (8):
>    qemu: introduce capability for virtual-css-bridge
>    qemu: introduce vfio-ccw capability
>    util: virhostdev: add virHostdevIsMdevDevice()
>    qemu: vfio-ccw device address generation
>    qemu: command line generation for vfio-ccw device
>    tests: tests for vfio-ccw passthrough
>    docs: documentation for vfio-ccw passthrough
>    news: documentation of new feature
>
>   docs/drvnodedev.html.in                            |  21 ++++-
>   docs/formatdomain.html.in                          |  20 +++-
>   docs/news.xml                                      |   9 ++
>   docs/schemas/domaincommon.rng                      |   5 +-
>   src/libvirt_private.syms                           |   1 +
>   src/qemu/qemu_capabilities.c                       |  23 +++++
>   src/qemu/qemu_capabilities.h                       |   5 +
>   src/qemu/qemu_command.c                            |  37 ++++++--
>   src/qemu/qemu_domain.c                             |   2 +-
>   src/qemu/qemu_domain_address.c                     |  32 +++++--
>   src/qemu/qemu_hostdev.c                            |   3 +-
>   src/qemu/qemu_hotplug.c                            |   4 +-
>   src/util/virhostdev.c                              |  26 ++++--
>   src/util/virhostdev.h                              |   3 +
>   src/util/virmdev.c                                 |   3 +-
>   src/util/virmdev.h                                 |   1 +
>   .../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   3 +-
>   .../qemucapabilitiesdata/caps_2.11.0.s390x.replies |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   3 +-
>   .../qemucapabilitiesdata/caps_2.12.0.s390x.replies |  31 +++++--
>   tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   3 +
>   .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  24 +++--
>   tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   3 +-
>   .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   3 +-
>   .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   3 +-
>   tests/qemuhotplugtest.c                            |   2 +-
>   ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml |  29 ++++++
>   ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml |  23 +++++
>   .../hostdev-subsys-mdev-vfio-ccw.args              |  23 +++++
>   .../hostdev-subsys-mdev-vfio-ccw.xml               |  22 +++++
>   tests/qemuxml2argvtest.c                           | 102 ++++++++++++---------
>   .../hostdev-subsys-mdev-vfio-ccw.xml               |  28 ++++++
>   tests/qemuxml2xmltest.c                            |  31 ++++---
>   36 files changed, 491 insertions(+), 149 deletions(-)
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
>   create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Cornelia Huck, 13 weeks ago
On Wed, 11 Apr 2018 17:49:51 +0200
Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> wrote:

> Let us support the basic channel I/O passthrough infrastructure based on
> vfio, which have been introduced in QEMU 2.10. The current focus is to
> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
> device.

Neat.

Quick question: Does "current focus" mean "we have only tested it with
ECKD DASD", or "we only allow passthrough of 3990/3390 devices"?

> 
> Shalini Chellathurai Saroja (8):
>   qemu: introduce capability for virtual-css-bridge
>   qemu: introduce vfio-ccw capability
>   util: virhostdev: add virHostdevIsMdevDevice()
>   qemu: vfio-ccw device address generation
>   qemu: command line generation for vfio-ccw device
>   tests: tests for vfio-ccw passthrough
>   docs: documentation for vfio-ccw passthrough
>   news: documentation of new feature
> 
>  docs/drvnodedev.html.in                            |  21 ++++-
>  docs/formatdomain.html.in                          |  20 +++-
>  docs/news.xml                                      |   9 ++
>  docs/schemas/domaincommon.rng                      |   5 +-
>  src/libvirt_private.syms                           |   1 +
>  src/qemu/qemu_capabilities.c                       |  23 +++++
>  src/qemu/qemu_capabilities.h                       |   5 +
>  src/qemu/qemu_command.c                            |  37 ++++++--
>  src/qemu/qemu_domain.c                             |   2 +-
>  src/qemu/qemu_domain_address.c                     |  32 +++++--
>  src/qemu/qemu_hostdev.c                            |   3 +-
>  src/qemu/qemu_hotplug.c                            |   4 +-
>  src/util/virhostdev.c                              |  26 ++++--
>  src/util/virhostdev.h                              |   3 +
>  src/util/virmdev.c                                 |   3 +-
>  src/util/virmdev.h                                 |   1 +
>  .../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  28 ++++--
>  tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   3 +-
>  .../qemucapabilitiesdata/caps_2.11.0.s390x.replies |  28 ++++--
>  tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   3 +-
>  .../qemucapabilitiesdata/caps_2.12.0.s390x.replies |  31 +++++--
>  tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   3 +
>  .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  24 +++--
>  tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   3 +-
>  .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  28 ++++--
>  tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   3 +-
>  .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  28 ++++--
>  tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   3 +-
>  tests/qemuhotplugtest.c                            |   2 +-
>  ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml |  29 ++++++
>  ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml |  23 +++++
>  .../hostdev-subsys-mdev-vfio-ccw.args              |  23 +++++
>  .../hostdev-subsys-mdev-vfio-ccw.xml               |  22 +++++
>  tests/qemuxml2argvtest.c                           | 102 ++++++++++++---------
>  .../hostdev-subsys-mdev-vfio-ccw.xml               |  28 ++++++
>  tests/qemuxml2xmltest.c                            |  31 ++++---
>  36 files changed, 491 insertions(+), 149 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
>  create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
>  create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
>  create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
>  create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Shalini Chellathurai Saroja, 11 weeks ago
Polite ping.


On 04/11/2018 05:49 PM, Shalini Chellathurai Saroja wrote:
> Let us support the basic channel I/O passthrough infrastructure based on
> vfio, which have been introduced in QEMU 2.10. The current focus is to
> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
> device.
>
> Shalini Chellathurai Saroja (8):
>    qemu: introduce capability for virtual-css-bridge
>    qemu: introduce vfio-ccw capability
>    util: virhostdev: add virHostdevIsMdevDevice()
>    qemu: vfio-ccw device address generation
>    qemu: command line generation for vfio-ccw device
>    tests: tests for vfio-ccw passthrough
>    docs: documentation for vfio-ccw passthrough
>    news: documentation of new feature
>
>   docs/drvnodedev.html.in                            |  21 ++++-
>   docs/formatdomain.html.in                          |  20 +++-
>   docs/news.xml                                      |   9 ++
>   docs/schemas/domaincommon.rng                      |   5 +-
>   src/libvirt_private.syms                           |   1 +
>   src/qemu/qemu_capabilities.c                       |  23 +++++
>   src/qemu/qemu_capabilities.h                       |   5 +
>   src/qemu/qemu_command.c                            |  37 ++++++--
>   src/qemu/qemu_domain.c                             |   2 +-
>   src/qemu/qemu_domain_address.c                     |  32 +++++--
>   src/qemu/qemu_hostdev.c                            |   3 +-
>   src/qemu/qemu_hotplug.c                            |   4 +-
>   src/util/virhostdev.c                              |  26 ++++--
>   src/util/virhostdev.h                              |   3 +
>   src/util/virmdev.c                                 |   3 +-
>   src/util/virmdev.h                                 |   1 +
>   .../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   3 +-
>   .../qemucapabilitiesdata/caps_2.11.0.s390x.replies |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   3 +-
>   .../qemucapabilitiesdata/caps_2.12.0.s390x.replies |  31 +++++--
>   tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   3 +
>   .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  24 +++--
>   tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   3 +-
>   .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   3 +-
>   .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  28 ++++--
>   tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   3 +-
>   tests/qemuhotplugtest.c                            |   2 +-
>   ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml |  29 ++++++
>   ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml |  23 +++++
>   .../hostdev-subsys-mdev-vfio-ccw.args              |  23 +++++
>   .../hostdev-subsys-mdev-vfio-ccw.xml               |  22 +++++
>   tests/qemuxml2argvtest.c                           | 102 ++++++++++++---------
>   .../hostdev-subsys-mdev-vfio-ccw.xml               |  28 ++++++
>   tests/qemuxml2xmltest.c                            |  31 ++++---
>   36 files changed, 491 insertions(+), 149 deletions(-)
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
>   create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Bjoern Walk, 11 weeks ago
Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> [2018-04-11, 05:49PM +0200]:
> Let us support the basic channel I/O passthrough infrastructure based on
> vfio, which have been introduced in QEMU 2.10. The current focus is to
> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
> device.
> 
> Shalini Chellathurai Saroja (8):
>   qemu: introduce capability for virtual-css-bridge
>   qemu: introduce vfio-ccw capability
>   util: virhostdev: add virHostdevIsMdevDevice()
>   qemu: vfio-ccw device address generation
>   qemu: command line generation for vfio-ccw device
>   tests: tests for vfio-ccw passthrough
>   docs: documentation for vfio-ccw passthrough
>   news: documentation of new feature

Any chance, we get at least a review before 4.3 hits? Would be
appreciated.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by John Ferlan, 10 weeks ago

On 04/26/2018 03:59 AM, Bjoern Walk wrote:
> Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> [2018-04-11, 05:49PM +0200]:
>> Let us support the basic channel I/O passthrough infrastructure based on
>> vfio, which have been introduced in QEMU 2.10. The current focus is to
>> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
>> device.
>>
>> Shalini Chellathurai Saroja (8):
>>   qemu: introduce capability for virtual-css-bridge
>>   qemu: introduce vfio-ccw capability
>>   util: virhostdev: add virHostdevIsMdevDevice()
>>   qemu: vfio-ccw device address generation
>>   qemu: command line generation for vfio-ccw device
>>   tests: tests for vfio-ccw passthrough
>>   docs: documentation for vfio-ccw passthrough
>>   news: documentation of new feature
> 
> Any chance, we get at least a review before 4.3 hits? Would be
> appreciated.
> 
> 

So obviously this did not make the 4.3.0 and the series will need a
refresh due to the volume of change in qemu_capabilities.{c,h}.

I've reviewed a number of patches recently and made a similar comment in
all of them - when changing qemu_capabilities.{c,h} and updating the
various qemucapabilitiesdata/caps_*.xml files - do so in a separate
patch. That way if someone doesn't review the code right away, it's
actually fairly simple to recreate at least the capability for a
reviewer. Having it mixed in one patch with other qemu, conf, test, etc.
changes causes git am -3 to fail and thus makes review harder especially
when you don't get to reviews as soon as patches hit the list.

Someone may also want to consider creating a s390 specific version of
what Peter did for x86_64 for VIR_TEST_CAPS_LATEST in order to then
have/use the "latest" capabilities instead of adding bits to xml2argv
tests. I'm curious why the xml2xml test needed the bit adjustment - did
something fail?  Since there were no xml output data changes, that would
seem to indicate there isn't a need to modify the xml2xml test source.

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Boris Fiuczynski, 10 weeks ago
On 05/04/2018 05:07 PM, John Ferlan wrote:
> 
> 
> On 04/26/2018 03:59 AM, Bjoern Walk wrote:
>> Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> [2018-04-11, 05:49PM +0200]:
>>> Let us support the basic channel I/O passthrough infrastructure based on
>>> vfio, which have been introduced in QEMU 2.10. The current focus is to
>>> support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target
>>> device.
>>>
>>> Shalini Chellathurai Saroja (8):
>>>    qemu: introduce capability for virtual-css-bridge
>>>    qemu: introduce vfio-ccw capability
>>>    util: virhostdev: add virHostdevIsMdevDevice()
>>>    qemu: vfio-ccw device address generation
>>>    qemu: command line generation for vfio-ccw device
>>>    tests: tests for vfio-ccw passthrough
>>>    docs: documentation for vfio-ccw passthrough
>>>    news: documentation of new feature
>>
>> Any chance, we get at least a review before 4.3 hits? Would be
>> appreciated.
>>
>>
> 
> So obviously this did not make the 4.3.0 and the series will need a
> refresh due to the volume of change in qemu_capabilities.{c,h}.
> 
> I've reviewed a number of patches recently and made a similar comment in
> all of them - when changing qemu_capabilities.{c,h} and updating the
> various qemucapabilitiesdata/caps_*.xml files - do so in a separate
> patch. That way if someone doesn't review the code right away, it's
> actually fairly simple to recreate at least the capability for a
> reviewer. Having it mixed in one patch with other qemu, conf, test, etc.
> changes causes git am -3 to fail and thus makes review harder especially
> when you don't get to reviews as soon as patches hit the list.
I am going to send out a new rebased version shortly.

> 
> Someone may also want to consider creating a s390 specific version of
> what Peter did for x86_64 for VIR_TEST_CAPS_LATEST in order to then
> have/use the "latest" capabilities instead of adding bits to xml2argv
> tests. I'm curious why the xml2xml test needed the bit adjustment - did
> something fail?  Since there were no xml output data changes, that would
> seem to indicate there isn't a need to modify the xml2xml test source.
I am not sure if I understood you correctly. Are you referring to patch 
1? If so the changes are caused by a new QEMU_CAPS_CCW capability 
replacing the QEMU_CAPS_VIRTIO_CCW capability. More is explained in the 
commit message of the patch. In short: With support of vfio-ccw it 
became apparent that the existence of the ccw bus is not well sourced by 
observing virtio-ccw and therefore we replaced it with the detection of 
the virtual-css-bridge. Let me know if I understood you wrong.

> 
> John
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 


-- 
Mit freundlichen Grüßen/Kind regards
    Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by John Ferlan, 10 weeks ago
[...]

>> Someone may also want to consider creating a s390 specific version of
>> what Peter did for x86_64 for VIR_TEST_CAPS_LATEST in order to then
>> have/use the "latest" capabilities instead of adding bits to xml2argv
>> tests. I'm curious why the xml2xml test needed the bit adjustment - did
>> something fail?  Since there were no xml output data changes, that would
>> seem to indicate there isn't a need to modify the xml2xml test source.
> I am not sure if I understood you correctly. Are you referring to patch
> 1? If so the changes are caused by a new QEMU_CAPS_CCW capability
> replacing the QEMU_CAPS_VIRTIO_CCW capability. More is explained in the
> commit message of the patch. In short: With support of vfio-ccw it
> became apparent that the existence of the ccw bus is not well sourced by
> observing virtio-ccw and therefore we replaced it with the detection of
> the virtual-css-bridge. Let me know if I understood you wrong.
> 

Sorry it wasn't clear enough - changes were recently made to
tests/qemuxml2argvtest.c in order to run the tests using the latest
capabilities rather than needing to pass each capability through the
test. The macros also have a version specific macro which allows for
checking/output from "previous" QEMU releases.

However, the changes only modified macros for x86_64 - so my comment was
if someone felt so inclined to avoid needing/checking specific/certain
caps and only cared that the latest caps did something a certain way,
then adjusting those macros/tests to handle s390* specific things would
perhaps helps achieve that. Furthermore, if previous QEMU versions would
produce different results, then using the version specific checks/output
would provide that support.

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/8] vfio-ccw passthrough support
Posted by Boris Fiuczynski, 9 weeks ago
On 05/07/2018 01:51 PM, John Ferlan wrote:
> [...]
> 
>>> Someone may also want to consider creating a s390 specific version of
>>> what Peter did for x86_64 for VIR_TEST_CAPS_LATEST in order to then
>>> have/use the "latest" capabilities instead of adding bits to xml2argv
>>> tests. I'm curious why the xml2xml test needed the bit adjustment - did
>>> something fail?  Since there were no xml output data changes, that would
>>> seem to indicate there isn't a need to modify the xml2xml test source.
>> I am not sure if I understood you correctly. Are you referring to patch
>> 1? If so the changes are caused by a new QEMU_CAPS_CCW capability
>> replacing the QEMU_CAPS_VIRTIO_CCW capability. More is explained in the
>> commit message of the patch. In short: With support of vfio-ccw it
>> became apparent that the existence of the ccw bus is not well sourced by
>> observing virtio-ccw and therefore we replaced it with the detection of
>> the virtual-css-bridge. Let me know if I understood you wrong.
>>
> 
> Sorry it wasn't clear enough - changes were recently made to
> tests/qemuxml2argvtest.c in order to run the tests using the latest
> capabilities rather than needing to pass each capability through the
> test. The macros also have a version specific macro which allows for
> checking/output from "previous" QEMU releases.
> 
> However, the changes only modified macros for x86_64 - so my comment was
> if someone felt so inclined to avoid needing/checking specific/certain
> caps and only cared that the latest caps did something a certain way,
> then adjusting those macros/tests to handle s390* specific things would
> perhaps helps achieve that. Furthermore, if previous QEMU versions would
> produce different results, then using the version specific checks/output
> would provide that support.

Oh, I tried to connect your comment to the vfio-ccw passthrough patch 
series but it seems rather unrelated to me.
Anyway you are right that it could be useful to extend the macros 
DO_TEST_CAPS_LATEST and DO_TEST_CAPS_VER beyond x86_64 arch. I do see 
these macros more like additional test scenarios that are a bit more 
reality oriented. The currently used approach of explicitly setting the 
minimum required capabilities for a single test case is still making 
sense to me as well since it allows to (slightly) narrow down the tested 
code path to the actual to be tested code/feature.


-- 
Mit freundlichen Grüßen/Kind regards
    Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/8] qemu: introduce capability for virtual-css-bridge
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Let us introduce the capability QEMU_CAPS_CCW for virtual-css-bridge
and replace QEMU_CAPS_VIRTIO_CCW with QEMU_CAPS_CCW in code segments
which identify support for ccw devices.

The virtual-css-bridge is part of the ccw support introduced in QEMU 2.7.
The QEMU_CAPS_CCW capability is based on the existence of the QEMU type.

Let us also add the capability QEMU_CAPS_CCW to the tests which
require support for ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 src/qemu/qemu_capabilities.c                     |  9 +++
 src/qemu/qemu_capabilities.h                     |  1 +
 src/qemu/qemu_domain.c                           |  2 +-
 src/qemu/qemu_domain_address.c                   |  4 +-
 src/qemu/qemu_hotplug.c                          |  4 +-
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml |  1 +
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml |  1 +
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml  |  1 +
 tests/qemuhotplugtest.c                          |  2 +-
 tests/qemuxml2argvtest.c                         | 86 ++++++++++++------------
 tests/qemuxml2xmltest.c                          | 26 +++----
 13 files changed, 77 insertions(+), 62 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 91b7aa31ec..719f527362 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -468,6 +468,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "virtio-tablet-ccw",
               "qcow2-luks",
               "pcie-pci-bridge",
+              "virtual-css-bridge",
     );
 
 
@@ -1104,6 +1105,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "virtio-mouse-ccw", QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW },
     { "virtio-tablet-ccw", QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW },
     { "pcie-pci-bridge", QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE },
+    { "virtual-css-bridge", QEMU_CAPS_CCW },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
@@ -3926,6 +3928,13 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION))
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_CACHE);
 
+    if (ARCH_IS_S390(qemuCaps->arch)) {
+        /* Legacy assurance for QEMU_CAPS_CCW */
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW) &&
+            virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW))
+            virQEMUCapsSet(qemuCaps, QEMU_CAPS_CCW);
+    }
+
     ret = 0;
  cleanup:
     return ret;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index bec28cae92..728d7fa7d2 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -452,6 +452,7 @@ typedef enum {
     QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW, /* -device virtio-tablet-ccw */
     QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */
     QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */
+    QEMU_CAPS_CCW, /* -device virtual-css-bridge */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 100304fd05..9f1f6a218f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11780,7 +11780,7 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
                              "'%s' using machine type '%s'"),
                        devicename, def->os.machine);
             return false;
-        } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
+        } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("CCW address type is not supported by "
                              "this QEMU"));
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 7fe9d5926c..ae6c59bb01 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -396,7 +396,7 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def,
     virDomainCCWAddressSetPtr addrs = NULL;
 
     if (qemuDomainIsS390CCW(def) &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
+        virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW)) {
         qemuDomainPrimeVirtioDeviceAddresses(
             def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW);
 
@@ -2985,7 +2985,7 @@ qemuDomainEnsureVirtioAddress(bool *releaseAddr,
 
     if (!info->type) {
         if (qemuDomainIsS390CCW(vm->def) &&
-            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW))
+            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CCW))
             info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW;
         else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390))
             info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index f0d549de38..634477eaeb 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1012,7 +1012,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
     }
 
     if (qemuDomainIsS390CCW(vm->def) &&
-        virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
+        virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CCW)) {
         net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW;
         if (!(ccwaddrs = qemuDomainCCWAddrSetCreateFromDomain(vm->def)))
             goto cleanup;
@@ -2502,7 +2502,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
 
     if (hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
         if (qemuDomainIsS390CCW(vm->def) &&
-            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW))
+            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CCW))
             hostdev->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW;
     }
 
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
index c4be3fca51..c8bd2c2b74 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
@@ -147,6 +147,7 @@
   <flag name='iscsi.password-secret'/>
   <flag name='dump-completed'/>
   <flag name='qcow2-luks'/>
+  <flag name='virtual-css-bridge'/>
   <version>2010000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>303326</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
index cbd645ae93..de886267bd 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
@@ -151,6 +151,7 @@
   <flag name='virtio-mouse-ccw'/>
   <flag name='virtio-tablet-ccw'/>
   <flag name='qcow2-luks'/>
+  <flag name='virtual-css-bridge'/>
   <version>2011000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>342058</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
index b58c3a1bda..0d2c7f353b 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
@@ -137,6 +137,7 @@
   <flag name='virtio-blk.num-queues'/>
   <flag name='sclplmconsole'/>
   <flag name='dump-completed'/>
+  <flag name='virtual-css-bridge'/>
   <version>2007000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>216732</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
index 2b91337fde..9c7a028584 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
@@ -139,6 +139,7 @@
   <flag name='virtio-blk.num-queues'/>
   <flag name='sclplmconsole'/>
   <flag name='dump-completed'/>
+  <flag name='virtual-css-bridge'/>
   <version>2007093</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>241633</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
index ac8d145d19..5b4dc0e8ba 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
@@ -142,6 +142,7 @@
   <flag name='disk-share-rw'/>
   <flag name='iscsi.password-secret'/>
   <flag name='dump-completed'/>
+  <flag name='virtual-css-bridge'/>
   <version>2009000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>265051</microcodeVersion>
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 85e53653e1..0c88f36132 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -74,7 +74,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
 
     virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI);
     virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE);
-    virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW);
+    virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_CCW);
     virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN);
     virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL);
     virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_DISK_WWN);
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 165137e93c..de5bf6fe5a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -929,11 +929,11 @@ mymain(void)
     DO_TEST("disk-many", NONE);
     DO_TEST("disk-virtio", QEMU_CAPS_DRIVE_BOOT);
     DO_TEST("disk-virtio-ccw",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("disk-virtio-ccw-many",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("disk-virtio-scsi-ccw", QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("disk-order",
             QEMU_CAPS_DRIVE_BOOT, QEMU_CAPS_VIRTIO_BLK_SCSI);
     DO_TEST("disk-virtio-drive-queues",
@@ -1243,7 +1243,7 @@ mymain(void)
     DO_TEST("net-virtio-s390",
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST("net-virtio-ccw",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("net-virtio-rxtxqueuesize",
             QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE,
             QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE);
@@ -1396,7 +1396,7 @@ mymain(void)
     DO_TEST("console-virtio-ccw",
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_BOOTINDEX,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST("console-sclp",
             QEMU_CAPS_NODEFCONFIG,
@@ -1628,7 +1628,7 @@ mymain(void)
     DO_TEST("fs9p-ccw",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV,
             QEMU_CAPS_FSDEV_WRITEOUT,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("hostdev-usb-address", NONE);
     DO_TEST("hostdev-usb-address-device",
@@ -1680,13 +1680,13 @@ mymain(void)
     DO_TEST_FAILURE("iothreads-nocap", NONE);
     DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD);
     DO_TEST("iothreads-disk-virtio-ccw", QEMU_CAPS_OBJECT_IOTHREAD,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("iothreads-virtio-scsi-pci", QEMU_CAPS_VIRTIO_SCSI,
             QEMU_CAPS_OBJECT_IOTHREAD,
             QEMU_CAPS_VIRTIO_SCSI_IOTHREAD);
     DO_TEST("iothreads-virtio-scsi-ccw", QEMU_CAPS_OBJECT_IOTHREAD,
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_SCSI_IOTHREAD,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("cpu-topology1", NONE);
     DO_TEST("cpu-topology2", NONE);
@@ -1718,7 +1718,7 @@ mymain(void)
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);
 
     qemuTestSetHostArch(driver.caps, VIR_ARCH_S390X);
-    DO_TEST("cpu-s390-zEC12", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    DO_TEST("cpu-s390-zEC12", QEMU_CAPS_KVM, QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("cpu-s390-features", QEMU_CAPS_KVM, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION);
     DO_TEST_FAILURE("cpu-s390-features", QEMU_CAPS_KVM);
     qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
@@ -2117,7 +2117,7 @@ mymain(void)
     DO_TEST("virtio-rng-ccw",
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_BOOTINDEX,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_VIRTIO_RNG,
             QEMU_CAPS_OBJECT_RNG_RANDOM);
@@ -2137,34 +2137,34 @@ mymain(void)
 
     DO_TEST("s390-panic-no-address",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("s390-panic-address",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-panic-missing",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST_PARSE_ERROR("s390-no-parallel",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-serial",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_SCLPCONSOLE);
     DO_TEST("s390-serial-2",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_SCLPCONSOLE,
             QEMU_CAPS_DEVICE_SCLPLMCONSOLE);
     DO_TEST("s390-serial-console",
             QEMU_CAPS_NODEFCONFIG,
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_SCLPCONSOLE);
 
@@ -2541,7 +2541,7 @@ mymain(void)
 # endif
     DO_TEST("hostdev-scsi-vhost-scsi-ccw",
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
-            QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_VIRTIO_CCW);
+            QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_CCW);
     DO_TEST("hostdev-scsi-vhost-scsi-pci",
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
             QEMU_CAPS_DEVICE_SCSI_GENERIC);
@@ -2817,99 +2817,99 @@ mymain(void)
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP,
             QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-on-caps", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-on-caps", NONE);
 
     DO_TEST("machine-aeskeywrap-on-cap",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-on-cap", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-on-cap", NONE);
 
     DO_TEST("machine-aeskeywrap-off-caps",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-off-caps", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-off-caps", NONE);
 
     DO_TEST("machine-aeskeywrap-off-cap",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-off-cap", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-aeskeywrap-off-cap", NONE);
 
     DO_TEST("machine-deakeywrap-on-caps",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-on-caps", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-on-caps", NONE);
 
     DO_TEST("machine-deakeywrap-on-cap",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-on-cap", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-on-cap", NONE);
 
     DO_TEST("machine-deakeywrap-off-caps",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-off-caps", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-off-caps", NONE);
 
     DO_TEST("machine-deakeywrap-off-cap",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-off-cap", QEMU_CAPS_MACHINE_OPT,
                     QEMU_CAPS_VIRTIO_SCSI,
-                    QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+                    QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST_FAILURE("machine-deakeywrap-off-cap", NONE);
 
     DO_TEST("machine-keywrap-none-caps",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP, QEMU_CAPS_DEA_KEY_WRAP,
             QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("machine-keywrap-none",
             QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("machine-loadparm-s390", QEMU_CAPS_MACHINE_OPT,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390,
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_BOOTINDEX, QEMU_CAPS_LOADPARM);
     DO_TEST("machine-loadparm-net-s390", QEMU_CAPS_MACHINE_OPT,
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390,
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_BOOTINDEX, QEMU_CAPS_LOADPARM);
     DO_TEST("machine-loadparm-multiple-disks-nets-s390",
-            QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
             QEMU_CAPS_LOADPARM);
     DO_TEST_PARSE_ERROR("machine-loadparm-s390-char-invalid",
-                        QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
+                        QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CCW,
                         QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
                         QEMU_CAPS_LOADPARM);
     DO_TEST_PARSE_ERROR("machine-loadparm-s390-len-invalid",
-                        QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
+                        QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CCW,
                         QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
                         QEMU_CAPS_LOADPARM);
 
@@ -3061,14 +3061,14 @@ mymain(void)
     DO_TEST("disk-many-format-probing", QEMU_CAPS_DRIVE_BOOT);
     driver.config->allowDiskFormatProbing = false;
 
-    DO_TEST("video-virtio-gpu-ccw", QEMU_CAPS_VIRTIO_CCW,
+    DO_TEST("video-virtio-gpu-ccw", QEMU_CAPS_CCW,
             QEMU_CAPS_DEVICE_VIRTIO_GPU,
             QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
             QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS,
             QEMU_CAPS_VNC,
             QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
 
-    DO_TEST("input-virtio-ccw", QEMU_CAPS_VIRTIO_CCW,
+    DO_TEST("input-virtio-ccw", QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_KEYBOARD,
             QEMU_CAPS_VIRTIO_MOUSE,
             QEMU_CAPS_VIRTIO_TABLET,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index d123180e79..4901eb286e 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -502,11 +502,11 @@ mymain(void)
     DO_TEST("cputune-iothreads", NONE);
     DO_TEST("iothreads-disk", NONE);
     DO_TEST("iothreads-disk-virtio-ccw",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("iothreads-virtio-scsi-pci",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_SCSI);
     DO_TEST("iothreads-virtio-scsi-ccw",
-            QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_S390);
     DO_TEST("lease", NONE);
     DO_TEST("event_idx", NONE);
@@ -973,7 +973,7 @@ mymain(void)
 
     DO_TEST("hostdev-scsi-vhost-scsi-ccw",
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
-            QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_VIRTIO_CCW);
+            QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_CCW);
     DO_TEST("hostdev-scsi-vhost-scsi-pci",
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
             QEMU_CAPS_DEVICE_SCSI_GENERIC);
@@ -1025,19 +1025,19 @@ mymain(void)
             QEMU_CAPS_DEVICE_SCSI_GENERIC);
 
     DO_TEST("s390-defaultconsole",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-panic",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-panic-missing",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-panic-no-address",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-serial",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-serial-2",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-serial-console",
-            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+            QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("pcihole64", NONE);
     DO_TEST("pcihole64-gib", NONE);
@@ -1190,14 +1190,14 @@ mymain(void)
     DO_TEST("video-qxl-noheads", NONE);
     DO_TEST("video-virtio-gpu-secondary", NONE);
     DO_TEST("video-virtio-gpu-ccw",
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_DEVICE_VIRTIO_GPU,
             QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
             QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS,
             QEMU_CAPS_VNC,
             QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
     DO_TEST("video-virtio-gpu-ccw-auto",
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_DEVICE_VIRTIO_GPU,
             QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
             QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS,
@@ -1240,7 +1240,7 @@ mymain(void)
 
     DO_TEST("user-aliases", NONE);
     DO_TEST("input-virtio-ccw",
-            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_KEYBOARD,
             QEMU_CAPS_VIRTIO_MOUSE,
             QEMU_CAPS_VIRTIO_TABLET,
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/8] qemu: introduce vfio-ccw capability
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Let us introduce the capability vfio-ccw for supporting the basic
channel I/O passthrough, which have been introduced in QEMU 2.10. The
current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390)
as the target device.

Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED
for virtual-css-bridge. This capability is based on the
cssid-unrestricted property which exists if QEMU no longer enforces
cssid restrictions based on ccw device types.

Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so
that we are able to probe for the cssid-unrestriced property.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 src/qemu/qemu_capabilities.c                       | 14 ++++++++++
 src/qemu/qemu_capabilities.h                       |  4 +++
 .../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 28 ++++++++++++-------
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |  2 +-
 .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 28 ++++++++++++-------
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |  2 +-
 .../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 31 ++++++++++++++++------
 tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |  3 +++
 .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  | 24 ++++++++++++-----
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |  2 +-
 .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  | 28 ++++++++++++-------
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |  2 +-
 .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  | 28 ++++++++++++-------
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |  2 +-
 14 files changed, 142 insertions(+), 56 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 719f527362..a0816de80d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -469,6 +469,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "qcow2-luks",
               "pcie-pci-bridge",
               "virtual-css-bridge",
+              "virtual-css-bridge.cssid-unrestricted",
+
+              /* 290 */
+              "vfio-ccw",
     );
 
 
@@ -1106,6 +1110,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "virtio-tablet-ccw", QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW },
     { "pcie-pci-bridge", QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE },
     { "virtual-css-bridge", QEMU_CAPS_CCW },
+    { "vfio-ccw", QEMU_CAPS_DEVICE_VFIO_CCW },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
@@ -1244,6 +1249,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = {
     { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB },
 };
 
+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtualCSSBridge[] = {
+    { "cssid-unrestricted", QEMU_CAPS_CCW_CSSID_UNRESTRICTED },
+};
+
 /* see documentation for virQEMUQAPISchemaPathGet for the query format */
 static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
     { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
@@ -1363,6 +1372,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
     { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu),
       QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
+    { "virtual-css-bridge", virQEMUCapsObjectPropsVirtualCSSBridge,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtualCSSBridge),
+      QEMU_CAPS_CCW },
 };
 
 
@@ -3933,6 +3945,8 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
         if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW) &&
             virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW))
             virQEMUCapsSet(qemuCaps, QEMU_CAPS_CCW);
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW_CSSID_UNRESTRICTED))
+            virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW);
     }
 
     ret = 0;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 728d7fa7d2..c489aeb9c3 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -453,6 +453,10 @@ typedef enum {
     QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */
     QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */
     QEMU_CAPS_CCW, /* -device virtual-css-bridge */
+    QEMU_CAPS_CCW_CSSID_UNRESTRICTED, /* virtual-css-bridge.cssid-unrestricted= */
+
+    /* 290 */
+    QEMU_CAPS_DEVICE_VFIO_CCW, /* -device vfio-ccw */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies
index 534756f0b3..3e19ac67da 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies
@@ -3405,6 +3405,16 @@
 {
   "return": [
     {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-34"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": false,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -3447,7 +3457,7 @@
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
@@ -3981,19 +3991,19 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
@@ -5098,7 +5108,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -5148,7 +5158,7 @@
       "capability": "return-path"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -14871,7 +14881,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -14911,11 +14921,11 @@
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
index c8bd2c2b74..ae54e29d80 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
@@ -150,7 +150,7 @@
   <flag name='virtual-css-bridge'/>
   <version>2010000</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>303326</microcodeVersion>
+  <microcodeVersion>303434</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <hostCPU type='kvm' model='z14-base' migratability='no'>
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
index 2de256009e..21fede318b 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
@@ -3524,6 +3524,16 @@
 {
   "return": [
     {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-35"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": true,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -3571,7 +3581,7 @@
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
@@ -4105,20 +4115,20 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
   "return": [
     "emulator"
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -5239,7 +5249,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -5297,7 +5307,7 @@
       "capability": "x-multifd"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -15165,7 +15175,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
@@ -15204,11 +15214,11 @@
       }
     }
   },
-  "id": "libvirt-42"
+  "id": "libvirt-43"
 }
 
 {
-  "id": "libvirt-43",
+  "id": "libvirt-44",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
index de886267bd..c162f74f6d 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
@@ -154,7 +154,7 @@
   <flag name='virtual-css-bridge'/>
   <version>2011000</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>342058</microcodeVersion>
+  <microcodeVersion>342166</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <hostCPU type='kvm' model='z14-base' migratability='no'>
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies
index c4e44c6d0f..4a0317b3cb 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies
@@ -3617,6 +3617,21 @@
 {
   "return": [
     {
+      "name": "cssid-unrestricted",
+      "description": "A css device can use any cssid, regardless whether virtual or not (read only, always true)",
+      "type": "bool"
+    },
+    {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-35"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": true,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -3669,7 +3684,7 @@
       "alias": "s390-ccw-virtio"
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
@@ -6324,20 +6339,20 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
   "return": [
     "emulator"
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -7493,7 +7508,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -7555,7 +7570,7 @@
       "capability": "dirty-bitmaps"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -18923,11 +18938,11 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "The CPU definition 'max' is unknown."
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
index 191b1e0e37..728f92dcfc 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
@@ -151,6 +151,9 @@
   <flag name='virtio-mouse-ccw'/>
   <flag name='virtio-tablet-ccw'/>
   <flag name='qcow2-luks'/>
+  <flag name='virtual-css-bridge'/>
+  <flag name='virtual-css-bridge.cssid-unrestricted'/>
+  <flag name='vfio-ccw'/>
   <version>2011090</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies
index 61fbd9a667..fe2aecd2b6 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies
@@ -2550,6 +2550,16 @@
 {
   "return": [
     {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-34"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": false,
       "name": "s390-ccw-virtio-2.5",
       "cpu-max": 248
@@ -2577,7 +2587,7 @@
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
@@ -2586,19 +2596,19 @@
       "name": "host"
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
@@ -3534,7 +3544,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -3568,7 +3578,7 @@
       "capability": "postcopy-ram"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -11924,7 +11934,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
index 0d2c7f353b..533b8020c4 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
@@ -140,7 +140,7 @@
   <flag name='virtual-css-bridge'/>
   <version>2007000</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>216732</microcodeVersion>
+  <microcodeVersion>216840</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <cpu type='kvm' name='host'/>
diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies
index 818118caf2..34734ec19b 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies
@@ -2823,6 +2823,16 @@
 {
   "return": [
     {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-34"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": false,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -2855,7 +2865,7 @@
       "alias": "s390-ccw-virtio"
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
@@ -3181,19 +3191,19 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
@@ -4154,7 +4164,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -4192,7 +4202,7 @@
       "capability": "x-colo"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -12962,7 +12972,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -12988,11 +12998,11 @@
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
index 9c7a028584..8e142a343b 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
@@ -142,7 +142,7 @@
   <flag name='virtual-css-bridge'/>
   <version>2007093</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>241633</microcodeVersion>
+  <microcodeVersion>241741</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <hostCPU type='kvm' model='zEC12.2-base' migratability='no'>
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies
index cbacec6d02..967148a022 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies
@@ -3104,6 +3104,16 @@
 {
   "return": [
     {
+      "name": "css_dev_path",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-34"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": false,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -3141,7 +3151,7 @@
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
@@ -3531,19 +3541,19 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
@@ -4618,7 +4628,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -4660,7 +4670,7 @@
       "capability": "release-ram"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -13946,7 +13956,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -13973,11 +13983,11 @@
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
index 5b4dc0e8ba..431e4d8324 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
@@ -145,7 +145,7 @@
   <flag name='virtual-css-bridge'/>
   <version>2009000</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>265051</microcodeVersion>
+  <microcodeVersion>265159</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <hostCPU type='kvm' model='z13.2-base' migratability='no'>
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/8] qemu: introduce vfio-ccw capability
Posted by Cornelia Huck, 13 weeks ago
On Wed, 11 Apr 2018 17:49:53 +0200
Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> wrote:

> Let us introduce the capability vfio-ccw for supporting the basic
> channel I/O passthrough, which have been introduced in QEMU 2.10. The
> current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390)
> as the target device.
> 
> Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED
> for virtual-css-bridge. This capability is based on the
> cssid-unrestricted property which exists if QEMU no longer enforces
> cssid restrictions based on ccw device types.
> 
> Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so
> that we are able to probe for the cssid-unrestriced property.

You depend on the unrestricted cssids and do not support the old,
deprecated squash-mcss approach? Makes sense.

I'm not familiar with libvirt conventions, but does it make sense to
add a comment _why_ vfio-ccw depends on unrestricted cssids (i.e., to
make sure the devices are visible to non-mcss-e enabled guests?)

> 
> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
> ---
>  src/qemu/qemu_capabilities.c                       | 14 ++++++++++
>  src/qemu/qemu_capabilities.h                       |  4 +++
>  .../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 28 ++++++++++++-------
>  tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |  2 +-
>  .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 28 ++++++++++++-------
>  tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |  2 +-
>  .../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 31 ++++++++++++++++------
>  tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |  3 +++
>  .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  | 24 ++++++++++++-----
>  tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |  2 +-
>  .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  | 28 ++++++++++++-------
>  tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |  2 +-
>  .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  | 28 ++++++++++++-------
>  tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |  2 +-
>  14 files changed, 142 insertions(+), 56 deletions(-)

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/8] qemu: introduce vfio-ccw capability
Posted by Shalini Chellathurai Saroja, 13 weeks ago

On 04/12/2018 10:44 AM, Cornelia Huck wrote:
> On Wed, 11 Apr 2018 17:49:53 +0200
> Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> wrote:
>
>> Let us introduce the capability vfio-ccw for supporting the basic
>> channel I/O passthrough, which have been introduced in QEMU 2.10. The
>> current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390)
>> as the target device.
>>
>> Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED
>> for virtual-css-bridge. This capability is based on the
>> cssid-unrestricted property which exists if QEMU no longer enforces
>> cssid restrictions based on ccw device types.
>>
>> Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so
>> that we are able to probe for the cssid-unrestriced property.
> You depend on the unrestricted cssids and do not support the old,
> deprecated squash-mcss approach? Makes sense.
>
> I'm not familiar with libvirt conventions, but does it make sense to
> add a comment _why_ vfio-ccw depends on unrestricted cssids (i.e., to
> make sure the devices are visible to non-mcss-e enabled guests?)

ok, I will add the comment, thanks.

>> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
>> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
>> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
>> ---
>>   src/qemu/qemu_capabilities.c                       | 14 ++++++++++
>>   src/qemu/qemu_capabilities.h                       |  4 +++
>>   .../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 28 ++++++++++++-------
>>   tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |  2 +-
>>   .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 28 ++++++++++++-------
>>   tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |  2 +-
>>   .../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 31 ++++++++++++++++------
>>   tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |  3 +++
>>   .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  | 24 ++++++++++++-----
>>   tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |  2 +-
>>   .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  | 28 ++++++++++++-------
>>   tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |  2 +-
>>   .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  | 28 ++++++++++++-------
>>   tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |  2 +-
>>   14 files changed, 142 insertions(+), 56 deletions(-)
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 3/8] util: virhostdev: add virHostdevIsMdevDevice()
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Add the function virHostdevIsMdevDevice() which detects whether a
hostdev is a mediated device or not. Also, replace all existing
conditionals.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 src/libvirt_private.syms       |  1 +
 src/qemu/qemu_command.c        |  4 +---
 src/qemu/qemu_domain_address.c |  8 ++++----
 src/qemu/qemu_hostdev.c        |  3 +--
 src/util/virhostdev.c          | 26 +++++++++++++++++---------
 src/util/virhostdev.h          |  3 +++
 6 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cab324c4d7..fe35640af1 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1926,6 +1926,7 @@ virHostCPUStatsAssign;
 
 # util/virhostdev.h
 virHostdevFindUSBDevice;
+virHostdevIsMdevDevice;
 virHostdevIsSCSIDevice;
 virHostdevManagerGetDefault;
 virHostdevPCINodeDeviceDetach;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 514c3ab2ef..e47f915fc8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5346,9 +5346,7 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
         }
 
         /* MDEV */
-        if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
-            subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) {
-
+        if (virHostdevIsMdevDevice(hostdev)) {
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("VFIO PCI device assignment is not "
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index ae6c59bb01..8acd5a7b71 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -655,10 +655,10 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
         virPCIDevicePtr pciDev;
         virPCIDeviceAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr;
 
-        if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
-            (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
-             hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV &&
-             hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST)) {
+        if (!virHostdevIsMdevDevice(hostdev) &&
+            (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+             (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
+              hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST))) {
             return 0;
         }
 
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index afe445d4e7..ab76e35a23 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -339,8 +339,7 @@ qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver,
     supportsVFIO = virFileExists("/dev/vfio/vfio");
 
     for (i = 0; i < nhostdevs; i++) {
-        if (hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
-            hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) {
+        if (virHostdevIsMdevDevice(hostdevs[i])) {
             if (!supportsVFIO) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("Mediated host device assignment requires "
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index a12224c58f..b28dc29a41 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -375,6 +375,20 @@ virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
 }
 
 
+/**
+ * virHostdevIsMdevDevice:
+ * @hostdev: host device to check
+ *
+ * Returns true if @hostdev is a Mediated device, false otherwise.
+ */
+bool
+virHostdevIsMdevDevice(virDomainHostdevDefPtr hostdev)
+{
+    return hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
+        hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV;
+}
+
+
 static int
 virHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
                                    virNetDevVPortProfilePtr virtPort,
@@ -1333,10 +1347,8 @@ virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr,
 
         mdevsrc = &hostdev->source.subsys.u.mdev;
 
-        if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
-            hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) {
+        if (!virHostdevIsMdevDevice(hostdev))
             continue;
-        }
 
         if (!(mdev = virMediatedDeviceNew(mdevsrc->uuidstr, mdevsrc->model)))
             goto cleanup;
@@ -1831,9 +1843,7 @@ virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr,
         virDomainHostdevSubsysMediatedDevPtr src = &hostdev->source.subsys.u.mdev;
         virMediatedDevicePtr mdev;
 
-        if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
-            continue;
-        if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
+        if (!virHostdevIsMdevDevice(hostdev))
             continue;
 
         if (!(mdev = virMediatedDeviceNew(src->uuidstr, src->model)))
@@ -2090,10 +2100,8 @@ virHostdevReAttachMediatedDevices(virHostdevManagerPtr mgr,
 
         mdevsrc = &hostdev->source.subsys.u.mdev;
 
-        if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
-            hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) {
+        if (!virHostdevIsMdevDevice(hostdev))
             continue;
-        }
 
         if (!(mdev = virMediatedDeviceNew(mdevsrc->uuidstr,
                                           mdevsrc->model)))
diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h
index 54e1c66be3..8f77c00221 100644
--- a/src/util/virhostdev.h
+++ b/src/util/virhostdev.h
@@ -191,6 +191,9 @@ virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
 bool
 virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
     ATTRIBUTE_NONNULL(1);
+bool
+virHostdevIsMdevDevice(virDomainHostdevDefPtr hostdev)
+    ATTRIBUTE_NONNULL(1);
 
 /* functions used by NodeDevDetach/Reattach/Reset */
 int virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr,
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 4/8] qemu: vfio-ccw device address generation
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Introduces the vfio-ccw model for mediated devices and prime vfio-ccw
devices such that CCW address will be generated.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
---
 docs/schemas/domaincommon.rng  |  5 ++++-
 src/qemu/qemu_domain_address.c | 20 ++++++++++++++++++++
 src/util/virmdev.c             |  3 ++-
 src/util/virmdev.h             |  1 +
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4cab55f05d..dfb4a3c43a 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4475,7 +4475,10 @@
       <value>mdev</value>
     </attribute>
     <attribute name="model">
-      <value>vfio-pci</value>
+      <choice>
+        <value>vfio-pci</value>
+        <value>vfio-ccw</value>
+      </choice>
     </attribute>
     <element name="source">
       <ref name="mdevaddress"/>
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 8acd5a7b71..1b4d8bf66c 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -282,6 +282,23 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
 
 
 static void
+qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def,
+                                      virDomainDeviceAddressType type)
+{
+    size_t i;
+
+    for (i = 0; i < def->nhostdevs; i++) {
+        virDomainHostdevSubsysPtr subsys = &def->hostdevs[i]->source.subsys;
+
+        if (virHostdevIsMdevDevice(def->hostdevs[i]) &&
+            subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW &&
+            def->hostdevs[i]->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
+            def->hostdevs[i]->info->type = type;
+    }
+}
+
+
+static void
 qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
                                      virDomainDeviceAddressType type)
 {
@@ -397,6 +414,9 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def,
 
     if (qemuDomainIsS390CCW(def) &&
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW)) {
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW))
+            qemuDomainPrimeVfioDeviceAddresses(
+                def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW);
         qemuDomainPrimeVirtioDeviceAddresses(
             def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW);
 
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index 27541cf34f..1ac5cb403d 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -48,7 +48,8 @@ struct _virMediatedDeviceList {
 };
 
 VIR_ENUM_IMPL(virMediatedDeviceModel, VIR_MDEV_MODEL_TYPE_LAST,
-              "vfio-pci")
+              "vfio-pci",
+              "vfio-ccw")
 
 static virClassPtr virMediatedDeviceListClass;
 
diff --git a/src/util/virmdev.h b/src/util/virmdev.h
index 01ab02e751..cfda2cacab 100644
--- a/src/util/virmdev.h
+++ b/src/util/virmdev.h
@@ -25,6 +25,7 @@
 
 typedef enum {
     VIR_MDEV_MODEL_TYPE_VFIO_PCI = 0,
+    VIR_MDEV_MODEL_TYPE_VFIO_CCW = 1,
 
     VIR_MDEV_MODEL_TYPE_LAST
 } virMediatedDeviceModelType;
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 5/8] qemu: command line generation for vfio-ccw device
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Generates the QEMU command line for the vfio-ccw device.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
---
 src/qemu/qemu_command.c | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e47f915fc8..ad60a7b433 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5123,11 +5123,17 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
     virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev;
     char *ret = NULL;
     char *mdevPath = NULL;
+    const char *dev_str = NULL;
 
     if (!(mdevPath = virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr)))
         goto cleanup;
 
-    virBufferAddLit(&buf, "vfio-pci");
+    dev_str = virMediatedDeviceModelTypeToString(mdevsrc->model);
+
+    if (!dev_str)
+        goto cleanup;
+
+    virBufferAdd(&buf, dev_str, -1);
     virBufferAsprintf(&buf, ",id=%s,sysfsdev=%s", dev->info->alias, mdevPath);
 
     if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
@@ -5347,11 +5353,28 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 
         /* MDEV */
         if (virHostdevIsMdevDevice(hostdev)) {
-            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("VFIO PCI device assignment is not "
-                                 "supported by this version of qemu"));
+            switch ((virMediatedDeviceModelType) subsys->u.mdev.model) {
+            case VIR_MDEV_MODEL_TYPE_VFIO_PCI:
+                if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
+                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                                   _("VFIO PCI device assignment is not "
+                                     "supported by this version of QEMU"));
+                    return -1;
+                }
+                break;
+            case VIR_MDEV_MODEL_TYPE_VFIO_CCW:
+                if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW)) {
+                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                                   _("VFIO CCW device assignment is not "
+                                     "supported by this version of QEMU"));
+                    return -1;
+                }
+                break;
+            case VIR_MDEV_MODEL_TYPE_LAST:
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("unexpected vfio type '%d'"), subsys->u.mdev.model);
                 return -1;
+                break;
             }
 
             virCommandAddArg(cmd, "-device");
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 6/8] tests: tests for vfio-ccw passthrough
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Let us test the following functionalities of vfio-ccw in libvirt
1. Generation of QEMU command line from domain xml file
2. Generation of dump xml from domain xml file
3. Checks duplicate/invalid addresses for vfio-ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
---
 ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml | 29 ++++++++++++++++++++++
 ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml | 23 +++++++++++++++++
 .../hostdev-subsys-mdev-vfio-ccw.args              | 23 +++++++++++++++++
 .../hostdev-subsys-mdev-vfio-ccw.xml               | 22 ++++++++++++++++
 tests/qemuxml2argvtest.c                           | 16 ++++++++++++
 .../hostdev-subsys-mdev-vfio-ccw.xml               | 28 +++++++++++++++++++++
 tests/qemuxml2xmltest.c                            |  5 ++++
 7 files changed, 146 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml

diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
new file mode 100644
index 0000000000..4b95fe277c
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+      <source>
+        <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/>
+      </source>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </hostdev>
+    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+      <source>
+        <address uuid='71b411af-5491-4100-b03e-0705e0b2eb27'/>
+      </source>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </hostdev>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
new file mode 100644
index 0000000000..680090e2b0
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.xml
@@ -0,0 +1,23 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+      <source>
+        <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/>
+      </source>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </hostdev>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
new file mode 100644
index 0000000000..a359f40e2e
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args
@@ -0,0 +1,23 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name QEMUGuest1 \
+-S \
+-M s390-ccw-virtio \
+-m 512 \
+-smp 2,sockets=2,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c \
+-device vfio-ccw,id=hostdev0,\
+sysfsdev=/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627,\
+devno=fe.0.0000 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001
diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
new file mode 100644
index 0000000000..96f30f5e9c
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml
@@ -0,0 +1,22 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+      <source>
+        <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/>
+      </source>
+    </hostdev>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index de5bf6fe5a..64ab04817a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1659,6 +1659,22 @@ mymain(void)
     DO_TEST("pci-rom",
             QEMU_CAPS_NODEFCONFIG);
 
+    DO_TEST("hostdev-subsys-mdev-vfio-ccw",
+            QEMU_CAPS_CCW,
+            QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
+            QEMU_CAPS_DEVICE_VFIO_CCW);
+    DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ccw",
+            QEMU_CAPS_CCW,
+            QEMU_CAPS_CCW_CSSID_UNRESTRICTED);
+    DO_TEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ccw-duplicate-address",
+            QEMU_CAPS_CCW,
+            QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
+            QEMU_CAPS_DEVICE_VFIO_CCW);
+    DO_TEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ccw-invalid-address",
+            QEMU_CAPS_CCW,
+            QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
+            QEMU_CAPS_DEVICE_VFIO_CCW);
+
     DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE);
     DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, NONE);
     DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, GIC_NONE, NONE);
diff --git a/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
new file mode 100644
index 0000000000..a14ab05caa
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-ccw'>
+      <source>
+        <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/>
+      </source>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </hostdev>
+    <memballoon model='virtio'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </memballoon>
+    <panic model='s390'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 4901eb286e..84982fb6a3 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1024,6 +1024,11 @@ mymain(void)
             QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_LSI,
             QEMU_CAPS_DEVICE_SCSI_GENERIC);
 
+    DO_TEST("hostdev-subsys-mdev-vfio-ccw",
+            QEMU_CAPS_CCW,
+            QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
+            QEMU_CAPS_DEVICE_VFIO_CCW);
+
     DO_TEST("s390-defaultconsole",
             QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
     DO_TEST("s390-panic",
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 7/8] docs: documentation for vfio-ccw passthrough
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 docs/drvnodedev.html.in   | 21 ++++++++++++++++++++-
 docs/formatdomain.html.in | 20 +++++++++++++++-----
 2 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/docs/drvnodedev.html.in b/docs/drvnodedev.html.in
index 885904d67d..71a8a57b0c 100644
--- a/docs/drvnodedev.html.in
+++ b/docs/drvnodedev.html.in
@@ -335,8 +335,27 @@
 $ ls /sys/class/mdev_bus/&lt;device&gt;/mdev_supported_types</pre>
 
     <p>
+      Before creating a mediated device, unbind the device from the respective
+      device driver, eg. subchannel I/O driver for a CCW device. Then bind the
+      device to the respective VFIO driver. For a CCW device, also unbind the
+      corresponding subchannel of the CCW device from the subchannel I/O driver
+      and then bind the subchannel (instead of the CCW device) to the vfio_ccw
+      driver. The below example shows the unbinding and binding steps for a CCW
+      device.
+    </p>
+
+    <pre>
+device="0.0.1234"
+subchannel="0.0.0123"
+echo $device &gt; /sys/bus/ccw/devices/$device/driver/unbind
+echo $subchannel &gt; /sys/bus/css/devices/$subchannel/driver/unbind
+echo $subchannel &gt; /sys/bus/css/drivers/vfio_ccw/bind
+    </pre>
+
+    <p>
       To manually instantiate a mediated device, use one of the following as a
-      reference:
+      reference. For a CCW device, use the subchannel ID instead of the device
+      ID.
     </p>
 
     <pre>
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5e99884dc5..ff8ec25928 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4308,6 +4308,12 @@
       &lt;address uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'/&gt;
     &lt;/source&gt;
     &lt;/hostdev&gt;
+    &lt;hostdev mode='subsystem' type='mdev' model='vfio-ccw'&gt;
+    &lt;source&gt;
+      &lt;address uuid='9063cba3-ecef-47b6-abcf-3fef4fdcad85'/&gt;
+    &lt;/source&gt;
+    &lt;address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/&gt;
+    &lt;/hostdev&gt;
   &lt;/devices&gt;
   ...</pre>
 
@@ -4359,10 +4365,13 @@
           <dd>For mediated devices (<span class="since">Since 3.2.0</span>)
           the <code>model</code> attribute specifies the device API which
           determines how the host's vfio driver will expose the device to the
-          guest. Currently, only <code>model='vfio-pci'</code> is supported.
-          There are also some implications on the usage of guest's address type
-          depending on the <code>model</code> attribute, see the
-          <code>address</code> element below.</dd>
+          guest. Currently, <code>model='vfio-pci'</code> and
+          <code>model='vfio-ccw'</code> (<span class="since">Since 4.3.0</span>)
+          is supported. Refer <a href="drvnodedev.html#MDEV">MDEV</a> to create
+          a mediated device on the host. There are also some implications on the
+          usage of guest's address type depending on the <code>model</code>
+          attribute, see the <code>address</code> element below.
+          </dd>
         </dl>
         <p>
           Note: The <code>managed</code> attribute is only used with
@@ -4488,7 +4497,8 @@
       devices defining an allocation of resources on the physical parent device,
       the address type used must conform to the <code>model</code> attribute
       of element <code>hostdev</code>, e.g. any address type other than PCI for
-      <code>vfio-pci</code> device API will result in an error.
+      <code>vfio-pci</code> device API or any address type other than CCW for
+      <code>vfio-ccw</code> device API will result in an error.
       <a href="#elementsAddress">See above</a> for more details on the address
       element.</dd>
       <dt><code>driver</code></dt>
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 8/8] news: documentation of new feature
Posted by Shalini Chellathurai Saroja, 13 weeks ago
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 docs/news.xml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/docs/news.xml b/docs/news.xml
index 798ab6da40..41bd2ab372 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -37,6 +37,15 @@
     <section title="New features">
       <change>
         <summary>
+          qemu: Provide VFIO channel I/O passthrough support
+        </summary>
+        <description>
+          Support passthrough devices that use channel I/O based mechanism in
+          a QEMU virtual machine.
+        </description>
+      </change>
+      <change>
+        <summary>
           qemu: Add support for the pcie-to-pci-bridge controller
         </summary>
         <description>
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list