* [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
@ 2020-11-25 10:54 Thomas Huth
2020-11-26 18:22 ` Cornelia Huck
2020-12-14 8:53 ` Thomas Huth
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Huth @ 2020-11-25 10:54 UTC (permalink / raw)
To: qemu-devel, Michael Roth; +Cc: qemu-s390x, Cornelia Huck
We need the CCW address on the libvirt side to correctly identify
the disk, so add this information to the GuestDiskAddress on s390x.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
qga/qapi-schema.json | 19 ++++++++++++++++++-
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c089e38120..5aa5eff84f 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1029,6 +1029,38 @@ static bool build_guest_fsinfo_for_nonpci_virtio(char const *syspath,
return true;
}
+/*
+ * Store disk device info for CCW devices (s390x channel I/O devices).
+ * Returns true if information has been stored, or false for failure.
+ */
+static bool build_guest_fsinfo_for_ccw_dev(char const *syspath,
+ GuestDiskAddress *disk,
+ Error **errp)
+{
+ unsigned int cssid, ssid, subchno, devno;
+ char *p;
+
+ p = strstr(syspath, "/devices/css");
+ if (!p || sscanf(p + 12, "%*x/%x.%x.%x/%*x.%*x.%x/",
+ &cssid, &ssid, &subchno, &devno) < 4) {
+ g_debug("could not parse ccw device sysfs path: %s", syspath);
+ return false;
+ }
+
+ disk->has_ccw_address = true;
+ disk->ccw_address = g_new0(GuestCCWAddress, 1);
+ disk->ccw_address->cssid = cssid;
+ disk->ccw_address->ssid = ssid;
+ disk->ccw_address->subchno = subchno;
+ disk->ccw_address->devno = devno;
+
+ if (strstr(p, "/virtio")) {
+ build_guest_fsinfo_for_nonpci_virtio(syspath, disk, errp);
+ }
+
+ return true;
+}
+
/* Store disk device info specified by @sysfs into @fs */
static void build_guest_fsinfo_for_real_device(char const *syspath,
GuestFilesystemInfo *fs,
@@ -1081,6 +1113,8 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
if (strstr(syspath, "/devices/pci")) {
has_hwinf = build_guest_fsinfo_for_pci_dev(syspath, disk, errp);
+ } else if (strstr(syspath, "/devices/css")) {
+ has_hwinf = build_guest_fsinfo_for_ccw_dev(syspath, disk, errp);
} else if (strstr(syspath, "/virtio")) {
has_hwinf = build_guest_fsinfo_for_nonpci_virtio(syspath, disk, errp);
} else {
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 3b3d1d0bd9..8be84b56e9 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -846,6 +846,21 @@
'data': {'domain': 'int', 'bus': 'int',
'slot': 'int', 'function': 'int'} }
+##
+# @GuestCCWAddress:
+#
+# @cssid: channel subsystem image id
+# @ssid: subchannel set id
+# @devno: device number
+#
+# Since: 6.0
+##
+{ 'struct': 'GuestCCWAddress',
+ 'data': {'cssid': 'int',
+ 'ssid': 'int',
+ 'subchno': 'int',
+ 'devno': 'int'} }
+
##
# @GuestDiskAddress:
#
@@ -856,6 +871,7 @@
# @unit: unit id
# @serial: serial number (since: 3.1)
# @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
+# @ccw-address: CCW address on s390x (since: 6.0)
#
# Since: 2.2
##
@@ -863,7 +879,8 @@
'data': {'pci-controller': 'GuestPCIAddress',
'bus-type': 'GuestDiskBusType',
'bus': 'int', 'target': 'int', 'unit': 'int',
- '*serial': 'str', '*dev': 'str'} }
+ '*serial': 'str', '*dev': 'str',
+ '*ccw-address': 'GuestCCWAddress'} }
##
# @GuestDiskInfo:
--
2.18.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
2020-11-25 10:54 [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data Thomas Huth
@ 2020-11-26 18:22 ` Cornelia Huck
2020-12-14 8:53 ` Thomas Huth
1 sibling, 0 replies; 6+ messages in thread
From: Cornelia Huck @ 2020-11-26 18:22 UTC (permalink / raw)
To: Thomas Huth; +Cc: Michael Roth, qemu-s390x, qemu-devel
On Wed, 25 Nov 2020 11:54:17 +0100
Thomas Huth <thuth@redhat.com> wrote:
> We need the CCW address on the libvirt side to correctly identify
> the disk, so add this information to the GuestDiskAddress on s390x.
>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
> qga/qapi-schema.json | 19 ++++++++++++++++++-
> 2 files changed, 52 insertions(+), 1 deletion(-)
>
(...)
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index 3b3d1d0bd9..8be84b56e9 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -846,6 +846,21 @@
> 'data': {'domain': 'int', 'bus': 'int',
> 'slot': 'int', 'function': 'int'} }
>
> +##
> +# @GuestCCWAddress:
> +#
> +# @cssid: channel subsystem image id
> +# @ssid: subchannel set id
You're missing subchno here.
> +# @devno: device number
> +#
> +# Since: 6.0
> +##
> +{ 'struct': 'GuestCCWAddress',
> + 'data': {'cssid': 'int',
> + 'ssid': 'int',
> + 'subchno': 'int',
> + 'devno': 'int'} }
> +
> ##
> # @GuestDiskAddress:
> #
(...)
Otherwise LGTM.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
2020-11-25 10:54 [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data Thomas Huth
2020-11-26 18:22 ` Cornelia Huck
@ 2020-12-14 8:53 ` Thomas Huth
2020-12-16 12:40 ` Cornelia Huck
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2020-12-14 8:53 UTC (permalink / raw)
To: qemu-devel, Michael Roth; +Cc: qemu-s390x, Cornelia Huck
On 25/11/2020 11.54, Thomas Huth wrote:
> We need the CCW address on the libvirt side to correctly identify
> the disk, so add this information to the GuestDiskAddress on s390x.
>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
> qga/qapi-schema.json | 19 ++++++++++++++++++-
> 2 files changed, 52 insertions(+), 1 deletion(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index c089e38120..5aa5eff84f 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -1029,6 +1029,38 @@ static bool build_guest_fsinfo_for_nonpci_virtio(char const *syspath,
> return true;
> }
>
> +/*
> + * Store disk device info for CCW devices (s390x channel I/O devices).
> + * Returns true if information has been stored, or false for failure.
> + */
> +static bool build_guest_fsinfo_for_ccw_dev(char const *syspath,
> + GuestDiskAddress *disk,
> + Error **errp)
> +{
> + unsigned int cssid, ssid, subchno, devno;
> + char *p;
> +
> + p = strstr(syspath, "/devices/css");
> + if (!p || sscanf(p + 12, "%*x/%x.%x.%x/%*x.%*x.%x/",
> + &cssid, &ssid, &subchno, &devno) < 4) {
> + g_debug("could not parse ccw device sysfs path: %s", syspath);
> + return false;
> + }
> +
> + disk->has_ccw_address = true;
> + disk->ccw_address = g_new0(GuestCCWAddress, 1);
> + disk->ccw_address->cssid = cssid;
> + disk->ccw_address->ssid = ssid;
> + disk->ccw_address->subchno = subchno;
> + disk->ccw_address->devno = devno;
> +
> + if (strstr(p, "/virtio")) {
> + build_guest_fsinfo_for_nonpci_virtio(syspath, disk, errp);
> + }
> +
> + return true;
> +}
> +
> /* Store disk device info specified by @sysfs into @fs */
> static void build_guest_fsinfo_for_real_device(char const *syspath,
> GuestFilesystemInfo *fs,
> @@ -1081,6 +1113,8 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
>
> if (strstr(syspath, "/devices/pci")) {
> has_hwinf = build_guest_fsinfo_for_pci_dev(syspath, disk, errp);
> + } else if (strstr(syspath, "/devices/css")) {
> + has_hwinf = build_guest_fsinfo_for_ccw_dev(syspath, disk, errp);
> } else if (strstr(syspath, "/virtio")) {
> has_hwinf = build_guest_fsinfo_for_nonpci_virtio(syspath, disk, errp);
> } else {
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index 3b3d1d0bd9..8be84b56e9 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -846,6 +846,21 @@
> 'data': {'domain': 'int', 'bus': 'int',
> 'slot': 'int', 'function': 'int'} }
>
> +##
> +# @GuestCCWAddress:
> +#
> +# @cssid: channel subsystem image id
> +# @ssid: subchannel set id
> +# @devno: device number
> +#
> +# Since: 6.0
> +##
> +{ 'struct': 'GuestCCWAddress',
> + 'data': {'cssid': 'int',
> + 'ssid': 'int',
> + 'subchno': 'int',
> + 'devno': 'int'} }
> +
> ##
> # @GuestDiskAddress:
> #
> @@ -856,6 +871,7 @@
> # @unit: unit id
> # @serial: serial number (since: 3.1)
> # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
> +# @ccw-address: CCW address on s390x (since: 6.0)
> #
> # Since: 2.2
> ##
> @@ -863,7 +879,8 @@
> 'data': {'pci-controller': 'GuestPCIAddress',
> 'bus-type': 'GuestDiskBusType',
> 'bus': 'int', 'target': 'int', 'unit': 'int',
> - '*serial': 'str', '*dev': 'str'} }
> + '*serial': 'str', '*dev': 'str',
> + '*ccw-address': 'GuestCCWAddress'} }
>
> ##
> # @GuestDiskInfo:
>
Ping!
Michael, any comments on this, or do you think that it ready to go?
Thanks,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
2020-12-14 8:53 ` Thomas Huth
@ 2020-12-16 12:40 ` Cornelia Huck
2020-12-16 12:44 ` Thomas Huth
2020-12-16 13:35 ` Michael Roth
0 siblings, 2 replies; 6+ messages in thread
From: Cornelia Huck @ 2020-12-16 12:40 UTC (permalink / raw)
To: Thomas Huth; +Cc: Michael Roth, qemu-s390x, qemu-devel
On Mon, 14 Dec 2020 09:53:21 +0100
Thomas Huth <thuth@redhat.com> wrote:
> On 25/11/2020 11.54, Thomas Huth wrote:
> > We need the CCW address on the libvirt side to correctly identify
> > the disk, so add this information to the GuestDiskAddress on s390x.
> >
> > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> > qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
> > qga/qapi-schema.json | 19 ++++++++++++++++++-
> > 2 files changed, 52 insertions(+), 1 deletion(-)
> Ping!
>
> Michael, any comments on this, or do you think that it ready to go?
If nobody objects, I can also merge this (or rather the v2 of this
patch) through the s390x tree.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
2020-12-16 12:40 ` Cornelia Huck
@ 2020-12-16 12:44 ` Thomas Huth
2020-12-16 13:35 ` Michael Roth
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2020-12-16 12:44 UTC (permalink / raw)
To: Cornelia Huck; +Cc: Michael Roth, qemu-s390x, qemu-devel
On 16/12/2020 13.40, Cornelia Huck wrote:
> On Mon, 14 Dec 2020 09:53:21 +0100
> Thomas Huth <thuth@redhat.com> wrote:
>
>> On 25/11/2020 11.54, Thomas Huth wrote:
>>> We need the CCW address on the libvirt side to correctly identify
>>> the disk, so add this information to the GuestDiskAddress on s390x.
>>>
>>> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>> qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
>>> qga/qapi-schema.json | 19 ++++++++++++++++++-
>>> 2 files changed, 52 insertions(+), 1 deletion(-)
>
>> Ping!
>>
>> Michael, any comments on this, or do you think that it ready to go?
>
> If nobody objects, I can also merge this (or rather the v2 of this
> patch) through the s390x tree.
Oh, right, I pinged on the wrong version, sorry! So, Cornelia, if you could
pick up v2, that would be great! I think the patch should not have any
effects on non-s390x architectures, so it should be ok if it goes via the
s390x tree.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data
2020-12-16 12:40 ` Cornelia Huck
2020-12-16 12:44 ` Thomas Huth
@ 2020-12-16 13:35 ` Michael Roth
1 sibling, 0 replies; 6+ messages in thread
From: Michael Roth @ 2020-12-16 13:35 UTC (permalink / raw)
To: Cornelia Huck, Thomas Huth; +Cc: qemu-s390x, qemu-devel
Quoting Cornelia Huck (2020-12-16 06:40:39)
> On Mon, 14 Dec 2020 09:53:21 +0100
> Thomas Huth <thuth@redhat.com> wrote:
>
> > On 25/11/2020 11.54, Thomas Huth wrote:
> > > We need the CCW address on the libvirt side to correctly identify
> > > the disk, so add this information to the GuestDiskAddress on s390x.
> > >
> > > Buglink: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.redhat.com%2Fshow_bug.cgi%3Fid%3D1755075&data=04%7C01%7Cmichael.roth%40amd.com%7C076a9f00e76749e8885508d8a1bfd02b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637437192500502101%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=naAS%2B%2FEl%2BCRwkj%2Fbe0tVEI%2BfAHTQGgZ%2FcoS21pr4%2B3Y%3D&reserved=0
> > > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > > ---
> > > qga/commands-posix.c | 34 ++++++++++++++++++++++++++++++++++
> > > qga/qapi-schema.json | 19 ++++++++++++++++++-
> > > 2 files changed, 52 insertions(+), 1 deletion(-)
>
> > Ping!
> >
> > Michael, any comments on this, or do you think that it ready to go?
>
> If nobody objects, I can also merge this (or rather the v2 of this
> patch) through the s390x tree.
>
No objections here. v2 looks good. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-16 13:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-25 10:54 [PATCH for-6.0] qga/commands-posix: Send CCW address on s390x with the fsinfo data Thomas Huth
2020-11-26 18:22 ` Cornelia Huck
2020-12-14 8:53 ` Thomas Huth
2020-12-16 12:40 ` Cornelia Huck
2020-12-16 12:44 ` Thomas Huth
2020-12-16 13:35 ` Michael Roth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).