From patchwork Mon Sep 18 13:56:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9956779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 816A2601E9 for ; Mon, 18 Sep 2017 13:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72BB928A23 for ; Mon, 18 Sep 2017 13:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6793128A1A; Mon, 18 Sep 2017 13:58:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 282AF28A1A for ; Mon, 18 Sep 2017 13:58:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtwX9-0005Tn-J8; Mon, 18 Sep 2017 13:56:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtwX8-0005Sc-MI for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 13:56:22 +0000 Received: from [85.158.143.35] by server-5.bemta-6.messagelabs.com id 95/6E-03454-680DFB95; Mon, 18 Sep 2017 13:56:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHRDpG7Thf2 RBvsfWFl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm3r79kK/jHXtG4egNzA+Nb1i5GTg4JAX+J h8v+s4PYbALKEj87e9lAbBEBPYmmA88ZQWxmAS+JHyt6wGqEBUIkZmw7C2azCKhKtF5rB6vnF bCQODdrJiPETHmJXW0XweZzClhKrNn7jgnEFgKq6f22lRXCVpDomH6MCaJXUOLkzCcsELskJA 6+eME8gZF3FpLULCSpBYxMqxjVi1OLylKLdM30kooy0zNKchMzc3QNDcz0clOLixPTU3MSk4r 1kvNzNzECQ4cBCHYwzjvhf4hRkoNJSZRXNHJ/pBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3unn gXKCRanpqRVpmTnAIIZJS3DwKInwzgdJ8xYXJOYWZ6ZDpE4x6nJ03Lz7h0mIJS8/L1VKnLcOp EgApCijNA9uBCyiLjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYVxZkCk9mXgncpldARzABHd GyYw/IESWJCCmpBkaPiMI5vG8OfPx29PPyxafLk5vFH1dZyVjVJLTqXma54uOwuGAG89YvJ+p U7qztm7I9Ua+TO31fl4NT8rkrNQm9X6bvmBTB80NSXccmdupeZ/9S0VvTJ4pMjtXfXrZczWjn cpUtlxullPwPz1Oe/f16ySmDh7Fc0mymn+Y9n+fRu4Y/M69W6rASS3FGoqEWc1FxIgD1LN5ao wIAAA== X-Env-Sender: prvs=427238337=wei.liu2@citrix.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1505742976!83250223!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22670 invoked from network); 18 Sep 2017 13:56:18 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 18 Sep 2017 13:56:18 -0000 X-IronPort-AV: E=Sophos;i="5.42,413,1500940800"; d="scan'208";a="440146256" From: Wei Liu To: Xen-devel Date: Mon, 18 Sep 2017 14:56:13 +0100 Message-ID: <20170918135614.30868-3-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170918135614.30868-1-wei.liu2@citrix.com> References: <20170918135614.30868-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH v2 2/3] libxl: use libxl__read_xenstore_mandatory in vdispl function X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Coverity-ID: 1418097 Signed-off-by: Wei Liu --- tools/libxl/libxl_vdispl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_vdispl.c b/tools/libxl/libxl_vdispl.c index 5740c89fad..befc56bdeb 100644 --- a/tools/libxl/libxl_vdispl.c +++ b/tools/libxl/libxl_vdispl.c @@ -40,10 +40,14 @@ static int libxl__vdispl_from_xenstore(libxl__gc *gc, const char *libxl_path, libxl_devid devid, libxl_device_vdispl *vdispl) { - char *be_path; + const char *be_path; + int rc; vdispl->devid = devid; - be_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend", libxl_path)); + rc = libxl__xs_read_mandatory(gc, XBT_NULL, + GCSPRINTF("%s/backend", libxl_path), + &be_path); + if (rc) return rc; return libxl__backendpath_parse_domid(gc, be_path, &vdispl->backend_domid); }