QEMU on S390 (since v2.11) can support the virtio-gpu-ccw device,
so on S390 assign CCW address for a video device.
Also introduce a new capability for the virtio-gpu-ccw
device.
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
docs/formatdomain.html.in | 3 +
src/qemu/qemu_capabilities.c | 5 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 18 ++++-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domain_address.c | 8 +++
src/qemu/qemu_process.c | 5 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 83 +++++++++++++++++++---
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 3 +-
9 files changed, 114 insertions(+), 14 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6fd2189..0908709 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6484,6 +6484,9 @@ qemu-kvm -net nic,model=? /dev/null
<dd>
The optional <code>address</code> sub-element can be used to
tie the video device to a particular PCI slot.
+ On S390, <code>address</code> can be used to provide the
+ CCW address for the video device (<span class="since">
+ since 4.2.0</span>).
</dd>
<dt><code>driver</code></dt>
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b5eb8cf..9db4c31 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"pl011",
"machine.pseries.max-cpu-compat",
"dump-completed",
+ "virtio-gpu-ccw",
);
@@ -1694,6 +1695,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
{ "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
{ "pl011", QEMU_CAPS_DEVICE_PL011 },
+ { "virtio-gpu-ccw", QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
@@ -1932,6 +1934,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
{ "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
+ { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu,
+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu),
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
};
struct virQEMUCapsPropTypeObjects {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c2ec2be..b4852e5 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -444,6 +444,7 @@ typedef enum {
QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */
QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW, /* -device virtio-gpu-ccw */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fa0aa5d..ba63670 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -132,7 +132,7 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDEO_TYPE_LAST,
"", /* don't support vbox */
"qxl",
"", /* don't support parallels */
- "virtio-gpu-pci",
+ "virtio-gpu",
"" /* don't support gop */);
VIR_ENUM_DECL(qemuSoundCodec)
@@ -4262,7 +4262,21 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
goto error;
}
- virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
+ if (STREQ(model, "virtio-gpu")) {
+ switch (video->info.type) {
+ case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
+ virBufferAsprintf(&buf, "%s-pci", model);
+ break;
+
+ case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
+ virBufferAsprintf(&buf, "%s-ccw", model);
+ break;
+ }
+ } else {
+ virBufferAsprintf(&buf, "%s", model);
+ }
+
+ virBufferAsprintf(&buf, ",id=%s", video->info.alias);
if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
virBufferAsprintf(&buf, ",virgl=%s",
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ee02ecd..b47b4d1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5156,7 +5156,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
if ARCH_IS_PPC64(def->os.arch)
dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
- else if (qemuDomainIsVirt(def))
+ else if (qemuDomainIsVirt(def) || ARCH_IS_S390(def->os.arch))
dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
else
dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index ae49cf2..49a293e 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -308,6 +308,14 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
}
}
+ for (i = 0; i < def->nvideos; i++) {
+ virDomainVideoDefPtr video = def->videos[i];
+
+ if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
+ video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO)
+ video->info.type = type;
+ }
+
for (i = 0; i < def->ninputs; i++) {
if (def->inputs[i]->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
def->inputs[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 57c06c7..1afb71f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4778,7 +4778,10 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
(video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) ||
(video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) {
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) ||
+ (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
+ video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("this QEMU does not support '%s' video device"),
virDomainVideoTypeToString(video->type));
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
index 6768937..53c4804 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
@@ -3515,6 +3515,71 @@
{
"return": [
{
+ "name": "notify_on_empty",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "ioeventfd",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "any_layout",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "devno",
+ "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
+ "type": "str"
+ },
+ {
+ "name": "indirect_desc",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "event_idx",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "virtio-backend",
+ "type": "child<virtio-gpu-device>"
+ },
+ {
+ "name": "yres",
+ "type": "uint32"
+ },
+ {
+ "name": "xres",
+ "type": "uint32"
+ },
+ {
+ "name": "iommu_platform",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "max_outputs",
+ "type": "uint32"
+ },
+ {
+ "name": "max_hostmem",
+ "type": "size"
+ },
+ {
+ "name": "max_revision",
+ "type": "uint32"
+ }
+ ],
+ "id": "libvirt-41"
+}
+
+{
+ "return": [
+ {
"hotpluggable-cpus": true,
"name": "s390-ccw-virtio-2.7",
"cpu-max": 248
@@ -3562,7 +3627,7 @@
"cpu-max": 248
}
],
- "id": "libvirt-41"
+ "id": "libvirt-42"
}
{
@@ -4096,20 +4161,20 @@
"migration-safe": true
}
],
- "id": "libvirt-42"
+ "id": "libvirt-43"
}
{
"return": [
],
- "id": "libvirt-43"
+ "id": "libvirt-44"
}
{
"return": [
"emulator"
],
- "id": "libvirt-44"
+ "id": "libvirt-45"
}
{
@@ -5230,7 +5295,7 @@
"option": "drive"
}
],
- "id": "libvirt-45"
+ "id": "libvirt-46"
}
{
@@ -5288,7 +5353,7 @@
"capability": "x-multifd"
}
],
- "id": "libvirt-46"
+ "id": "libvirt-47"
}
{
@@ -15156,7 +15221,7 @@
"meta-type": "object"
}
],
- "id": "libvirt-47"
+ "id": "libvirt-48"
}
{
@@ -15195,11 +15260,11 @@
}
}
},
- "id": "libvirt-48"
+ "id": "libvirt-49"
}
{
- "id": "libvirt-49",
+ "id": "libvirt-50",
"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 f7f102f..ec5c396 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
@@ -146,9 +146,10 @@
<flag name='disk-share-rw'/>
<flag name='iscsi.password-secret'/>
<flag name='dump-completed'/>
+ <flag name='virtio-gpu-ccw'/>
<version>2011000</version>
<kvmVersion>0</kvmVersion>
- <microcodeVersion>341724</microcodeVersion>
+ <microcodeVersion>342885</microcodeVersion>
<package></package>
<arch>s390x</arch>
<hostCPU type='kvm' model='z14-base' migratability='no'>
--
2.7.4
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On 03/08/2018 11:07 AM, Farhan Ali wrote:
> QEMU on S390 (since v2.11) can support the virtio-gpu-ccw device,
> so on S390 assign CCW address for a video device.
>
> Also introduce a new capability for the virtio-gpu-ccw
> device.
>
> Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
> Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
> ---
> docs/formatdomain.html.in | 3 +
> src/qemu/qemu_capabilities.c | 5 ++
> src/qemu/qemu_capabilities.h | 1 +
> src/qemu/qemu_command.c | 18 ++++-
> src/qemu/qemu_domain.c | 2 +-
> src/qemu/qemu_domain_address.c | 8 +++
> src/qemu/qemu_process.c | 5 +-
> .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 83 +++++++++++++++++++---
> tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 3 +-
> 9 files changed, 114 insertions(+), 14 deletions(-)
>
First off - other upstream changes has caused this to not be able to
apply w/ git am -3 - so once patch1 is pushed, you'll need to rework and
repost the series (hopefully this time you won't have the strange split
with a CC address having "--dry-run" appended to an email ;-)
Since I cannot compile this one - I'll just be able to go through
visually and note a few things... Primarily though - this particular
patch should be split up a bit more. Separate out the capabilities into
their own separate "capabilities" patch and the second patch becomes a
"functionality" patch.
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 6fd2189..0908709 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -6484,6 +6484,9 @@ qemu-kvm -net nic,model=? /dev/null
> <dd>
> The optional <code>address</code> sub-element can be used to
> tie the video device to a particular PCI slot.
> + On S390, <code>address</code> can be used to provide the
> + CCW address for the video device (<span class="since">
> + since 4.2.0</span>).
> </dd>
>
> <dt><code>driver</code></dt>
... The above would go with the "functionality" patch and the next few
with a "capability" patch...
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index b5eb8cf..9db4c31 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
> "pl011",
> "machine.pseries.max-cpu-compat",
> "dump-completed",
> + "virtio-gpu-ccw",
> );
>
>
> @@ -1694,6 +1695,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
> { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
> { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
> { "pl011", QEMU_CAPS_DEVICE_PL011 },
> + { "virtio-gpu-ccw", QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
> };
>
> static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
> @@ -1932,6 +1934,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
> { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
> ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
> QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
> + { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu,
> + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu),
> + QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
> };
>
> struct virQEMUCapsPropTypeObjects {
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index c2ec2be..b4852e5 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -444,6 +444,7 @@ typedef enum {
> QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
> QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */
> QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */
> + QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW, /* -device virtio-gpu-ccw */
>
> QEMU_CAPS_LAST /* this must always be the last item */
> } virQEMUCapsFlags;
... Above here with the "capability" patch and below with the
"functionality" patch...
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index fa0aa5d..ba63670 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -132,7 +132,7 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDEO_TYPE_LAST,
> "", /* don't support vbox */
> "qxl",
> "", /* don't support parallels */
> - "virtio-gpu-pci",
> + "virtio-gpu",
> "" /* don't support gop */);
>
> VIR_ENUM_DECL(qemuSoundCodec)
> @@ -4262,7 +4262,21 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
> goto error;
> }
>
> - virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
> + if (STREQ(model, "virtio-gpu")) {
Rather than STREQ comparison perhaps:
if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
since that's what derives "virtio-gpu" for model anyway.
> + switch (video->info.type) {
> + case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
> + virBufferAsprintf(&buf, "%s-pci", model);
> + break;
> +
> + case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
> + virBufferAsprintf(&buf, "%s-ccw", model);
> + break;
> + }
Let's not use a switch here - as that implies there could be more than
just two values in the '.type' field... I'd go with:
if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
virBufferAsprintf(&buf, "%s-ccw", model);
else
virBufferAsprintf(&buf, "%s-pci", model);
> + } else {
> + virBufferAsprintf(&buf, "%s", model);
> + }
> +
> + virBufferAsprintf(&buf, ",id=%s", video->info.alias);
>
> if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
> virBufferAsprintf(&buf, ",virgl=%s",
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index ee02ecd..b47b4d1 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -5156,7 +5156,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
> if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
> if ARCH_IS_PPC64(def->os.arch)
> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
> - else if (qemuDomainIsVirt(def))
> + else if (qemuDomainIsVirt(def) || ARCH_IS_S390(def->os.arch))
> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
> else
> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
> diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
> index ae49cf2..49a293e 100644
> --- a/src/qemu/qemu_domain_address.c
> +++ b/src/qemu/qemu_domain_address.c
> @@ -308,6 +308,14 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
> }
> }
>
There's a comment at the top of the function that could add "video" to
the list as well...
> + for (i = 0; i < def->nvideos; i++) {
> + virDomainVideoDefPtr video = def->videos[i];
> +
> + if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
> + video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO)
> + video->info.type = type;
> + }
> +
> for (i = 0; i < def->ninputs; i++) {
> if (def->inputs[i]->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
> def->inputs[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 57c06c7..1afb71f 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -4778,7 +4778,10 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
> (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
> !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) ||
> (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
> - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) {
> + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) ||
> + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
> + video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
> + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW))) {
> virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> _("this QEMU does not support '%s' video device"),
> virDomainVideoTypeToString(video->type));
... The rest would go with the capabilities patch....
> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
> index 6768937..53c4804 100644
> --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
> +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
> @@ -3515,6 +3515,71 @@
> {
> "return": [
> {
> + "name": "notify_on_empty",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "ioeventfd",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "any_layout",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "devno",
> + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
> + "type": "str"
> + },
> + {
> + "name": "indirect_desc",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "event_idx",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "virtio-backend",
> + "type": "child<virtio-gpu-device>"
> + },
> + {
> + "name": "yres",
> + "type": "uint32"
> + },
> + {
> + "name": "xres",
> + "type": "uint32"
> + },
> + {
> + "name": "iommu_platform",
> + "description": "on/off",
> + "type": "bool"
> + },
> + {
> + "name": "max_outputs",
> + "type": "uint32"
> + },
> + {
> + "name": "max_hostmem",
> + "type": "size"
> + },
> + {
> + "name": "max_revision",
> + "type": "uint32"
> + }
> + ],
> + "id": "libvirt-41"
> +}
> +
> +{
> + "return": [
> + {
> "hotpluggable-cpus": true,
> "name": "s390-ccw-virtio-2.7",
> "cpu-max": 248
> @@ -3562,7 +3627,7 @@
> "cpu-max": 248
> }
> ],
> - "id": "libvirt-41"
> + "id": "libvirt-42"
> }
>
> {
> @@ -4096,20 +4161,20 @@
> "migration-safe": true
> }
> ],
> - "id": "libvirt-42"
> + "id": "libvirt-43"
> }
>
> {
> "return": [
> ],
> - "id": "libvirt-43"
> + "id": "libvirt-44"
> }
>
> {
> "return": [
> "emulator"
> ],
> - "id": "libvirt-44"
> + "id": "libvirt-45"
> }
>
> {
> @@ -5230,7 +5295,7 @@
> "option": "drive"
> }
> ],
> - "id": "libvirt-45"
> + "id": "libvirt-46"
> }
>
> {
> @@ -5288,7 +5353,7 @@
> "capability": "x-multifd"
> }
> ],
> - "id": "libvirt-46"
> + "id": "libvirt-47"
> }
>
> {
> @@ -15156,7 +15221,7 @@
> "meta-type": "object"
> }
> ],
> - "id": "libvirt-47"
> + "id": "libvirt-48"
> }
>
> {
> @@ -15195,11 +15260,11 @@
> }
> }
> },
> - "id": "libvirt-48"
> + "id": "libvirt-49"
> }
>
> {
> - "id": "libvirt-49",
> + "id": "libvirt-50",
> "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 f7f102f..ec5c396 100644
> --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
> +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
> @@ -146,9 +146,10 @@
> <flag name='disk-share-rw'/>
> <flag name='iscsi.password-secret'/>
> <flag name='dump-completed'/>
> + <flag name='virtio-gpu-ccw'/>
> <version>2011000</version>
> <kvmVersion>0</kvmVersion>
> - <microcodeVersion>341724</microcodeVersion>
> + <microcodeVersion>342885</microcodeVersion>
<sigh> - I assume this is because someone updated something after the
original pull of the 2.11 caps...
You used the VIR_TEST_REGENERATE_OUTPUT=1 to create too, right?
John
> <package></package>
> <arch>s390x</arch>
> <hostCPU type='kvm' model='z14-base' migratability='no'>
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Hi Jon,
On 03/16/2018 09:38 AM, John Ferlan wrote:
>
>
> On 03/08/2018 11:07 AM, Farhan Ali wrote:
>> QEMU on S390 (since v2.11) can support the virtio-gpu-ccw device,
>> so on S390 assign CCW address for a video device.
>>
>> Also introduce a new capability for the virtio-gpu-ccw
>> device.
>>
>> Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
>> Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
>> ---
>> docs/formatdomain.html.in | 3 +
>> src/qemu/qemu_capabilities.c | 5 ++
>> src/qemu/qemu_capabilities.h | 1 +
>> src/qemu/qemu_command.c | 18 ++++-
>> src/qemu/qemu_domain.c | 2 +-
>> src/qemu/qemu_domain_address.c | 8 +++
>> src/qemu/qemu_process.c | 5 +-
>> .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 83 +++++++++++++++++++---
>> tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 3 +-
>> 9 files changed, 114 insertions(+), 14 deletions(-)
>>
>
> First off - other upstream changes has caused this to not be able to
> apply w/ git am -3 - so once patch1 is pushed, you'll need to rework and
> repost the series (hopefully this time you won't have the strange split
> with a CC address having "--dry-run" appended to an email ;-)
>
Ah yes, it was silly of me! I didn't realize till it was too late :)
> Since I cannot compile this one - I'll just be able to go through
> visually and note a few things... Primarily though - this particular
> patch should be split up a bit more. Separate out the capabilities into
> their own separate "capabilities" patch and the second patch becomes a
> "functionality" patch.
>
Sure, I will move capabilities into a different patch.
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index 6fd2189..0908709 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -6484,6 +6484,9 @@ qemu-kvm -net nic,model=? /dev/null
>> <dd>
>> The optional <code>address</code> sub-element can be used to
>> tie the video device to a particular PCI slot.
>> + On S390, <code>address</code> can be used to provide the
>> + CCW address for the video device (<span class="since">
>> + since 4.2.0</span>).
>> </dd>
>>
>> <dt><code>driver</code></dt>
>
>
> ... The above would go with the "functionality" patch and the next few
> with a "capability" patch...
>
>> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
>> index b5eb8cf..9db4c31 100644
>> --- a/src/qemu/qemu_capabilities.c
>> +++ b/src/qemu/qemu_capabilities.c
>> @@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
>> "pl011",
>> "machine.pseries.max-cpu-compat",
>> "dump-completed",
>> + "virtio-gpu-ccw",
>> );
>>
>>
>> @@ -1694,6 +1695,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
>> { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
>> { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
>> { "pl011", QEMU_CAPS_DEVICE_PL011 },
>> + { "virtio-gpu-ccw", QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
>> };
>>
>> static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
>> @@ -1932,6 +1934,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
>> { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
>> ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
>> QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
>> + { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu,
>> + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu),
>> + QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
>> };
>>
>> struct virQEMUCapsPropTypeObjects {
>> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
>> index c2ec2be..b4852e5 100644
>> --- a/src/qemu/qemu_capabilities.h
>> +++ b/src/qemu/qemu_capabilities.h
>> @@ -444,6 +444,7 @@ typedef enum {
>> QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
>> QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */
>> QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */
>> + QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW, /* -device virtio-gpu-ccw */
>>
>> QEMU_CAPS_LAST /* this must always be the last item */
>> } virQEMUCapsFlags;
>
> ... Above here with the "capability" patch and below with the
> "functionality" patch...
>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index fa0aa5d..ba63670 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c
>> @@ -132,7 +132,7 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDEO_TYPE_LAST,
>> "", /* don't support vbox */
>> "qxl",
>> "", /* don't support parallels */
>> - "virtio-gpu-pci",
>> + "virtio-gpu",
>> "" /* don't support gop */);
>>
>> VIR_ENUM_DECL(qemuSoundCodec)
>> @@ -4262,7 +4262,21 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
>> goto error;
>> }
>>
>> - virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
>> + if (STREQ(model, "virtio-gpu")) {
>
> Rather than STREQ comparison perhaps:
>
> if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
>
> since that's what derives "virtio-gpu" for model anyway.
VIR_DOMAIN_VIDEO_TYPE_VIRTIO can be both "virtio-gpu"
(qemuDeviceVideoSecondary) and "virtio-vga" (qemuDeviceVideo), so that's
why I didn't use video.type check.
>
>> + switch (video->info.type) {
>> + case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
>> + virBufferAsprintf(&buf, "%s-pci", model);
>> + break;
>> +
>> + case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
>> + virBufferAsprintf(&buf, "%s-ccw", model);
>> + break;
>> + }
>
> Let's not use a switch here - as that implies there could be more than
> just two values in the '.type' field... I'd go with:
Sure.
>
> if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
> virBufferAsprintf(&buf, "%s-ccw", model);
> else
> virBufferAsprintf(&buf, "%s-pci", model);
>
>
>> + } else {
>> + virBufferAsprintf(&buf, "%s", model);
>> + }
>> +
>> + virBufferAsprintf(&buf, ",id=%s", video->info.alias);
>>
>> if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
>> virBufferAsprintf(&buf, ",virgl=%s",
>> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
>> index ee02ecd..b47b4d1 100644
>> --- a/src/qemu/qemu_domain.c
>> +++ b/src/qemu/qemu_domain.c
>> @@ -5156,7 +5156,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
>> if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
>> if ARCH_IS_PPC64(def->os.arch)
>> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
>> - else if (qemuDomainIsVirt(def))
>> + else if (qemuDomainIsVirt(def) || ARCH_IS_S390(def->os.arch))
>> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
>> else
>> dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
>> diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
>> index ae49cf2..49a293e 100644
>> --- a/src/qemu/qemu_domain_address.c
>> +++ b/src/qemu/qemu_domain_address.c
>> @@ -308,6 +308,14 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
>> }
>> }
>>
>
> There's a comment at the top of the function that could add "video" to
> the list as well...
>
>> + for (i = 0; i < def->nvideos; i++) {
>> + virDomainVideoDefPtr video = def->videos[i];
>> +
>> + if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
>> + video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO)
>> + video->info.type = type;
>> + }
>> +
>> for (i = 0; i < def->ninputs; i++) {
>> if (def->inputs[i]->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
>> def->inputs[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
>> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
>> index 57c06c7..1afb71f 100644
>> --- a/src/qemu/qemu_process.c
>> +++ b/src/qemu/qemu_process.c
>> @@ -4778,7 +4778,10 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
>> (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
>> !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) ||
>> (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
>> - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) {
>> + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) ||
>> + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
>> + video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
>> + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW))) {
>> virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> _("this QEMU does not support '%s' video device"),
>> virDomainVideoTypeToString(video->type));
>
>
> ... The rest would go with the capabilities patch....
>
>> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
>> index 6768937..53c4804 100644
>> --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
>> +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
>> @@ -3515,6 +3515,71 @@
>> {
>> "return": [
>> {
>> + "name": "notify_on_empty",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "ioeventfd",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "any_layout",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "devno",
>> + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
>> + "type": "str"
>> + },
>> + {
>> + "name": "indirect_desc",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "event_idx",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "virtio-backend",
>> + "type": "child<virtio-gpu-device>"
>> + },
>> + {
>> + "name": "yres",
>> + "type": "uint32"
>> + },
>> + {
>> + "name": "xres",
>> + "type": "uint32"
>> + },
>> + {
>> + "name": "iommu_platform",
>> + "description": "on/off",
>> + "type": "bool"
>> + },
>> + {
>> + "name": "max_outputs",
>> + "type": "uint32"
>> + },
>> + {
>> + "name": "max_hostmem",
>> + "type": "size"
>> + },
>> + {
>> + "name": "max_revision",
>> + "type": "uint32"
>> + }
>> + ],
>> + "id": "libvirt-41"
>> +}
>> +
>> +{
>> + "return": [
>> + {
>> "hotpluggable-cpus": true,
>> "name": "s390-ccw-virtio-2.7",
>> "cpu-max": 248
>> @@ -3562,7 +3627,7 @@
>> "cpu-max": 248
>> }
>> ],
>> - "id": "libvirt-41"
>> + "id": "libvirt-42"
>> }
>>
>> {
>> @@ -4096,20 +4161,20 @@
>> "migration-safe": true
>> }
>> ],
>> - "id": "libvirt-42"
>> + "id": "libvirt-43"
>> }
>>
>> {
>> "return": [
>> ],
>> - "id": "libvirt-43"
>> + "id": "libvirt-44"
>> }
>>
>> {
>> "return": [
>> "emulator"
>> ],
>> - "id": "libvirt-44"
>> + "id": "libvirt-45"
>> }
>>
>> {
>> @@ -5230,7 +5295,7 @@
>> "option": "drive"
>> }
>> ],
>> - "id": "libvirt-45"
>> + "id": "libvirt-46"
>> }
>>
>> {
>> @@ -5288,7 +5353,7 @@
>> "capability": "x-multifd"
>> }
>> ],
>> - "id": "libvirt-46"
>> + "id": "libvirt-47"
>> }
>>
>> {
>> @@ -15156,7 +15221,7 @@
>> "meta-type": "object"
>> }
>> ],
>> - "id": "libvirt-47"
>> + "id": "libvirt-48"
>> }
>>
>> {
>> @@ -15195,11 +15260,11 @@
>> }
>> }
>> },
>> - "id": "libvirt-48"
>> + "id": "libvirt-49"
>> }
>>
>> {
>> - "id": "libvirt-49",
>> + "id": "libvirt-50",
>> "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 f7f102f..ec5c396 100644
>> --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
>> +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
>> @@ -146,9 +146,10 @@
>> <flag name='disk-share-rw'/>
>> <flag name='iscsi.password-secret'/>
>> <flag name='dump-completed'/>
>> + <flag name='virtio-gpu-ccw'/>
>> <version>2011000</version>
>> <kvmVersion>0</kvmVersion>
>> - <microcodeVersion>341724</microcodeVersion>
>> + <microcodeVersion>342885</microcodeVersion>
>
> <sigh> - I assume this is because someone updated something after the
> original pull of the 2.11 caps...
>
> You used the VIR_TEST_REGENERATE_OUTPUT=1 to create too, right?
>
> John
>
>> <package></package>
>> <arch>s390x</arch>
>> <hostCPU type='kvm' model='z14-base' migratability='no'>
>>
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2025 Red Hat, Inc.