From nobody Mon Feb 9 13:01:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1605132623; cv=none; d=zohomail.com; s=zohoarc; b=nZjl9zZGRAjH4Vx1F/fPH8VSE3rwjgrsiO0DzT229Jw1/R5LiriG4234gt8S6fZUaHObs9zJpQMzhLLgVu2t/L1dzgBs6nOv4xLEHzt4E5VYnNHFXnC11j8d/Tk7BtkcD0oILgNyYuXvySAbuqeHI/0JRmEGQcrLNl7+D8bVxvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605132623; h=Content-Type:Content-Transfer-Encoding:Cc: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=AJ+2durQcXjkwnNCtShsBpgT0zjoYBOn5q9vr+7gRRQ=; b=JIXP2t5P4EGc5uRJgXwbOYKOyRKO6aHlpAveKBjtN4sEfSUh3cRufVHvDIiV/oxk82nY6zs9bzNTspS+wStV0RLTFzz3G8AMLHV30mIqNbraoH6h6O16AF5BbnNVHbDPPcOYmjjR7H81h306S3AJcWkS3/MX7X+dJ2Awbc2gD/k= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1605132623424787.5592730044046; Wed, 11 Nov 2020 14:10:23 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-538-fXo_GJvLPEuVWBqF9RR7qA-1; Wed, 11 Nov 2020 17:10:19 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14DC964088; Wed, 11 Nov 2020 22:10:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6EA517258; Wed, 11 Nov 2020 22:10:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B564A5810D; Wed, 11 Nov 2020 22:10:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ABM7mpw006128 for ; Wed, 11 Nov 2020 17:07:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 09B9AF00D7; Wed, 11 Nov 2020 22:07:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03E2F9D460 for ; Wed, 11 Nov 2020 22:07:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E07871823601 for ; Wed, 11 Nov 2020 22:07:47 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-hK7KwGTuMaSq8eYc7x4TVw-1; Wed, 11 Nov 2020 17:07:44 -0500 Received: by mail-qt1-f194.google.com with SMTP id 7so2565459qtp.1 for ; Wed, 11 Nov 2020 14:07:44 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:b9cd:904e:d02:53c4:1c05]) by smtp.gmail.com with ESMTPSA id a200sm3427842qkb.66.2020.11.11.14.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 14:07:43 -0800 (PST) X-MC-Unique: fXo_GJvLPEuVWBqF9RR7qA-1 X-MC-Unique: hK7KwGTuMaSq8eYc7x4TVw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AJ+2durQcXjkwnNCtShsBpgT0zjoYBOn5q9vr+7gRRQ=; b=iehm2aKPV+EUSQrAd+sJ2yv7KfUctAXWYRKlTqYrlXtYhWrmnJVj9UEbFkk4luaYRH bt89W2tzdJJzZA4lfHuQIclQ7OP0MU4kvURhJQv/BulWX72kJHgSfEQCHUD7Hj288Zeq pdLuBqyy8HM5T9ciz5JgEelgZSc0O45IW5fzP8F0ToQNnZohZfJkzjo2wViC5c0L2JR0 ft7q827/zqCjnDy+25l1S3LAGS/f3HGEftZJuB3gKUDscRxFPguthMIiJubeqximMHG4 pRusc/jdD6JrSfxdEdNMIxD9R05qB13TZw1boNRrFPWexamBtvOt/b2kWqIt9dEl7StH YayQ== X-Gm-Message-State: AOAM533JzfWxUrk+DmDfw6FLF7/LRMQS40y89wPnNHrhScJEjSdoZseM bjjbxOEDRsKztbOjpUTqYF3iNt2UKjQ7HA== X-Google-Smtp-Source: ABdhPJyHHB2F2bepmlM2wEz6YEyg/hu3owEOw9byNPBUo/vviqnGVulylzjSH9M69JGEM04Ek0yBdA== X-Received: by 2002:ac8:705b:: with SMTP id y27mr25183304qtm.192.1605132464004; Wed, 11 Nov 2020 14:07:44 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 07/10] qemu_hotplug.c: avoid aligning the mem obj in qemuDomainDetachPrepMemory() Date: Wed, 11 Nov 2020 19:07:22 -0300 Message-Id: <20201111220725.356297-8-danielhb413@gmail.com> In-Reply-To: <20201111220725.356297-1-danielhb413@gmail.com> References: <20201111220725.356297-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The alignment of the mem object in qemuDomainDetachPrepMemory() allows for the virDomainMemoryFindByDef() call to find the right memory object for detach. Turns out that, after recent changes, the alignment of the mem object is already granted at this point. This function is used by qemuDomainDetachDeviceLive(), which in turn is used in two places with a memory device: - qemuDomainDetachDeviceLiveAndConfig(), after a virDomainDeviceDefParse() calll that will align the mem object via PostParse callbacks; - qemuDomainDetachDeviceAliasLiveAndConfig(), after a call to virDomainDefFindDevice() that will get the already aligned mem object from the domain definition. This means that the qemuDomainMemoryDeviceAlignSize() call at the start of this function is now obsolete and can be removed. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index c1461ac621..e0495ef59e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5682,9 +5682,9 @@ qemuDomainDetachPrepMemory(virDomainObjPtr vm, { int idx; =20 - if (qemuDomainMemoryDeviceAlignSize(vm->def, match) < 0) - return -1; - + /* 'match' is granted to be aligned at this point, either + * by PostParse callbacks when parsing it or by fetching it + * from the domain definition. */ if ((idx =3D virDomainMemoryFindByDef(vm->def, match)) < 0) { virReportError(VIR_ERR_DEVICE_MISSING, _("model '%s' memory device not present " --=20 2.26.2