From patchwork Mon Sep 5 10:15:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 9313421 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 9EB5A600CA for ; Mon, 5 Sep 2016 10:17:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89DF728A0C for ; Mon, 5 Sep 2016 10:17:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E11028A40; Mon, 5 Sep 2016 10:17:36 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 D62AD28A0C for ; Mon, 5 Sep 2016 10:17:35 +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 1bgqwB-0002lI-Mj; Mon, 05 Sep 2016 10:15:35 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgqwA-0002kq-Ru for xen-devel@lists.xen.org; Mon, 05 Sep 2016 10:15:34 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 71/EF-01026-6C54DC75; Mon, 05 Sep 2016 10:15:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIIsWRWlGSWpSXmKPExsXilM8io3vU9Wy 4weGbPBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bOZ3OZCk7yVjxZYdXAeIG7i5GLQ0hgFaNE +6lFLF2MHEBOtsSt+9kgcRaBTmaJHZta2CGcdmaJpReXsnYxcnJICDhLTHv6lAWiewOjRO+jZ rAEi4CKxNvja5lAbDaBYInrS36BxUUEpCWufb7MCNLALDCbUeLQ5JdgCWGBMIkDX38xgti8Ar oSbV37WCFsQYmTM5+wgNjMAqUSO+a/YgM5jxlo0PJ/HCBhUQFliYYZD5gnMArMQtIxC0nHLIQ OiLC6xJ95l5gxhLUlli18zQxh20qsW/eeZQEj+ypGjeLUorLUIl1DI72kosz0jJLcxMwcXUMD U73c1OLixPTUnMSkYr3k/NxNjMDgZwCCHYx9s5wPMUpyMCmJ8haong0X4kvKT6nMSCzOiC8qz UktPsSowcEhsHnt6guMUix5+XmpShK8SsAoExIsSk1PrUjLzAHGJ0ypBAePkgjvRxegNG9xQW JucWY6ROoUo6KUOK8sSJ8ASCKjNA+uDZYSLjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmY9zb IeJ7MvBK46a+AFjMBLV63+zTI4pJEhJRUA2PXw6Sp3mev+5U1y+ftVHKrO5Fou/z09/57X6/J Xt269H7BCtOu1MuPjcU/zrA1tdi6pnVC9xqRINXtzPFZSw3fCXNuceW40GYo0fts9ms/ta/pG ZeZ4wQ7bPStfm/V8/w12drN5q/ExqpXjgURa+3DPguW6En9Zf90bPZ80R1Pkx0czyxd6KjEUp yRaKjFXFScCADuRYg1BAMAAA== X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1473070532!54215164!1 X-Originating-IP: [66.111.4.28] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20786 invoked from network); 5 Sep 2016 10:15:33 -0000 Received: from out4-smtp.messagingengine.com (HELO out4-smtp.messagingengine.com) (66.111.4.28) by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Sep 2016 10:15:33 -0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 31454206A7; Mon, 5 Sep 2016 06:15:32 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 05 Sep 2016 06:15:32 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Kcs Su6KvCjwB2PRt+XSIk0eP2zE=; b=Mh3RdtgnEc9+laIb6x+m7IpPZEauSSbMPDf eev6re6qEH+lHbJDGG5v7yrNsd66w1Aa3oHnLZZxT5E4DqHP/kchPqH7bc1FaCL8 zggrpuGY3LiPmpXMGnpMY0d22neRqI2QTu5Wu6yN8mivW2cg+xsQ6tbe2Sux4J7r P0b2lnAw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Kc sSu6KvCjwB2PRt+XSIk0eP2zE=; b=NZud0FyArlw5rnprsV/3BGjBrSACf7JLxo RIkfpQIakzKAQxJSQh1xwS45Fe3+BABhCc3sYz9U6FtocLM4YZTVsl0/0ULoqrLR +Q3KurDrPZ/A0XeSwmRmIFLE1Lw0+n5pJdDyN8C7LsNLx1wlBlax82KOMXrKrhg7 W9lJA3U0s= X-Sasl-enc: 8/PSv9MD41admRnS8jo9wFYyHtYYRj9p1fSp14rwC7lq 1473070531 Received: from mail-itl (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 2434CF29CC; Mon, 5 Sep 2016 06:15:31 -0400 (EDT) Date: Mon, 5 Sep 2016 12:15:26 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xen.org Message-ID: <20160905101526.GA21832@mail-itl> MIME-Version: 1.0 User-Agent: Mutt/1.6.1 (2016-04-27) Cc: Wei Liu , Ian Jackson , Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Subject: [Xen-devel] [PATCH for-4.7, 4.6] libxl: do not assume Dom0 backend while getting nic info 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 Fill backend_domid field based on backend path. Cc: Ian Jackson Cc: Wei Liu Signed-off-by: Marek Marczykowski-Górecki --- tools/libxl/libxl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index e1ab6ec..9a888a1 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3601,6 +3601,18 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc, else nic->devid = 0; + rc = libxl__xs_read_checked(gc, XBT_NULL, + GCSPRINTF("%s/backend", libxl_path), &tmp); + if (rc) goto out; + + if (!tmp) { + LOG(ERROR, "nic %s does not exist (no backend path)", libxl_path); + rc = ERROR_FAIL; + goto out; + } + rc = libxl__backendpath_parse_domid(gc, tmp, &nic->backend_domid); + if (rc) goto out; + /* nic->mtu = */ tmp = READ_LIBXLDEV(gc, "mac");