From patchwork Fri Apr 5 20:51:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 10887835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 237A01669 for ; Fri, 5 Apr 2019 20:54:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7DE28B2D for ; Fri, 5 Apr 2019 20:54:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E98CA28B57; Fri, 5 Apr 2019 20:54:12 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64FEF28B2D for ; Fri, 5 Apr 2019 20:54:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hCVof-0006U4-NO; Fri, 05 Apr 2019 20:52:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hCVod-0006Tz-Pr for xen-devel@lists.xenproject.org; Fri, 05 Apr 2019 20:51:59 +0000 X-Inumbo-ID: a6e871bf-57e4-11e9-92d7-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a6e871bf-57e4-11e9-92d7-bc764e045a96; Fri, 05 Apr 2019 20:51:57 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,313,1549929600"; d="scan'208";a="82896979" From: Igor Druzhinin To: Date: Fri, 5 Apr 2019 21:51:48 +0100 Message-ID: <1554497508-32708-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/xl: use libxl_domain_info to get domain type for vcpu-pin X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, Igor Druzhinin Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Parsing the config seems to be an overkill for this particular task and the config might simply be absent. Type returned should be either LIBXL_DOMAIN_TYPE_HVM or LIBXL_DOMAIN_TYPE_PV but in that context distinction between PVH and HVM should be irrelevant. Signed-off-by: Igor Druzhinin --- tools/xl/xl_vcpu.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/xl/xl_vcpu.c b/tools/xl/xl_vcpu.c index 71d3a5c..4a4d0fa 100644 --- a/tools/xl/xl_vcpu.c +++ b/tools/xl/xl_vcpu.c @@ -284,19 +284,14 @@ int main_vcpupin(int argc, char **argv) /* Only hard affinity matters here */ if (!ignore_masks) { - libxl_domain_config d_config; + libxl_dominfo dominfo; - libxl_domain_config_init(&d_config); - rc = libxl_retrieve_domain_configuration(ctx, domid, &d_config); - if (rc) { - fprintf(stderr, "Could not retrieve domain configuration\n"); - libxl_domain_config_dispose(&d_config); + if (libxl_domain_info(ctx, &dominfo, domid)) { + fprintf(stderr, "Could not get domain info\n"); goto out; } - apply_global_affinity_masks(d_config.b_info.type, hard, 1); - - libxl_domain_config_dispose(&d_config); + apply_global_affinity_masks(dominfo.domain_type, hard, 1); } if (force) {