From nobody Tue Mar 3 04:54:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1772183201; cv=none; d=zohomail.com; s=zohoarc; b=EoUtyMr0LO3QX075yEf7P6Ecv83P0tAskNAF1kVeeUCSE6Osjq/jDRUH4e1PY2swWOzAFQuhq/J0mq1Lv5hnQbq6TQCq/wPN7d5jk80s8MIW+oAE8pCfLW4fPfpqZfyG2pEgrOymzGbmDvc8IyC95ikcXheJtZ5+GmfbnnACi8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772183201; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=OCF1XRS8v2OmX/fo45BA4YyUtP4RquOlLUm1tP57/jU=; b=lwntfLNzMfxYMxDjEZbbSXcRyiZaTqi8X1DwWSLOS+nEVlR9wCMA8+nsqRcL5ChEa6hpy1Y9cy/YNz6J/Oq5ofjXu/SajwCk/F4HAOx9U2QD7sMQjo67P6gkBESwucySkBU0RSD0LlVqT8Mh9K+1vP7zK2YyE3Xjri04kQfnY3g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1772183201511493.43453386850524; Fri, 27 Feb 2026 01:06:41 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 833CC41D4D; Fri, 27 Feb 2026 04:06:40 -0500 (EST) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0231643E0A; Fri, 27 Feb 2026 04:03:39 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id E430441E39; Fri, 27 Feb 2026 04:03:33 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 077B141D8E for ; Fri, 27 Feb 2026 04:03:12 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-gLBlPcLtMhaM72egDCa8dQ-1; Fri, 27 Feb 2026 04:03:09 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 929351800579 for ; Fri, 27 Feb 2026 09:03:08 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F394C19560B5 for ; Fri, 27 Feb 2026 09:03:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772182991; h=from:from: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; bh=OCF1XRS8v2OmX/fo45BA4YyUtP4RquOlLUm1tP57/jU=; b=I9orAqG5jydaZGaAL1PXktgmmlYdi+1ZDCYLkNfJoggoqR4rOVjQcu355PfQAkj5MzY6TN 9xMetffW+q2Z37hguvJmmV7g+P7wM25UfFB6GOPgGbiLErC0h6OmyVapnClGuRxLV23D1R RYhlKlyCFeAGWIyuBBoz9iwswD25VGo= X-MC-Unique: gLBlPcLtMhaM72egDCa8dQ-1 X-Mimecast-MFC-AGG-ID: gLBlPcLtMhaM72egDCa8dQ_1772182988 To: devel@lists.libvirt.org Subject: [PATCH 4/4] qemuhotplugtest: Introduce interface-hostdev test case Date: Fri, 27 Feb 2026 10:02:59 +0100 Message-ID: <7fee163eb9243347a73faeabe231485e9adcd52e.1772182866.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LFhxJZ9mjFKS30440dQpMSQOVqwl8MS3WqQvkTDunXk_1772182988 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: U252U3QVXW2IQNLK7RO2LUFJPM4WCUMA X-Message-ID-Hash: U252U3QVXW2IQNLK7RO2LUFJPM4WCUMA X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772183202853158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik While our qemuhotplugtest already does a PCI hotplug and unlpug ("hostdev-pci") there is another way to hotplug a PCI device, esp. if it's a NIC: . This has been missing and as shown in v12.1.0-rc1-4-gfe782ed334 can be potentially dangerous as some different paths are taken. Introduce a test case for interface-hostdev. Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 7 ++- .../qemuhotplug-interface-hostdev.xml | 6 ++ ...emuhotplug-base-live+interface-hostdev.xml | 63 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-interface-host= dev.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+inte= rface-hostdev.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 58413b6e0d..3367804ed0 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -697,6 +697,10 @@ mymain(void) DO_TEST_DETACH("ppc64", "pseries-base-live", "hostdev-pci", false, fal= se, "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); =20 + DO_TEST_ATTACH("x86_64", "base-live", "interface-hostdev", false, true, + "device_add", QMP_OK); + DO_TEST_DETACH("x86_64", "base-live", "interface-hostdev", false, fals= e, + "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); DO_TEST_ATTACH("x86_64", "base-live", "interface-vdpa", false, true, "query-fdsets", "{\"return\":[{\"fdset-id\":99999}]}", "add-fd", "{ \"return\": { \"fdset-id\": 1, \"fd\": 95 = }}", @@ -803,4 +807,5 @@ VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci"), VIR_TEST_MOCK("domaincaps"), VIR_TEST_MOCK("virprocess"), - VIR_TEST_MOCK("qemuhotplug")); + VIR_TEST_MOCK("qemuhotplug"), + VIR_TEST_MOCK("virnetdev")); diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml= b/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml new file mode 100644 index 0000000000..0eb7a1df1a --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml @@ -0,0 +1,6 @@ + + +
+ + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-h= ostdev.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-h= ostdev.xml new file mode 100644 index 0000000000..13288f7711 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-hostdev.= xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + qemu64 + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + +
+ + +
+ + + + + + + +