From nobody Sun Feb 8 19:40:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606302432; cv=none; d=zohomail.com; s=zohoarc; b=M85s3CuFovh6NALiWo1dDnshSCRGVDuY6qW/VQgT2Ojv1rgpz60bwkhqNRtKHL7DZtNZfkGHz3xxIixN4vtCMiALL35dh3tLjPxSHjhPUdMtvfH/o4APcUogcNFDWpSUlGQE2+1Mrs+JocadSC1Q2r5gKbQP7ugJ3sLHFpwMoE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606302432; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=w+G47sO31iANHcHd6/oZOWEHjUwoB6C8I0t2dfgmrjU=; b=ZCQqWTBabrlOn1OD4zhJCFJwZjjzWPMUnnnvAxGgTTuIyWl2rR1D40uEUgI+sunNtOLfgOPmv7KMJ9of/UIN+Zmz4Cc0HkoQp71sgxrqACiTA3boQ/XtWtmO8qi8ykZIvDbMp/p+KOOKWvDugjU8SrFPLHLatie6zDRi7VI5+ks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16063024320339.851776591653675; Wed, 25 Nov 2020 03:07:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-XNeZWVD9OouMzsa6l0ZB9A-1; Wed, 25 Nov 2020 06:07:08 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A3E080365B; Wed, 25 Nov 2020 11:07:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E5B719D6C; Wed, 25 Nov 2020 11:07:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E8C10180954D; Wed, 25 Nov 2020 11:06:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0APB6vBt015754 for ; Wed, 25 Nov 2020 06:06:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 030BF5D71D; Wed, 25 Nov 2020 11:06:57 +0000 (UTC) Received: from thuth.com (ovpn-112-81.ams2.redhat.com [10.36.112.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF42B5D6AC; Wed, 25 Nov 2020 11:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606302431; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=w+G47sO31iANHcHd6/oZOWEHjUwoB6C8I0t2dfgmrjU=; b=heBYxMVY4VO+BsNofaiOWPVSkAmdipYBGoMmVNAS6unltdOQLzGom6/o92xtWzzNzheBWv qTKEGn5tK47oGNutg2W2G7qaiRp79O/gHrAIdgKXMHsl6olMhc0uG2nkfgpB2oxIrmQHeA o4RjONHjxJoDgq779ahIvsNPIURlvMo= X-MC-Unique: XNeZWVD9OouMzsa6l0ZB9A-1 From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu: agent: Store CCW address in qemuAgentDiskInfo if provided by the guest Date: Wed, 25 Nov 2020 12:06:46 +0100 Message-Id: <20201125110648.380802-2-thuth@redhat.com> In-Reply-To: <20201125110648.380802-1-thuth@redhat.com> References: <20201125110648.380802-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: fiuczy@linux.ibm.com, cohuck@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Michal Privoznik --- src/qemu/qemu_agent.c | 11 +++++++++++ src/qemu/qemu_agent.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 230253d404..d7ad20376c 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -1868,6 +1868,7 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks, for (i =3D 0; i < fsinfo->ndisks; i++) { virJSONValuePtr jsondisk =3D virJSONValueArrayGet(jsondisks, i); virJSONValuePtr pci; + virJSONValuePtr ccw; qemuAgentDiskInfoPtr disk; const char *val; =20 @@ -1916,6 +1917,16 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisk= s, 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 =3D virJSONValueObjectGet(jsondisk, "ccw-address"))) { + disk->has_ccw_address =3D true; + GET_DISK_ADDR(ccw, &disk->ccw_addr.cssid, "cssid"); + if (disk->ccw_addr.cssid =3D=3D 0) /* Guest CSSID 0 is 0xfe o= n host */ + disk->ccw_addr.cssid =3D 0xfe; + GET_DISK_ADDR(ccw, &disk->ccw_addr.ssid, "ssid"); + GET_DISK_ADDR(ccw, &disk->ccw_addr.devno, "devno"); + } + #undef GET_DISK_ADDR } =20 diff --git a/src/qemu/qemu_agent.h b/src/qemu/qemu_agent.h index 7cbab489ec..37b482f3b2 100644 --- a/src/qemu/qemu_agent.h +++ b/src/qemu/qemu_agent.h @@ -77,6 +77,8 @@ struct _qemuAgentDiskInfo { unsigned int target; unsigned int unit; char *devnode; + bool has_ccw_address; + virDomainDeviceCCWAddress ccw_addr; }; =20 typedef struct _qemuAgentFSInfo qemuAgentFSInfo; --=20 2.18.4