From nobody Sun Oct 5 01:50:07 2025 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=1757491591; cv=none; d=zohomail.com; s=zohoarc; b=AdgLAQRcSrQnxMRUwHVbfeqSL9bojF24ckhYwaPA9JMZEWZJTDm7LHg+EOI9BRL7usjuZek+l9pNaM2kXlCC+OwQvqjJSIsv6gWHBP/vQ+KmggPaaIvCa/u34RA+ahj+fCHD0ZoKTEQEP+1tDtFpzOR97myH9Q+fvTEIsbM+u6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757491591; 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=+I2FDI7dpnaquEFQ4//koFPiucRikzGqeRWLlMDlP/k=; b=W6zk32f/xT7vVPHv/sj5mWlEdeiJDWzT+i0upbtomx9fhloayr+kbK7uSopf/NtLTUh+5NQjP46JnJCVDAhmz08srn/u2YOrZHPra8U5rD862prMyYfjSmeUWQM5PQuKDKM0zbJKaX7bCQyReOwlNeT4vNXopOfxz1uEmtT4sOA= 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 1757491591421829.7038395472096; Wed, 10 Sep 2025 01:06:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C9E6841B6D; Wed, 10 Sep 2025 04:06:30 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 301CC43E07; Wed, 10 Sep 2025 04:04:28 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D663941AFC; Wed, 10 Sep 2025 04:03:51 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 0C29841A9A for ; Wed, 10 Sep 2025 04:03:51 -0400 (EDT) Received: from mx-prod-mc-06.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-137-ZZSi0SAOPPKyREjuDiDKcA-1; Wed, 10 Sep 2025 04:03:49 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8CD6D1800378 for ; Wed, 10 Sep 2025 08:03:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E7D6219560AB for ; Wed, 10 Sep 2025 08:03:47 +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=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, 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=1757491430; 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=+I2FDI7dpnaquEFQ4//koFPiucRikzGqeRWLlMDlP/k=; b=hN8IzsOu2xQjJ3pwiH4cmwlsBjsoa9J31bx4kukGlrAbEa1fUTfLiHeXgws4PvcloPMNSx MuYRiJEnUp00SxCDoLHbUb/qJ7OElG3+OmT9/l9a4lzP8GL8ceCMeXwH7CJOETYaj4XGIa F8CDmLcIos9Pmqnht/UBjql7xVhs3CE= X-MC-Unique: ZZSi0SAOPPKyREjuDiDKcA-1 X-Mimecast-MFC-AGG-ID: ZZSi0SAOPPKyREjuDiDKcA_1757491428 To: devel@lists.libvirt.org Subject: [PATCH 2/4] ch: Drop deadcode from chDomainDetachDeviceLive() Date: Wed, 10 Sep 2025 10:03:39 +0200 Message-ID: <54009d67d2ca8fd53c166d497ffc4b7db6ea7e41.1757491293.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: OWwsw5BD0aL0c-qPE4qCSd6XuKks_eJwi9GG7Uyc0BU_1757491428 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3ZU4DHLMELOBYLB64F4QS3PVMGPIBVIR X-Message-ID-Hash: 3ZU4DHLMELOBYLB64F4QS3PVMGPIBVIR 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: 1757491593726154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik At the end of chDomainDetachDeviceLive() there's a code that tries to remove the disk that's being detached from the domain definition. Well, it's a leftover from the original patch which I forgot to remove when rewriting it to use chDomainRemoveDevice(). The disk is removed there so this code has no chance in removing it again. Drop the code. Signed-off-by: Michal Privoznik --- src/ch/ch_hotplug.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ch/ch_hotplug.c b/src/ch/ch_hotplug.c index b06fdbe5a8..aa723dd123 100644 --- a/src/ch/ch_hotplug.c +++ b/src/ch/ch_hotplug.c @@ -263,7 +263,6 @@ chDomainDetachDeviceLive(virDomainObj *vm, virDomainDeviceDef detach =3D { .type =3D match->type }; virDomainDeviceInfo *info =3D NULL; virCHDomainObjPrivate *priv =3D vm->privateData; - int idx =3D 0; =20 switch (match->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -339,13 +338,6 @@ chDomainDetachDeviceLive(virDomainObj *vm, if (chDomainRemoveDevice(vm, &detach) < 0) return -1; =20 - if (match->type =3D=3D VIR_DOMAIN_DEVICE_DISK) { - idx =3D chFindDiskId(vm->def, match->data.disk->dst); - if (idx >=3D 0) { - virDomainDiskRemove(vm->def, idx); - } - } - return 0; } =20 --=20 2.49.1