From nobody Sat Feb 7 07:26:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381553; cv=none; d=zohomail.com; s=zohoarc; b=jQYmbHsQBNlBdMgMbD4JsVqyY5+jKmvSpwXORDi572AZQRjXEmjXaIxg/5Psz494R6yhLo11yng1AqN8964xSZQ+pStfPpsVxtVv49DezrZQuYqvOXno6DFzt7b0LVQHSzlbR6zt+74ExAVYlbLym2diCUJV6jBkoKNkUUK17A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381553; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g0iMAayGwEOVSFANCxxTmnXpOxfafW6j0wk8gsbdeL0=; b=ZcD0WFv5QCXgZ0uOiQ4RFZHJJSt/eZ1FY/X2GP6NYhzZKfdxxAnC/Hny7TeSMPGH5RGo8VOYrThym33YNxK3mzSaDmnEvTryfTgnverCFd1yJrvOr4OcoQ4eS78lOKv8id8LObtrmyYVo9rQ/EwwwyhlpSmgeqi40VTheiPUFBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582381553089424.31150015930916; Sat, 22 Feb 2020 06:25:53 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-FF8n614GNfGphInSZCZ5AQ-1; Sat, 22 Feb 2020 09:25:49 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D053F8017CC; Sat, 22 Feb 2020 14:25:43 +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 A9EE82709B; Sat, 22 Feb 2020 14:25:43 +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 61D0B18034EA; Sat, 22 Feb 2020 14:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPMB0008577 for ; Sat, 22 Feb 2020 09:25:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 43E1E90067; Sat, 22 Feb 2020 14:25:22 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 923F087B0A for ; Sat, 22 Feb 2020 14:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381552; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g0iMAayGwEOVSFANCxxTmnXpOxfafW6j0wk8gsbdeL0=; b=hQeXJbggT7UiOxUevE4rZadHCYAIy0Jr0TCBL0iuXzD7xMhArtsO6sNCjuhXR+aC/6IaeP ajcR8sP7T+ZpTJCkHiJS0WQNCLgji6QTCKf9LuxVDWmVqyXw6u1/L1ox4Tj+LN17KYntuF uYL4Yi1TLibTUlhVFQaquW/zcuSxI/w= X-MC-Unique: FF8n614GNfGphInSZCZ5AQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 7/7] tests: libxl: do not run the emulator Date: Sat, 22 Feb 2020 15:25:11 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Ever since commit c5a00350 the libxl parser invokes the emulator to probe which device model to use. Commit b90c4b5 introduced a workaround that used a stable path which was very likely to result in the answer matching the default. However the test is still affected by the host state and the binary gets invoked if present. Mock the libxlDomainGetEmulatorType function to stop wasting CPU cycles every time a 'make check' is run on a system with xen installed. For example xlconfigtest gets faster by 90 % Signed-off-by: J=C3=A1n Tomko Fixes: b90c4b5f505698d600303c5b4f03f5d229b329dd --- src/libxl/libxl_capabilities.h | 3 ++- tests/libxlmock.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h index 9a7c8bf636..9efb836429 100644 --- a/src/libxl/libxl_capabilities.h +++ b/src/libxl/libxl_capabilities.h @@ -50,4 +50,5 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps, size_t nfirmwares); =20 int -libxlDomainGetEmulatorType(const virDomainDef *def); +libxlDomainGetEmulatorType(const virDomainDef *def) + G_GNUC_NO_INLINE; diff --git a/tests/libxlmock.c b/tests/libxlmock.c index 60e6b78129..a36ca135f6 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -30,6 +30,7 @@ =20 # include "virfile.h" # include "virsocket.h" +# include "libxl/libxl_capabilities.h" =20 VIR_MOCK_IMPL_RET_VOID(xs_daemon_open, struct xs_handle *) @@ -123,4 +124,10 @@ VIR_MOCK_IMPL_RET_ARGS(stat, int, return real_stat(path, sb); } =20 +int +libxlDomainGetEmulatorType(const virDomainDef *def G_GNUC_UNUSED) +{ + return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; +} + #endif /* WITH_LIBXL && WITH_YAJL */ --=20 2.24.1