From patchwork Tue Jun 6 07:22:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 771670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3whjvD0DSqz9s5L for ; Tue, 6 Jun 2017 17:27:35 +1000 (AEST) Received: from localhost ([::1]:36579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI8ti-00045j-86 for incoming@patchwork.ozlabs.org; Tue, 06 Jun 2017 03:27:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI8pL-0000mi-Q1 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 03:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dI8pH-0005KX-2K for qemu-devel@nongnu.org; Tue, 06 Jun 2017 03:22:55 -0400 Received: from mga03.intel.com ([134.134.136.65]:58638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dI8pG-0005K6-Qh for qemu-devel@nongnu.org; Tue, 06 Jun 2017 03:22:51 -0400 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2017 00:22:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,305,1493708400"; d="scan'208";a="111383286" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.149]) by fmsmga006.fm.intel.com with ESMTP; 06 Jun 2017 00:22:47 -0700 From: Haozhong Zhang To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 15:22:26 +0800 Message-Id: <20170606072229.9302-2-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170606072229.9302-1-haozhong.zhang@intel.com> References: <20170606072229.9302-1-haozhong.zhang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 Subject: [Qemu-devel] [PATCH v2 1/4] nvdimm: add a macro for property "label-size" 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: Haozhong Zhang , "Michael S. Tsirkin" , Stefan Hajnoczi , Xiao Guangrong , Igor Mammedov , Dan Williams Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Haozhong Zhang Reviewed-by: Stefan Hajnoczi --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index db896b0bb6..a9b0863f20 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -66,7 +66,7 @@ out: static void nvdimm_init(Object *obj) { - object_property_add(obj, "label-size", "int", + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "int", nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL, NULL); } diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index 03e1ff9558..f1f3987055 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -47,6 +47,9 @@ #define NVDIMM_CLASS(oc) OBJECT_CLASS_CHECK(NVDIMMClass, (oc), TYPE_NVDIMM) #define NVDIMM_GET_CLASS(obj) OBJECT_GET_CLASS(NVDIMMClass, (obj), \ TYPE_NVDIMM) + +#define NVDIMM_LABEL_SIZE_PROP "label-size" + struct NVDIMMDevice { /* private */ PCDIMMDevice parent_obj;