From nobody Mon Feb 9 01:52:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1593095896; cv=none; d=zohomail.com; s=zohoarc; b=VxyE0vGHzsLcbETsHIYGdQdriIeVzMC/5TDBM8KlMyHbC44IlWwCSgag/f5VpPQkQ6zv7+ZTRkfBNr63cVGmjguhj3ORw2Wt0LcK2rsvUkSrpFdBQKJiOZvSchsjInsTkm+qjWVfGFUw1lY4N77ev0Km9elDx/vpF9thjlGF7/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593095896; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=NMfTZgbaPUqEi4rYmThta+iJLIT9x8iGv9m0xyhb5Vc=; b=i/Ooqoml4sCFGWTUHrBpNrc6mDWM/Hg2lT/HB6ZaEwHVYfCTnfcu37MZz/biVMj5Z1IllOAtXUHBDsmVOGC+Aa9kTmtq9RNQelNYu+zjTNe6vA94cxtTkWTM2Okh4UqXjDSfujOzKtLdOP/ExPdFWFDM7MrUpwNNYlN1/3sXEqA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1593095896823377.6636550207304; Thu, 25 Jun 2020 07:38:16 -0700 (PDT) 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-315-6JRr6jY7PBeKrFLna-xF_w-1; Thu, 25 Jun 2020 10:38:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F646800D5C; Thu, 25 Jun 2020 14:38:08 +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 BF90A5BAC7; Thu, 25 Jun 2020 14:38:07 +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 313918759F; Thu, 25 Jun 2020 14:38:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05PEc65t008738 for ; Thu, 25 Jun 2020 10:38:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39D6B71688; Thu, 25 Jun 2020 14:38:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF19D79325 for ; Thu, 25 Jun 2020 14:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593095895; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NMfTZgbaPUqEi4rYmThta+iJLIT9x8iGv9m0xyhb5Vc=; b=EtLYmqWjqaZlszG5YJHTLNpi0xEAsgPMOH01jUP0F8SsHUGtoV8LtzGoSmftDy79LyrigY N5LmDoyrsJ8xE6v+1sMGj0EBppeFKDvMBQSHBuAkVizBgncEGIj2Y5UsVexcaxcbBSE+qE WntnbEEmc3yfIyOtFLOMS+9yz9RSgIU= X-MC-Unique: 6JRr6jY7PBeKrFLna-xF_w-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemuxml2xmltest: Set dummy non-hypervisor drivers Date: Thu, 25 Jun 2020 16:37:59 +0200 Message-Id: <6b542ec87d83dfb1e45f32afc6d4c3d99d2f6268.1593095879.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.79 on 10.5.11.15 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" When parsing domain XML post parse callbacks are run and one of them might try and call API from a non-hypervisor driver (e.g. just like qemuDomainDeviceNetDefPostParse() is doing - it calls a network API). To avoid this in the test suite, set dummy drivers, which renders all non-hypervisor APIs return error. This mimics what qemuxml2argvtest does. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemuxml2xmltest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5a124853b4..11ff17d83c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -135,6 +135,7 @@ mymain(void) char *fakerootdir; virQEMUDriverConfigPtr cfg =3D NULL; virHashTablePtr capslatest =3D NULL; + g_autoptr(virConnect) conn =3D NULL; =20 capslatest =3D testQemuGetLatestCaps(); if (!capslatest) @@ -164,6 +165,16 @@ mymain(void) cfg =3D virQEMUDriverGetConfig(&driver); driver.privileged =3D true; =20 + if (!(conn =3D virGetConnect())) + goto cleanup; + + virSetConnectInterface(conn); + virSetConnectNetwork(conn); + virSetConnectNWFilter(conn); + virSetConnectNodeDev(conn); + virSetConnectSecret(conn); + virSetConnectStorage(conn); + # define DO_TEST_INTERNAL(_name, suffix, when, ...) \ do { \ static struct testQemuInfo info =3D { \ @@ -1471,6 +1482,7 @@ mymain(void) DO_TEST_CAPS_LATEST("virtio-9p-multidevs"); DO_TEST("downscript", NONE); =20 + cleanup: if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 --=20 2.26.2