From nobody Mon Feb 9 06:01:40 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=1681309526; cv=none; d=zohomail.com; s=zohoarc; b=Z9Ztp24/zD+UdGhLcA7TEvXglEsxSIMbOsNIENmbNASwPm30enalG0LD9PdkkyZPx5asUNcW5sIBM+/+voOeDrjNPIdPHnKCyFD9B6TKXEFqjh1BwMUj5cTVAa40ahGQOJSdsefN+0maRCZrX4cabpSll4mWAnc60QhdWr0n0hs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681309526; 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=Qt1I/AuvcNIfO4aqKL55vEI6T/E5yf5Fk9wM9TMjRXA=; b=gwu3tJAxMmo7fDYENps64TWJNzTHXt/0pwHkLsLpOk4DyhJcrKbO+olhJThI2RogKqz4gjN1uqvdAU0xCnjHUajhr9nbWdbgrApkITIuhD4xPZWDGMoYVsy1W1J2fQw9QmfOQsghu3THXbX3zmPlhfiPRB3FWNdAXUA5Y1diba0= 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 1681309526307259.3517870595912; Wed, 12 Apr 2023 07: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-392-CkYTDMzgMielmQuvVn4tWg-1; Wed, 12 Apr 2023 10:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07833381494D; Wed, 12 Apr 2023 14:25:18 +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 E9994C15BB8; Wed, 12 Apr 2023 14: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 D9D2D194658F; Wed, 12 Apr 2023 14:25:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 88AF51946A41 for ; Wed, 12 Apr 2023 14:25:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6B82F2027043; Wed, 12 Apr 2023 14:25:16 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC4C92027EAD for ; Wed, 12 Apr 2023 14:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681309525; 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=Qt1I/AuvcNIfO4aqKL55vEI6T/E5yf5Fk9wM9TMjRXA=; b=YE9ErJr6KGXP1gIQnmCJkzkApx2g2FioP9krjBrYmpYd1gnVJJp33ga4BFemttH83CPWVg V1UxeS84MFQp2cj3YJc1Q6PCqd7NH25BIGpAAz0PyaL34sHMWHWc6R8AyHl9XlpvQfpQ+L NlPZzHiY29kF2SnZd57j9UxMP3iZTfM= X-MC-Unique: CkYTDMzgMielmQuvVn4tWg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/5] qemu_hotplug: Deny live detach of Date: Wed, 12 Apr 2023 16:25:10 +0200 Message-Id: <25e8696106dfc388d9b02ddfefb841d02c8b5d2c.1681307447.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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.8 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: 1681309527870100003 Content-Type: text/plain; charset="utf-8"; x-default="true" I've tried, then I've tried even harder, but still wasn't able to make sense of our console backcompat code in all its fine details. Since I value my sanity, let's just forbid hotunplug of , especially since detaching of corresponding works. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d9a102191f..5072798cb7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5693,6 +5693,16 @@ qemuDomainDetachDeviceChr(virQEMUDriver *driver, goto cleanup; } =20 + 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 || + tmpChr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE= )) { + /* Raise this limitation once device removal works. */ + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("detaching of is unsupported. Try corr= esponding instead")); + goto cleanup; + } + /* guestfwd channels are not really -device rather than * -netdev. We need to treat them slightly differently. */ guestfwd =3D tmpChr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHAN= NEL && --=20 2.39.2