From patchwork Fri Feb 8 22:47:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157894 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp27991jaa; Fri, 8 Feb 2019 14:47:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IaLnJRbWnj2SJUSsPUhhLx5YZWiezC81YIYY5YJnRTVGeVeOW3fVy3/GHkfnOBE/OBBlAee X-Received: by 2002:a0c:c138:: with SMTP id f53mr18282050qvh.225.1549666070329; Fri, 08 Feb 2019 14:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549666070; cv=none; d=google.com; s=arc-20160816; b=iy9C6hdAlZJ0N/PINmsES/Wp3paBpsR5/LUeSYzDlq9EfRkIyuuPs+M9WBgWBDKIve pF4mScYr2uKn1JQFUj7x2LwJIk+/seyrygyRCEF1IPbzjyQt1lEFLUm8S5T4JwSf9M2g x+jJnz7IR6gQfvpR6xPytlafrUa7449LOePzikWj9Zcl8jIoB3sxtM4vANO7YayE9AOm 2/swImIehSc4PeBtMewvjbFRl/i1OPScUGhMG3fqtSWQcwO31fJJu7tAju1L54kYIrfJ ty6EPcQhuffVEpoW0FMDyHBCdrzPF5CGDIBhUL6syicjwqSk2hrzhF43RaoGLatqXusa zYSw== 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=MWz0NlrpWFBKvNyrdlhG5XXrDzl+CZdx6Qq2UZkXi40=; b=zwKQtdfC1SS/GjPjYX0AZ8f/jr5iJLxKUVmI/WU4wIfnmvd4ruTxONwGsI9cBmrP0o 7puCmpNMBcsr9Bh8Z3p2tUQ3vgSLnxNpwkrP841BbPIxAOCH3ZqBvoAVvhh3DwfdbStg stNBGSYWbmwc87p/UbRm+zGoHwfvnkF1Y2oqwcRC27vkssR6NmLcrCXt0+DkqwKuM9GG Rk/qlyY/otWd0UKJbKK3YgHPeJHWjZX6qMCoVfiFPRsnNg0gy5yP1Ppb0+/kNYDbs/I5 nQ9LxtiM+n+DvKXB4jGV04+UzogKQeQWceZs5N9/q7pQ26LC08QqYfXy/QyiKCKFuspC Ycog== 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 z137si1113831qka.25.2019.02.08.14.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:47:50 -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-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E91D88E61; Fri, 8 Feb 2019 22:47:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCC0F1001F5D; Fri, 8 Feb 2019 22:47:47 +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 994FE3F7D0; Fri, 8 Feb 2019 22:47:47 +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 x18MlKLe014261 for ; Fri, 8 Feb 2019 17:47:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id BE1235B6A4; Fri, 8 Feb 2019 22:47:20 +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 5B30954505; Fri, 8 Feb 2019 22:47:20 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:47:10 -0500 Message-Id: <4c7c376bc0f03f666f2ba2b9c437beaf088e000d.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 1/4] tests: Rename virmocklibxl.c -> libxlmock.c 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 08 Feb 2019 22:47:49 +0000 (UTC) Every other mock library is named ending in mock.c, move virmocklibxl.c to follow that pattern Signed-off-by: Cole Robinson --- tests/Makefile.am | 12 ++++++------ tests/{virmocklibxl.c => libxlmock.c} | 2 +- tests/libxlxml2domconfigtest.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) rename tests/{virmocklibxl.c => libxlmock.c} (98%) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/Makefile.am b/tests/Makefile.am index ceb15d9218..c9f79a4e7d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -278,7 +278,7 @@ ssh_LDADD = $(COVERAGE_LDFLAGS) if WITH_LIBXL test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \ xmconfigtest libxlxml2domconfigtest -test_libraries += virmocklibxl.la +test_libraries += libxlmock.la endif WITH_LIBXL if WITH_QEMU @@ -534,11 +534,11 @@ libxlxml2domconfigtest_SOURCES = \ testutils.c testutils.h libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS) -virmocklibxl_la_SOURCES = \ - virmocklibxl.c -virmocklibxl_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) -virmocklibxl_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -virmocklibxl_la_LIBADD = $(MOCKLIBS_LIBS) +libxlmock_la_SOURCES = \ + libxlmock.c +libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) +libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) +libxlmock_la_LIBADD = $(MOCKLIBS_LIBS) else ! WITH_LIBXL EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \ diff --git a/tests/virmocklibxl.c b/tests/libxlmock.c similarity index 98% rename from tests/virmocklibxl.c rename to tests/libxlmock.c index 7664f007ac..4476cf728f 100644 --- a/tests/virmocklibxl.c +++ b/tests/libxlmock.c @@ -1,5 +1,5 @@ /* - * virmocklibxl.c: mocking of xenstore/libxs for libxl + * libxlmock.c: mocking of xenstore/libxs for libxl * * Copyright (C) 2014 Red Hat, Inc. * diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index de6e86ec66..863d8cded5 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -223,7 +223,7 @@ mymain(void) return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virmocklibxl.so") +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libxlmock.so") #else From patchwork Fri Feb 8 22:47:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157895 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp28021jaa; Fri, 8 Feb 2019 14:47:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9xR80wMI3X5wrXxxyuWK7rhUEaL8XX1ph71RofQNjPHPnWyzeng1I2/6GhT65m6xGWXH2 X-Received: by 2002:a37:b8c1:: with SMTP id i184mr16778835qkf.51.1549666073232; Fri, 08 Feb 2019 14:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549666073; cv=none; d=google.com; s=arc-20160816; b=cnnIAr2ZfLeyRE8h+rzyDi73bPmrqoC9A15Xr4I4Fb0s6YEeNGNRkbaT10OLM1ZmMs 8u91aJV9khgkB1R1h2qjHFOSoP3aGXe5OJfCa0IvRYaItudMwj8NRt5snrhhdoZeYMPE f0TfAD6k8OJ1BFz6veQrw3Hyhc/FgoKtRHU40E4LJmSaWv/l6KcSznojT6iUK1s56/aP UCOeUuXrrhReoMqREQw1YLfVJsfHAbx9nwtNllrtRke0ScyVcZ0G4+hSJVfJt2ulbRyE YahDFjOHf/TtcskW5wAhm/YhPSd6GwBwe9Yq0y7oKg3C8CNnJc+glQnNvwNQQp8lliQx tdpg== 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=NAsBBqtf/p98qDzTCVU2HkJGozUpqeNO/eUDXodHSHc=; b=RYJZGjsqNPKCoDTo6NWAVJmU4O1oWcF3Bmn6XmzzAK678T/dJ2G7nFGm2tZEKL8y6X QGyXa9TrDzjD0ZCm9elyMECFvMJQxoMiMRxj+i35Jw2PO+unQP2TzhBqrpYVvifWHBUa PjxVu1oAE234iB3qj60nTff3BLCtSeOobIxAg+JEOUQXF4ckKVhu12BqG6oLe086swVw pDEv5qLKkREmDuWyyDXiIz1+/obqOn7mdvdCS2TcgdgWo0VwuB92mSAjDHTn/ktkMv6N 1mIxGvBGgLnIsLg26Ze6NppNs10xfhCaMnea2muigSyqhrGwoDReOxH+r7iPeGnq+ADr miqg== 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 f15si2289793qth.61.2019.02.08.14.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:47:53 -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-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4E3E59478; Fri, 8 Feb 2019 22:47:51 +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 A04361EC; Fri, 8 Feb 2019 22:47:51 +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 575DF18033A6; Fri, 8 Feb 2019 22:47:51 +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 x18MlLuS014267 for ; Fri, 8 Feb 2019 17:47:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5929454505; Fri, 8 Feb 2019 22:47:21 +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 E77645B682; Fri, 8 Feb 2019 22:47:20 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:47:11 -0500 Message-Id: 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 2/4] tests: Create a shared library with libxl driver 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 08 Feb 2019 22:47:52 +0000 (UTC) This allows us to mock functions in the libxl driver, like is already possible for the qemu driver Signed-off-by: Cole Robinson --- tests/Makefile.am | 12 ++++++++---- 1 file changed, 8 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/tests/Makefile.am b/tests/Makefile.am index c9f79a4e7d..c3f633cee0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -58,7 +58,7 @@ MOCKLIBS_LDFLAGS = -module -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ $(MINGW_EXTRA_LDFLAGS) -QEMULIB_LDFLAGS = \ +DRIVERLIB_LDFLAGS = \ -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ $(MINGW_EXTRA_LDFLAGS) @@ -278,7 +278,7 @@ ssh_LDADD = $(COVERAGE_LDFLAGS) if WITH_LIBXL test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \ xmconfigtest libxlxml2domconfigtest -test_libraries += libxlmock.la +test_libraries += libxltestdriver.la libxlmock.la endif WITH_LIBXL if WITH_QEMU @@ -509,6 +509,10 @@ libxl_LDADDS += ../src/libvirt_driver_network_impl.la endif WITH_NETWORK libxl_LDADDS += $(LDADDS) +libxltestdriver_la_SOURCES = +libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS) +libxltestdriver_la_LIBADD = $(libxl_LDADDS) + xlconfigtest_SOURCES = \ xlconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h @@ -567,7 +571,7 @@ qemu_LDADDS += ../src/libvirt_qemu_probes.lo endif WITH_DTRACE_PROBES libqemutestdriver_la_SOURCES = -libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS) +libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS) libqemutestdriver_la_LIBADD = $(qemu_LDADDS) qemucpumock_la_SOURCES = \ @@ -1038,7 +1042,7 @@ endif WITH_QEMU if WITH_LIBXL domaincapstest_SOURCES += testutilsxen.c testutilsxen.h -domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS) +domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS) endif WITH_LIBXL if WITH_BHYVE 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); From patchwork Fri Feb 8 22:47:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157892 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp27880jaa; Fri, 8 Feb 2019 14:47:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYNp3iCVw3gDWUPVprXtFEUCFXQOD9gU2nY2xLk9ArISQAYpTeKyN0RXSUVfkTmmM6uIUnI X-Received: by 2002:ac8:2d0b:: with SMTP id n11mr7917381qta.143.1549666060230; Fri, 08 Feb 2019 14:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549666060; cv=none; d=google.com; s=arc-20160816; b=NoNBASmUMY6//Xbih8ma2ieFu4savhxKXjVo4K6rcuUtehIKPgnNk4JMGbqs+W05PB 8MRh176bE7KJGy2R87qHS2sH2Nb7mCGYmrLYQBMmjUgQRFc2XnMPQ0NK8RvI3isSt4lS 6VWaHut4N/+lrnaFNbPkLMcyGmknRMKssZO+D8DPbDduXneo0XzDpfl+dKV1Mi/qc52Q nxmZrxMX/zttaQGf6hgCCYDp0JVm1lfd2QY3IcBZm/dCTRKfVpbuEB5ORqujIyZEA63I 7HX3FDxnYUJ7uj6d5UCRx6WpHU8hgWc3kbPdSusFqjA43Y4Zr5b7tgIglVW6GT4Qr11I BbqA== 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=wAij8taKtXMRldeQg4LLI6TZUmUQ73fX2bwiG9/bxjM=; b=0FPFGWeDYM73J8XaUJsaWoOXagJ6aFemQYNzFiHSHJcrXm8ZAa0LftZIY+UzWCuvhm v5m0qCvZxlYU6hK65hpAHKkX9+oICKSmlifi16zWsSci30t1aGXqhZd0DmeCOGga/Lje z6YRfrGUgpXh4nYEuan26uUY+suJIqS8/ba6fORz0qU3GnK9T2BZ2hHcePUrgwYRWUoq j5uA44rY7KAJDfPWewDfzwuasdMLAr/zR5VTzihv2eW97okLFV7FOuJHErFKx+x2viiR Lz+nRZIgb8WHi51ldmcKP36lZh9E72pagqKxUnlUGKzeMMntghiIdwF4pcqsDnCs19+F oFaQ== 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 j43si1283184qtc.381.2019.02.08.14.47.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:47:40 -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-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5396D2CE90B; Fri, 8 Feb 2019 22:47:38 +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 07FA0D1F1; Fri, 8 Feb 2019 22:47:38 +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 69D52180BAAC; Fri, 8 Feb 2019 22:47:37 +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 x18MlM8U014285 for ; Fri, 8 Feb 2019 17:47:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 95A0554505; 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 324E55B682; Fri, 8 Feb 2019 22:47:22 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:47:13 -0500 Message-Id: <50dc261aff36c57d0d086eb0fa043393ed169d8f.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 4/4] tests: domcaps: Remove dependency on libxl PVUSB support 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 08 Feb 2019 22:47:39 +0000 (UTC) Mock out libxlCapsHasPVUSB to always return true, so test results aren't dependent on host libxl version Signed-off-by: Cole Robinson --- tests/domaincapsmock.c | 11 +++ .../domaincapsschemadata/libxl-xenfv-usb.xml | 78 ------------------- tests/domaincapsschemadata/libxl-xenfv.xml | 1 + .../domaincapsschemadata/libxl-xenpv-usb.xml | 68 ---------------- tests/domaincapsschemadata/libxl-xenpv.xml | 1 + tests/domaincapstest.c | 12 +-- 6 files changed, 15 insertions(+), 156 deletions(-) delete mode 100644 tests/domaincapsschemadata/libxl-xenfv-usb.xml delete mode 100644 tests/domaincapsschemadata/libxl-xenpv-usb.xml -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c index d8cf61685e..90e17c19f0 100644 --- a/tests/domaincapsmock.c +++ b/tests/domaincapsmock.c @@ -17,6 +17,17 @@ #include #include "virhostcpu.h" +#ifdef WITH_LIBXL +# include "libxl/libxl_capabilities.h" +#endif + +#ifdef WITH_LIBXL +bool +libxlCapsHasPVUSB(void) +{ + return true; +} +#endif int virHostCPUGetKVMMaxVCPUs(void) diff --git a/tests/domaincapsschemadata/libxl-xenfv-usb.xml b/tests/domaincapsschemadata/libxl-xenfv-usb.xml deleted file mode 100644 index 29fe1f9aa3..0000000000 --- a/tests/domaincapsschemadata/libxl-xenfv-usb.xml +++ /dev/null @@ -1,78 +0,0 @@ - - /usr/bin/qemu-system-x86_64 - xen - xenfv - x86_64 - - - - - /usr/lib/xen/boot/hvmloader - /usr/lib/xen/boot/ovmf.bin - - rom - pflash - - - yes - - - - - - - - - - - - disk - cdrom - - - ide - scsi - xen - - - - - sdl - vnc - spice - - - - - - subsystem - - - default - mandatory - requisite - optional - - - usb - pci - - - - xen - - - - - - - - - - diff --git a/tests/domaincapsschemadata/libxl-xenfv.xml b/tests/domaincapsschemadata/libxl-xenfv.xml index 5f318d5c4b..29fe1f9aa3 100644 --- a/tests/domaincapsschemadata/libxl-xenfv.xml +++ b/tests/domaincapsschemadata/libxl-xenfv.xml @@ -60,6 +60,7 @@ optional + usb pci diff --git a/tests/domaincapsschemadata/libxl-xenpv-usb.xml b/tests/domaincapsschemadata/libxl-xenpv-usb.xml deleted file mode 100644 index b9f3ca736b..0000000000 --- a/tests/domaincapsschemadata/libxl-xenpv-usb.xml +++ /dev/null @@ -1,68 +0,0 @@ - - /usr/bin/qemu-system-x86_64 - xen - xenpv - x86_64 - - - - - - - - - - - - - - disk - cdrom - - - ide - scsi - xen - - - - - sdl - vnc - spice - - - - - - subsystem - - - default - mandatory - requisite - optional - - - usb - pci - - - - xen - - - - - - - - - - diff --git a/tests/domaincapsschemadata/libxl-xenpv.xml b/tests/domaincapsschemadata/libxl-xenpv.xml index 6fc65f67b7..b9f3ca736b 100644 --- a/tests/domaincapsschemadata/libxl-xenpv.xml +++ b/tests/domaincapsschemadata/libxl-xenpv.xml @@ -50,6 +50,7 @@ optional + usb pci diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 7f52058bad..b9ab148fab 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -508,17 +508,9 @@ mymain(void) #if WITH_LIBXL -# ifdef LIBXL_HAVE_PVUSB -# define LIBXL_XENPV_CAPS "libxl-xenpv-usb" -# define LIBXL_XENFV_CAPS "libxl-xenfv-usb" -# else -# define LIBXL_XENPV_CAPS "libxl-xenpv" -# define LIBXL_XENFV_CAPS "libxl-xenfv" -# endif - - DO_TEST_LIBXL(LIBXL_XENPV_CAPS, "/usr/bin/qemu-system-x86_64", + DO_TEST_LIBXL("libxl-xenpv", "/usr/bin/qemu-system-x86_64", "xenpv", "x86_64", VIR_DOMAIN_VIRT_XEN); - DO_TEST_LIBXL(LIBXL_XENFV_CAPS, "/usr/bin/qemu-system-x86_64", + DO_TEST_LIBXL("libxl-xenfv", "/usr/bin/qemu-system-x86_64", "xenfv", "x86_64", VIR_DOMAIN_VIRT_XEN); #endif /* WITH_LIBXL */