[PATCH 1/3] qemu: agent: Store CCW address in qemuAgentDiskInfo if provided by the guest

Cornelia Huck cohuck at redhat.com
Fri Nov 27 10:07:55 UTC 2020


On Wed, 25 Nov 2020 12:06:46 +0100
Thomas Huth <thuth at redhat.com> wrote:

> Newer versions of the QEMU guest agent will provide the CCW address
> of devices on s390x. Store this information in the qemuAgentDiskInfo
> so that we can use this later.
> 
> We also map the CSSID 0 from the guest to the value 0xfe on the host,
> see https://www.qemu.org/docs/master/system/s390x/css.html for details.
> 
> Signed-off-by: Thomas Huth <thuth at redhat.com>
> ---
>  src/qemu/qemu_agent.c | 11 +++++++++++
>  src/qemu/qemu_agent.h |  2 ++
>  2 files changed, 13 insertions(+)
> 

(...)

> @@ -1916,6 +1917,16 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks,
>          GET_DISK_ADDR(pci, &disk->pci_controller.bus, "bus");
>          GET_DISK_ADDR(pci, &disk->pci_controller.slot, "slot");
>          GET_DISK_ADDR(pci, &disk->pci_controller.function, "function");
> +
> +        if ((ccw = virJSONValueObjectGet(jsondisk, "ccw-address"))) {
> +            disk->has_ccw_address = true;
> +            GET_DISK_ADDR(ccw, &disk->ccw_addr.cssid, "cssid");
> +            if (disk->ccw_addr.cssid == 0)  /* Guest CSSID 0 is 0xfe on host */
> +                disk->ccw_addr.cssid = 0xfe;

This will be true for any guest that doesn't support MCSS-E. I don't
see any MCSS-E enablement coming up in the foreseeable future (in fact,
I get the impression that this feature is rather dead, and QEMU remains
the only implementation anyway), so this should be fine.

> +            GET_DISK_ADDR(ccw, &disk->ccw_addr.ssid, "ssid");
> +            GET_DISK_ADDR(ccw, &disk->ccw_addr.devno, "devno");
> +        }
> +
>  #undef GET_DISK_ADDR
>      }
>  

(...)




More information about the libvir-list mailing list