From patchwork Fri Oct 19 05:20:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 986528 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="I7au/dfp"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42bvQs2Sj1z9sCQ for ; Fri, 19 Oct 2018 16:21:25 +1100 (AEDT) Received: from localhost ([::1]:47046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNDu-0003mm-R4 for incoming@patchwork.ozlabs.org; Fri, 19 Oct 2018 01:21:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNDD-0003kn-Sv for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNDC-0000Cd-Qz for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:39 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:37117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNDB-0008SP-7Y for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:38 -0400 Received: by mail-pf1-x441.google.com with SMTP id j23-v6so15952801pfi.4 for ; Thu, 18 Oct 2018 22:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v8nqSrxq6p2/soPpQJtI3t+myRc39om4RGG5eDPB1IA=; b=I7au/dfpADNCGr1Uxnl//uAUtbG4rElCTMrlcVeHaXGEsitfiEKvloiJBXAd3QHSQ6 rOZCa9Ik1xz/vY63UbS3cOrWtXB9SlaMuPIkm+RM+Z2YnIt8dDbUWwhT+uyXU8PqZB2O IPByiil3/UJ49tKqX9C1IJCV3ZNLFKRThpbSffSJlsO1Th33XCJiGaMzg/4NdibcrpMA VxLw2eiDTdw6jwQ06rPoCfm0mMzUU9TI9nRpoCAI6rwMjIn92fmdlw6p5qu5/m6XijLj 7a448hYfGQzQUX3RmobJAx1OXrZmubFdLbL4pW+vtBWWNUlEA/Ag+rNMO1g4lorZ5kc+ ILLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v8nqSrxq6p2/soPpQJtI3t+myRc39om4RGG5eDPB1IA=; b=ZH2Ct0JuXc0hw5BHW9XyynZF3bDMbUqNjcAMgK9HFPWnSMnW9huOJMz/+atD5zOK42 Lz3dIhM2gsVyNcaQQuFxPVPjFT5qivo8ghMlljZWGhmoSrrgoh62MQKjR/Kmd+xeOjW6 EBm7LrzqyU+DGU3l1saYh+PubKZqp8eHVmKGwEdr1jsPrsLSmX1hqp+Mtn4XaNuktRAp YYju4Sq1XvuiMddgG/z/mnG42eZGkW7MeHwfhnXdU2KrF1g8kDXvf4TZDXJ/5xOuXzk9 yG/RDgjwvzRb0YrdJhwKP1Hag22mTHX8IcE0/2qgvATNL8b+rCouhBtpBduDl6lVIE9s K3ig== X-Gm-Message-State: ABuFfoidwpXLkhFfSTtygizhzvwEQlAqcDK400Fh/kzPnrGFQsyGYk90 ZBWkLSn7c5LlwserfkA+SzI= X-Google-Smtp-Source: ACcGV63ImtsZOG0TByV9b2Olrt7vkUF54l62IJ8u7Ht3/im/Gdai5yO1XKlGCEGRRvNRmx3y6zZZeg== X-Received: by 2002:a62:76d8:: with SMTP id r207-v6mr33545117pfc.216.1539926429886; Thu, 18 Oct 2018 22:20:29 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id p1-v6sm25075191pff.128.2018.10.18.22.20.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 22:20:29 -0700 (PDT) From: Li Qiang To: alex.williamson@redhat.com Date: Thu, 18 Oct 2018 22:20:07 -0700 Message-Id: <1539926412-21831-3-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> References: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional 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: Li Qiang , philmd@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As the documentation says "use TYPE_FOO constants" This also changes the parent of ap-device's MACRO. Signed-off-by: Li Qiang --- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 12 ++++++------ include/hw/s390x/ap-device.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/s390x/ap-device.c b/hw/s390x/ap-device.c index f5ac8db..64a5f11 100644 --- a/hw/s390x/ap-device.c +++ b/hw/s390x/ap-device.c @@ -22,7 +22,7 @@ static void ap_class_init(ObjectClass *klass, void *data) } static const TypeInfo ap_device_info = { - .name = AP_DEVICE_TYPE, + .name = TYPE_AP_DEVICE, .parent = TYPE_DEVICE, .instance_size = sizeof(APDevice), .class_size = sizeof(DeviceClass), diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 3962bb7..b332395 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -28,7 +28,7 @@ #include "hw/s390x/ap-bridge.h" #include "exec/address-spaces.h" -#define VFIO_AP_DEVICE_TYPE "vfio-ap" +#define TYPE_VFIO_AP_DEVICE "vfio-ap" typedef struct VFIOAPDevice { APDevice apdev; @@ -36,7 +36,7 @@ typedef struct VFIOAPDevice { } VFIOAPDevice; #define VFIO_AP_DEVICE(obj) \ - OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE) + OBJECT_CHECK(VFIOAPDevice, (obj), TYPE_VFIO_AP_DEVICE) static void vfio_ap_compute_needs_reset(VFIODevice *vdev) { @@ -69,7 +69,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp) if (!group_path) { error_setg(errp, "%s: no iommu_group found for %s: %s", - VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message); + TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->message); return NULL; } @@ -147,7 +147,7 @@ static void vfio_ap_reset(DeviceState *dev) } static const VMStateDescription vfio_ap_vmstate = { - .name = VFIO_AP_DEVICE_TYPE, + .name = TYPE_VFIO_AP_DEVICE, .unmigratable = 1, }; @@ -167,8 +167,8 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) } static const TypeInfo vfio_ap_info = { - .name = VFIO_AP_DEVICE_TYPE, - .parent = AP_DEVICE_TYPE, + .name = TYPE_VFIO_AP_DEVICE, + .parent = TYPE_AP_DEVICE, .instance_size = sizeof(VFIOAPDevice), .class_init = vfio_ap_class_init, }; diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h index 765e908..d7eced4 100644 --- a/include/hw/s390x/ap-device.h +++ b/include/hw/s390x/ap-device.h @@ -10,13 +10,13 @@ #ifndef HW_S390X_AP_DEVICE_H #define HW_S390X_AP_DEVICE_H -#define AP_DEVICE_TYPE "ap-device" +#define TYPE_AP_DEVICE "ap-device" typedef struct APDevice { DeviceState parent_obj; } APDevice; #define AP_DEVICE(obj) \ - OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE) + OBJECT_CHECK(APDevice, (obj), TYPE_AP_DEVICE) #endif /* HW_S390X_AP_DEVICE_H */