From patchwork Fri Feb 9 09:24:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 871263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zd8sV1gzNz9sPk for ; Fri, 9 Feb 2018 20:29:34 +1100 (AEDT) Received: from localhost ([::1]:52930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek4zs-0004dT-8I for incoming@patchwork.ozlabs.org; Fri, 09 Feb 2018 04:29:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek4w9-0001rO-LH for qemu-devel@nongnu.org; Fri, 09 Feb 2018 04:25:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ek4w7-0005tf-Qo for qemu-devel@nongnu.org; Fri, 09 Feb 2018 04:25:41 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33048 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ek4w7-0005tJ-L1; Fri, 09 Feb 2018 04:25:39 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 3C4467D679; Fri, 9 Feb 2018 09:25:39 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D1D810083A8; Fri, 9 Feb 2018 09:25:36 +0000 (UTC) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 9 Feb 2018 10:24:58 +0100 Message-Id: <20180209092524.31348-4-cohuck@redhat.com> In-Reply-To: <20180209092524.31348-1-cohuck@redhat.com> References: <20180209092524.31348-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 09 Feb 2018 09:25:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 09 Feb 2018 09:25:39 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/29] s390x/flic: simplify flic initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand This makes it clearer, which device is used for which accelerator. Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20180129125623.21729-3-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/intc/s390_flic.c | 7 +++++-- hw/intc/s390_flic_kvm.c | 12 ------------ include/hw/s390x/s390_flic.h | 9 --------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 6eaf178d79..fc244fe775 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -40,8 +40,11 @@ void s390_flic_init(void) { DeviceState *dev; - dev = s390_flic_kvm_create(); - if (!dev) { + if (kvm_enabled()) { + dev = qdev_create(NULL, TYPE_KVM_S390_FLIC); + object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC, + OBJECT(dev), NULL); + } else { dev = qdev_create(NULL, TYPE_QEMU_S390_FLIC); object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC, OBJECT(dev), NULL); diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index d208cb81c4..0cb5feab0c 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -35,18 +35,6 @@ typedef struct KVMS390FLICState { bool clear_io_supported; } KVMS390FLICState; -DeviceState *s390_flic_kvm_create(void) -{ - DeviceState *dev = NULL; - - if (kvm_enabled()) { - dev = qdev_create(NULL, TYPE_KVM_S390_FLIC); - object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC, - OBJECT(dev), NULL); - } - return dev; -} - /** * flic_get_all_irqs - store all pending irqs in buffer * @buf: pointer to buffer which is passed to kernel diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index 7aab6ef7f0..5b00e936fa 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -91,13 +91,4 @@ void s390_flic_init(void); S390FLICState *s390_get_flic(void); bool ais_needed(void *opaque); -#ifdef CONFIG_KVM -DeviceState *s390_flic_kvm_create(void); -#else -static inline DeviceState *s390_flic_kvm_create(void) -{ - return NULL; -} -#endif - #endif /* HW_S390_FLIC_H */