From patchwork Mon Feb 27 11:35:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 656944 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2299378wrb; Mon, 27 Feb 2023 03:37:32 -0800 (PST) X-Google-Smtp-Source: AK7set9bq13UhD1wT2WYGHoRWv5X6UOJ0N23BOrdFJLFqoOHl0c2ZrZAegemDPZGE/VsQOogguNh X-Received: by 2002:a05:622a:412:b0:3bc:e576:c177 with SMTP id n18-20020a05622a041200b003bce576c177mr29786265qtx.28.1677497852461; Mon, 27 Feb 2023 03:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497852; cv=none; d=google.com; s=arc-20160816; b=f/9FaqEe1ylMOxkCo1DASjj4bWnak6OsaHOVRphnd1ojdm7B59/UOF4Dbjva1aPdhN rIyGFuWYmm6T99z8EldracbsAm1FbGI2lPmkAf09o+Q60os1vL+gOVVOPwyf7plpr8d6 vZa+pIviPjXIXFFxoQgSTJmD3QQgupv8PM+GP8Mf0s4r0+FjcM5xNotsPjoD8SvutTqG tM6vr4VCzFgY20a8MBheOU5bLd7T43kdD3SnpSIQUII9gCvJHsjFgGA+Gsl1eG3k2dir 4dC6vCK92FieMVbYv7PrqEKcHp0e4u70rKxdRyPbZiVqGhaE0jcgj3eIWRAvbRefzgh2 jSlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Jl85V4yF+bE/uUwIgiylKeXfLeedtsatGAppAmJc05g=; b=VWKc6H5qfNtaJVy5qLv2WbkiC5eLy1WHg0ZBnN5UFlU57++F45X1Yq1xsgwCwhjSqF pH8lnfdZRvKqSBCPRAGwn6sBFQttDlNRmE2krRpIFn5OQiRDQloIRgKl45wglfR/+avE ZLE2d08J8o92mU9TkhoffABpggJ9dIbV0AmpGfEjLQpcolSaX7j2xMD1ExNkLQkgYcE1 7tulXwVPjLvddBxSyJCKco8y7wRE23ylxiRW+Wv55QQSk1YZPYB/RtM9VxZ1EClYuQn7 93G4qVYFkVH9S/h9Qe/WvTO6SpnpPFmK9UemvGb7RPm0BA/6qrKTdtWctGFTgm0iByIl 4Jkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JjeK7aam; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u27-20020a37ab1b000000b0073128e8f63esi5702992qke.534.2023.02.27.03.37.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 03:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JjeK7aam; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWboB-0005W0-Tw; Mon, 27 Feb 2023 06:36:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWbo7-0005R3-Ud for qemu-devel@nongnu.org; Mon, 27 Feb 2023 06:36:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWbo2-0005ek-5H for qemu-devel@nongnu.org; Mon, 27 Feb 2023 06:36:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677497793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jl85V4yF+bE/uUwIgiylKeXfLeedtsatGAppAmJc05g=; b=JjeK7aamDUYbLdlMJFeO1piG8JwLNW2eU2KgRbLlpEhEXjtlUlpCyRFBP+y8VqcTGezx3z CKoa2icPkcsvxKkwxJIZ4ihyOyQb3wI3eiVshCR6WPZPLr4SH/OBAxUawjjuFWYUD19AoM j6NEVjtrpTvJ02IVv8vlvfoyxpec3T4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-184-Ur4vv3CWPYyYHmZYtrF-MQ-1; Mon, 27 Feb 2023 06:36:29 -0500 X-MC-Unique: Ur4vv3CWPYyYHmZYtrF-MQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7B7F85CBE2; Mon, 27 Feb 2023 11:36:28 +0000 (UTC) Received: from thuth.com (unknown [10.45.227.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id C23131121314; Mon, 27 Feb 2023 11:36:27 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Farman Subject: [PULL 04/33] hw/vfio/ccw: Use intermediate S390CCWDevice variable Date: Mon, 27 Feb 2023 12:35:52 +0100 Message-Id: <20230227113621.58468-5-thuth@redhat.com> In-Reply-To: <20230227113621.58468-1-thuth@redhat.com> References: <20230227113621.58468-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 'cdev' is VFIOCCWDevice's private parent object. Access it using the S390_CCW_DEVICE() QOM macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Farman Message-Id: <20230213170145.45666-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- hw/vfio/ccw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 503de94ce1..2c20e3c202 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -588,9 +588,10 @@ static void vfio_ccw_put_device(VFIOCCWDevice *vcdev) static void vfio_ccw_get_device(VFIOGroup *group, VFIOCCWDevice *vcdev, Error **errp) { - char *name = g_strdup_printf("%x.%x.%04x", vcdev->cdev.hostid.cssid, - vcdev->cdev.hostid.ssid, - vcdev->cdev.hostid.devid); + S390CCWDevice *cdev = S390_CCW_DEVICE(vcdev); + char *name = g_strdup_printf("%x.%x.%04x", cdev->hostid.cssid, + cdev->hostid.ssid, + cdev->hostid.devid); VFIODevice *vbasedev; QLIST_FOREACH(vbasedev, &group->device_list, next) { @@ -611,7 +612,7 @@ static void vfio_ccw_get_device(VFIOGroup *group, VFIOCCWDevice *vcdev, */ vcdev->vdev.ram_block_discard_allowed = true; - if (vfio_get_device(group, vcdev->cdev.mdevid, &vcdev->vdev, errp)) { + if (vfio_get_device(group, cdev->mdevid, &vcdev->vdev, errp)) { goto out_err; }