From nobody Mon Feb 9 02:41:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1682065526; cv=none; d=zohomail.com; s=zohoarc; b=jP2+HCiI8+7tyb3AbYe379GX80z3Y5v9V0LINhiOcLcgEvEbn1IYniFi/hCQKp1QPhJTny7EdCur/4oExjvWa5GpgDoxpDEKO8JF6DUpcnNz7g867u2HsyPjc9TCgEWwLedfOybZ/em5+JU0DjZeMIxsUSB8KqpxQnkNlb6ZEIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065526; 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=T5n3jWYsciZLpQvHYhlDbWQF457iV60ms2XBOdUK7xo=; b=ErVzYNOr3Vj2ovnwper6VS3z5PkggPpABQsETnvNl8nS8Je9gC8xGiWQr1dOkd/ENCbF1PC7EQDbNRx0JKpILpcXvBH1J7peCcWXdCD0TwCk1n96xsN7r975lPoCLs89Q1qWaoPe2g5Q7eWKAeFFvJYlpTGhwONIm/2Q9R/ovno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1682065526075202.3871976056514; Fri, 21 Apr 2023 01:25:26 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-huvbOTOgMW2BKxyM4xwkfw-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 19FE53813F4A; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03F9E40C6EC4; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ED9171946A40; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA17F1946A46 for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AECE718EC7; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 552A75AB7A for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065525; 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=T5n3jWYsciZLpQvHYhlDbWQF457iV60ms2XBOdUK7xo=; b=YfsLneWlepGRZONmS1w0AZ1ncsLQ90aMpCLjnsuluZ0zWrBbrM1fu2YwnfopSEecNzopC4 TqXT6DUIjCYpMSYxczqDjU1nHWc2ojeycUNWnXE+0UNEiLhu64h6TQV2gOWiJtOotTanvi SV6wpK60+NVJOPcLDKyQvfSBNvoJn2c= X-MC-Unique: huvbOTOgMW2BKxyM4xwkfw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 04/11] qemuhotplugtest: Call qemuDomainDetachDeviceLive() directly Date: Fri, 21 Apr 2023 10:25:03 +0200 Message-Id: <747adc89a0530d357d41f96f75ec451ba88a75f2.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682065526891100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The testQemuHotplugDetach() already does call qemuDomainDetachDeviceLive() but only for some device types. For the rest it reports an error (but only if running test verbosely). This makes no sense. Just call qemuDomainDetachDeviceLive() directly and drop testQemuHotplugDetach(). Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 49 +---------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 6aaccce55b..4f9d1bcb2a 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -169,53 +169,6 @@ testQemuHotplugAttach(virDomainObj *vm, return ret; } =20 -static int -testQemuHotplugDetach(virDomainObj *vm, - virDomainDeviceDef *dev, - bool async) -{ - int ret =3D -1; - - switch (dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_WATCHDOG: - case VIR_DOMAIN_DEVICE_HOSTDEV: - case VIR_DOMAIN_DEVICE_NET: - ret =3D qemuDomainDetachDeviceLive(vm, dev, &driver, async); - break; - - case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_CONTROLLER: - case VIR_DOMAIN_DEVICE_GRAPHICS: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_REDIRDEV: - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_MEMORY: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_VSOCK: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - VIR_TEST_VERBOSE("device type '%s' cannot be detached", - virDomainDeviceTypeToString(dev->type)); - break; - } - - return ret; -} - static int testQemuHotplugUpdate(virDomainObj *vm, virDomainDeviceDef *dev) @@ -394,7 +347,7 @@ testQemuHotplug(const void *data) break; =20 case DETACH: - ret =3D testQemuHotplugDetach(vm, dev, false); + ret =3D qemuDomainDetachDeviceLive(vm, dev, &driver, false); if (ret =3D=3D 0 || fail) ret =3D testQemuHotplugCheckResult(vm, domain_xml, domain_filename, fail); --=20 2.39.2