From patchwork Fri Feb 8 22:47:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157891 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp27768jaa; Fri, 8 Feb 2019 14:47:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IabF3zcDHlHKCzQjmShh+szvPGFmojOrxaPmxgvQLB5y9R6lyk8SiPMpjCa07QxnMfSxoIY X-Received: by 2002:a37:ba06:: with SMTP id k6mr17849476qkf.115.1549666050181; Fri, 08 Feb 2019 14:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549666050; cv=none; d=google.com; s=arc-20160816; b=YUFS9oyBUGYBB+PvRzog47dOGACWtBbSDfy2zRYtr4eGf+EtzaF4I9Ong/y/GL4is/ BUw+J08e2YQ0wvsIiGSI2d1p6IQ94S7tZbbnswbGhFvVYu6R3lZwikfRG8WpbyUAcXVu kZ1uP5lP6vwPG20QLvKKqhTyHQNfd2IpVGVgLLxG4hR5LNDaGQyxvqc6s9ev4ZTWCq7V B9CHYdWxqxrPnMPFi/4DGfp6CWbVemU59dk8EiwZpmTjbXbgSQvad/aki8v1hNveqO1K AnDWwT313Fw3uxZy01fQ4AjxciPNjsu6BEiObDrOjKuWgvEDdCE1fX4q48AfLaReYr/P wH4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=qxtH3niiiecFiPPMDB6Peu+2EWJj+sqk1cKhA3nVy7g=; b=DiNQ7/dOca5WJfHrT9i2Kb2SYm+EsTUdB7Q+8+/5ngFSnFDo+il7BBfdlIwFk12x8Y FY37Zx7uvlIxqyOIZ8dI7QjLkkshJuyzc+PfmxgzrP8vQLcSYsdPOarVTw36BlfLxHyb 1Wc/IhoEP5w91tYcQvOG0ESXt1qkwhhLoP3Eod7h6TK/CSvex2yO9NOMZiVFv9hLAsNq OJVT9YPjHdMwt5lMmpPFtgc/AYH5cp/u+dKyFtGbLKJtDMMTQelzhwVvWOzhC+s2lK6y 2XCNZ3Vr0b6x8ZQO9hrWMw2bzwgf45Zh60B5IXXGhYD4oMzZBSt1JfsQoAvAuKSCROzF 6CkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id e200si2767408qka.1.2019.02.08.14.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7DB5369CD; Fri, 8 Feb 2019 22:47:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E60D75C23B; Fri, 8 Feb 2019 22:47:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5A6AB180BAAC; Fri, 8 Feb 2019 22:47:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x18MlMRw014277 for ; Fri, 8 Feb 2019 17:47:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0B5A262943; Fri, 8 Feb 2019 22:47:22 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-115.rdu2.redhat.com [10.10.123.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 839665B682; Fri, 8 Feb 2019 22:47:21 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:47:12 -0500 Message-Id: <3df61f42f2554e33b46635c71a6fbf7a1734da3e.1549665763.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] libxl: Break out libxlCapsHasPVUSB X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 08 Feb 2019 22:47:28 +0000 (UTC) No functional change, but this will allow us to mock out the function in the test suite Signed-off-by: Cole Robinson --- src/libxl/libxl_capabilities.c | 16 ++++++++++++---- src/libxl/libxl_capabilities.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 111fb462e4..cc42dc6987 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -671,6 +671,15 @@ libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideoPtr dev) return 0; } +bool libxlCapsHasPVUSB(void) +{ +#ifdef LIBXL_HAVE_PVUSB + return true; +#else + return false; +#endif +} + static int libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) { @@ -688,10 +697,9 @@ libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI); -#ifdef LIBXL_HAVE_PVUSB - VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType, - VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB); -#endif + if (libxlCapsHasPVUSB()) + VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType, + VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB); /* No virDomainHostdevCapsType for libxl */ virDomainCapsEnumClear(&dev->capsType); diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h index be41682206..a0b9c10653 100644 --- a/src/libxl/libxl_capabilities.h +++ b/src/libxl/libxl_capabilities.h @@ -40,6 +40,7 @@ * by libvirt for Xen, and cannot be used for a persistent network name. */ # define LIBXL_GENERATED_PREFIX_XEN "vif" +bool libxlCapsHasPVUSB(void); virCapsPtr libxlMakeCapabilities(libxl_ctx *ctx);