From nobody Thu Dec 26 15:07:42 2024 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731315218470618.0417234063984; Mon, 11 Nov 2024 00:53:38 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 8C90817D0; Mon, 11 Nov 2024 03:53:37 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2E696173C; Mon, 11 Nov 2024 03:53:18 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 41099172B; Mon, 11 Nov 2024 03:53:15 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id BE0811727 for ; Mon, 11 Nov 2024 03:53:14 -0500 (EST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-454-jVUAayEwNWSVQkxp4dnAlQ-1; Mon, 11 Nov 2024 03:53:13 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4317391101aso30798575e9.2 for ; Mon, 11 Nov 2024 00:53:12 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432b05e2a31sm166729845e9.36.2024.11.11.00.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 00:53:11 -0800 (PST) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id D13CB3A63246 for ; Mon, 11 Nov 2024 09:53:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731315194; 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=b1072okiTMvLe56jRukVeqC1OVgbn+2tUaBMTZUAZmw=; b=LqT9eTK8FXoOCRCdWzF2GNraQYdyzY11tTEpvGtLozLZfisyVpEAUdJgkkgR+zcOxpRfaN lN+pyi6VOjiMEPfdzyJdLjcBWsoIQ6a7NJGMiYh2RJlNqNUtQUl/pcQt46AKsSu1ASF7n3 Zn30YVgJ4BgP8+aXF1ojRjiwFExU/ok= X-MC-Unique: jVUAayEwNWSVQkxp4dnAlQ-1 X-Mimecast-MFC-AGG-ID: jVUAayEwNWSVQkxp4dnAlQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731315192; x=1731919992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b1072okiTMvLe56jRukVeqC1OVgbn+2tUaBMTZUAZmw=; b=NXEGVG1iTHbwBaNH0fgSP0Kq71HvkOu8AP4EDYekXVMamIx8u1RCk+5I4LmrxM95BG Rm0ACg9r6LyBd2N7sOg1RTAOmlJ9vMmSV2W1gF7xcWIjsSEqEfdjK9bI1/i+9x1qttGR rKPEFubT+oeJMra9H/xYW55oVrrW9emRSDJoAb3asmRpu7wz0WfFLPEDNIZBc0qk8Bt8 aeW4wChFbbLXBBtQ5RuaFwvuG8ssj3sCBSz44a14CoVxAeyZRqgjojha6+Yj96K6rRcM hbLFWWNhdYNZJcJ26BpFSpoVk9p5Mquc736PHRx7cnfZgLtoi40Il1u0eRcDhTn3BpME uFJw== X-Gm-Message-State: AOJu0Yz7fwvFBZnTpLrcpOH+fattN9guM8aFTwAoI2b1ekWNnN080O6m W7jYmNYT375OI5UfX7ZbgY0Fb6w2T6X9luM2CCC0AyzFGWMt+eR5mRovs+maJh140oaO5gW/w7n WFALxO+NyfyRMSVkeoN3ZKRYkiFZ9ANtORh+EY9YIyVGUIKoBKw3FgXPbFhYWiUaIaY1xLTVgCM SRKZ695XYqPrxH5WSpdnzMWWC60zW9SfOFkKhvOgk= X-Received: by 2002:a05:600c:5107:b0:426:64a2:5362 with SMTP id 5b1f17b1804b1-432b7503dc6mr100598725e9.8.1731315191825; Mon, 11 Nov 2024 00:53:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGC8OyIsNSQBv8kb5pg6g6djaciRjcbdCTPlGCSEgsmej+o80lqp/TWx3bH/E+F9LHPnjFtZA== X-Received: by 2002:a05:600c:5107:b0:426:64a2:5362 with SMTP id 5b1f17b1804b1-432b7503dc6mr100598595e9.8.1731315191464; Mon, 11 Nov 2024 00:53:11 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 1/3] qemu: Expose qemuChrIsPlatformDevice outside from qemu_command Date: Mon, 11 Nov 2024 09:53:07 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sKQvlaiqHMaKXoutxAEnvnSQoWQRm0DReqM13rC_zrM_1731315192 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FQY6AHWQET5KAW6DLZL25OQ22MAJXKTB X-Message-ID-Hash: FQY6AHWQET5KAW6DLZL25OQ22MAJXKTB X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731315219705116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Then it can be used from qemu_hotplug. Signed-off-by: Martin Kletzander Reviewed-by: Peter Krempa --- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_command.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5ff7695c375..0dbaa155fc28 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9041,7 +9041,7 @@ qemuBuildChrDeviceCommandLine(virCommand *cmd, } =20 =20 -static bool +bool qemuChrIsPlatformDevice(const virDomainDef *def, virDomainChrDef *chr) { diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 309e566f6cbe..71ce031f1ac0 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -217,6 +217,11 @@ virJSONValue *qemuBuildHotpluggableCPUProps(const virD= omainVcpuDef *vcpu) virJSONValue *qemuBuildShmemBackendMemProps(virDomainShmemDef *shmem) ATTRIBUTE_NONNULL(1); =20 +bool +qemuChrIsPlatformDevice(const virDomainDef *def, + virDomainChrDef *chr) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + virJSONValue * qemuBuildShmemDevProps(virDomainDef *def, virDomainShmemDef *shmem); --=20 2.47.0 From nobody Thu Dec 26 15:07:42 2024 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731315253326165.5056471691903; Mon, 11 Nov 2024 00:54:13 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6010C1813; Mon, 11 Nov 2024 03:54:12 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 92569188A; Mon, 11 Nov 2024 03:53:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id ADF7A1724; Mon, 11 Nov 2024 03:53:15 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 4B08D1720 for ; Mon, 11 Nov 2024 03:53:15 -0500 (EST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-534-Il21zjiFO2acw2c-vTRYEw-1; Mon, 11 Nov 2024 03:53:13 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4316e2dde9eso39838565e9.2 for ; Mon, 11 Nov 2024 00:53:13 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432b0562ccdsm165506795e9.23.2024.11.11.00.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 00:53:11 -0800 (PST) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id DD6773A63247 for ; Mon, 11 Nov 2024 09:53:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731315195; 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=wWt32XULTTzLTgvScSRY5McZACk7cwEjfdRJLxUeRkE=; b=gBTF4tTwMibmwsxHsF5Td/26Bg4y3+cT4t3C/JnJfdRp/ok4NzaT1q0w3qYorI0awgUnz2 z/NixQV5tvLvKo/vA2ym4JZ2m8vW9tFiU3c4eJZfYXC1asZWhqPq3YYpimwenok554FHKb k0eT6oOHgc0Lf0xcDz4SSZ9PUq6VuPk= X-MC-Unique: Il21zjiFO2acw2c-vTRYEw-1 X-Mimecast-MFC-AGG-ID: Il21zjiFO2acw2c-vTRYEw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731315192; x=1731919992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wWt32XULTTzLTgvScSRY5McZACk7cwEjfdRJLxUeRkE=; b=grtCRGAYsjK/tsUzsmG8xWbD66liQSvHhDWWoaii8jUj6pQrHKZHfbky/kKa3RjLNr zV16/3SuSpzbOALWU+NBoH06dHT+SBHrDda0qm/6enGLbwgyRoe8URRl9rPRnvSlKjZt DT8OJy9cAFUrAcKaQKsBatOXN5NJ3X9bC484tB7r1BjGg44HPsRuZvVr/nlxbx997F5u 7leGVKQL9aXP1S+y1n23DSbGie5SK3vBRw1HnjNW3A5uA5wu2NUeic5XQ9CkLKgXfhyq vEEk+8JjSgzFV9RgVI+IAf0zlETdg5YNmR08vylw2wBjaa6o5L6UUEokTdo4of3Cqv82 p0IA== X-Gm-Message-State: AOJu0Yy8E7MfOmQKcFo+gHoDoEtIa5loer/1L1MtDzjBGJOoD0BvRhpI R3mobrKbNu9Ezp1hWKuYyyVTHDNa4Iy3ecVz12KBtwNxHpwvSmRlvlXxFcBISO0ekrt8ioPGjXS 8Ch8Z3aLQhOV5GIBSZ46lKCQgjRuNTOELEwjqezE+jc2H6EnQ8eAeJfbA9F/Ipi6x6vvKD4agY3 2ZrcWvJcya+v6veqbCCCMSv1CRZ+9wgKXCuhvc21k= X-Received: by 2002:a05:6000:2d11:b0:381:f443:21c0 with SMTP id ffacd0b85a97d-381f44325f1mr7901969f8f.57.1731315192225; Mon, 11 Nov 2024 00:53:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoE14Rgx9+AqmMqmXkl8/EfMbzhJC/8YVL3OwfBVrC/6LF990GdOhuo5/r6hKEvAGX0Hd6Jw== X-Received: by 2002:a05:6000:2d11:b0:381:f443:21c0 with SMTP id ffacd0b85a97d-381f44325f1mr7901950f8f.57.1731315191857; Mon, 11 Nov 2024 00:53:11 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemu_hotplug: Report better error message for platform serial devices Date: Mon, 11 Nov 2024 09:53:08 +0100 Message-ID: <9b585389e4fecbd401986153b3863c6ebb39d8e4.1731315146.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: pZpSv44cGCzQXpiN56q2GhqAP8x9BEIe1HRdmHXiBqY_1731315192 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZILADS6ADW3OIROF2AQYLKWKDLVE3WAY X-Message-ID-Hash: ZILADS6ADW3OIROF2AQYLKWKDLVE3WAY X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731315253715116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This should be better than the current for both hotplug: error: internal error: Invalid target model for serial device and hot-unplug: error: An error occurred, but the cause is unknown which should not be reached at all. Resolves: https://issues.redhat.com/browse/RHEL-66222 Resolves: https://issues.redhat.com/browse/RHEL-66223 Signed-off-by: Martin Kletzander Reviewed-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1a7b69e5bb44..f856e26c1877 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2063,6 +2063,12 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver, bool need_release =3D false; bool guestfwd =3D false; =20 + if (qemuChrIsPlatformDevice(vmdef, chr)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Cannot hotplug platform device")); + return -1; + } + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) { guestfwd =3D chr->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_= TYPE_GUESTFWD; =20 @@ -6049,6 +6055,12 @@ qemuDomainDetachDeviceChr(virQEMUDriver *driver, goto cleanup; } =20 + if (qemuChrIsPlatformDevice(vmdef, tmpChr)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Cannot detach platform device")); + return -1; + } + if (vmdef->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM && tmpChr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && (tmpChr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERI= AL || --=20 2.47.0 From nobody Thu Dec 26 15:07:42 2024 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731315269132576.5133727209774; Mon, 11 Nov 2024 00:54:29 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 254AF1720; Mon, 11 Nov 2024 03:54:28 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C77A51899; Mon, 11 Nov 2024 03:53:24 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 0358E1720; Mon, 11 Nov 2024 03:53:17 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7BA1C1724 for ; Mon, 11 Nov 2024 03:53:16 -0500 (EST) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-ROO6zafsPwWR8HCBWYI-Iw-1; Mon, 11 Nov 2024 03:53:13 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-37d531a19a9so2415405f8f.1 for ; Mon, 11 Nov 2024 00:53:13 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381eda1433esm12240597f8f.111.2024.11.11.00.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 00:53:11 -0800 (PST) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id EA39B3A63248 for ; Mon, 11 Nov 2024 09:53:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731315196; 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=1ZYZlPPfmIcPdpR9PQdEHGbeE6YoE8Nx7CIHhSwQmDA=; b=IKmOfWxMwzmvm11tvjDKGa6FUaGMGMOHTs87EnsgtQ/gStXXc0s9u8GUssv6y73EqlA//P a/JJjdGMZztUn6KvKD0MKB6ZqkH+XvdFUWxZeeaN4+RKhNYgYrzWO1WYMhXm10NCS1yABW ZXWmHFAgfeIK6pYw0uTqa2AdiA7gHYY= X-MC-Unique: ROO6zafsPwWR8HCBWYI-Iw-1 X-Mimecast-MFC-AGG-ID: ROO6zafsPwWR8HCBWYI-Iw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731315192; x=1731919992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ZYZlPPfmIcPdpR9PQdEHGbeE6YoE8Nx7CIHhSwQmDA=; b=oM13LnCTkgyt0iwtfmVFrFS+gwbWkk65prcPSZAh7oYFy7ukBmn+mwKCn/fLVNQ4Gy BxAoVZZd6dt6jEmNmr/nRSJchSiTWZPKi4lP2HQD05r0ItR1SbtWw3EmyeRWa7QChN81 Rds7R9OhM23maVD/R8wYnQ01LJwW25G/ANyau2NeTtlrcF/dAW2R1+YKVrb4os8bLnU3 3YX+gpufKQ9Qi+xitrw4GWErDqIIAHBhsmsuutQeu9iI0XHqEldGXj2qJ3P3vyL2ig+l ik/x99s2BgiZjXbOp6BlbvBlOVtID7UX/tkJLfAnvQxz2L9I3ewe3cUJlByUHTxauXpa uo6Q== X-Gm-Message-State: AOJu0YwSHqAdafxOJbt3wn548k+FHR/600gcYoXzHHgrl3+VjRCxaDTc 0rWzzYxrIvXIe+YMeV9ryKa6S3UPceH1UoAfyVIZO21TgEAcmz+Cro+Odt0Du/aERvrJgzkM5eC jCeyUJ/35uwpu6MrqGjmAE3f367HpBiKX6xeB5jGkMr6rThVfWxgNa+CIOCAsNWyETXAynMa/xY CM1MpTXBL42JMxafIo23Ei1dhcvygXb+xrpvPD1uk= X-Received: by 2002:a05:6000:2710:b0:381:f604:3d55 with SMTP id ffacd0b85a97d-381f6043d97mr5815144f8f.52.1731315192425; Mon, 11 Nov 2024 00:53:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1aRVWj3We+A0vyF7wbM5DT4daUMJrhfHqH1/sZai+m45TWzT7ASuuoQIJTulcazWENtrf3Q== X-Received: by 2002:a05:6000:2710:b0:381:f604:3d55 with SMTP id ffacd0b85a97d-381f6043d97mr5815128f8f.52.1731315192099; Mon, 11 Nov 2024 00:53:12 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 3/3] qemu_hotplug: Do not report error for hot-unplugging non-existing device Date: Mon, 11 Nov 2024 09:53:09 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: X_nLpfS-_vzPbPf2m80fXrhkORJp6kF8ANF9fVLjj3Q_1731315192 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: IDRPJEVCWAWJW2M7XY26OKS35Q7C7CLF X-Message-ID-Hash: IDRPJEVCWAWJW2M7XY26OKS35Q7C7CLF X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731315270054116600 Content-Type: text/plain; charset="utf-8"; x-default="true" The code just does not match the comment above which says we should claim success. And it makes sense since a removal from qemu was requested and qemu could not find the device. Without this patch such codepath would lead to libvirt not removing the device from the XML and no error being set, but the API would still return an error value. Signed-off-by: Martin Kletzander Reviewed-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f856e26c1877..d23da0a553c0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -136,6 +136,7 @@ qemuDomainDeleteDevice(virDomainObj *vm, * domain XML is queried right after detach API the * device would still be there. */ VIR_DEBUG("Detaching of device %s failed and no event arrived"= , alias); + rc =3D 0; } } =20 --=20 2.47.0