From nobody Thu Nov 21 17:17:55 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 --- 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