From patchwork Thu Jan 28 22:52:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8154871 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 75E399F38B for ; Thu, 28 Jan 2016 22:53:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5915202FE for ; Thu, 28 Jan 2016 22:53:17 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F059320256 for ; Thu, 28 Jan 2016 22:53:16 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E52E21A1DD1; Thu, 28 Jan 2016 14:53:16 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id 676131A1DE7 for ; Thu, 28 Jan 2016 14:53:15 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 28 Jan 2016 14:53:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,360,1449561600"; d="scan'208";a="38145408" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by fmsmga004.fm.intel.com with ESMTP; 28 Jan 2016 14:53:15 -0800 Subject: [ndctl PATCH 10/13] ndctl: emit namespace after successful create From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 28 Jan 2016 14:52:50 -0800 Message-ID: <20160128225250.17855.32597.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20160128225157.17855.5190.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20160128225157.17855.5190.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Give notification of a successful 'create' event in json-format. Signed-off-by: Dan Williams --- builtin-xaction-namespace.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c index 5eb28bbeedfc..22e949a9ec6d 100644 --- a/builtin-xaction-namespace.c +++ b/builtin-xaction-namespace.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include #include @@ -275,6 +277,12 @@ static int setup_namespace(struct ndctl_region *region, if (rc) { error("%s: failed to enable\n", ndctl_namespace_get_devname(ndns)); + } else { + struct json_object *jndns = util_namespace_to_json(ndns); + + if (jndns) + printf("%s\n", json_object_to_json_string_ext(jndns, + JSON_C_TO_STRING_PRETTY)); } return rc; }