From nobody Thu Apr 25 23:15:26 2024 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=1605729563; cv=none; d=zohomail.com; s=zohoarc; b=Npc3gaNifh7RvUzeEw+kDgYuJ4VlOoL9GpJW2UAACq+mX9kE4q5yaY+vO5u8gCfT1TkLe2vHstWl+6ND0sQFxyFD+p3ITvgqhunmVpDamei6x9EeYYKa1TdYkww9enajNKmlAiT+BWq651ZZ0wDAy+uzVonNsir8/gUYL224blU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605729563; 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=OPdKkVe0MDYD6RiadmlPqtS2+qcXLx2pW+CM4A5Hoa4=; b=kncOXf+Odgxt9JZco3KfVbWKoZm6L4FNvZAPZEpPnm/LlzuOmiC1GiWMsXhEivhb5M7kflZ8MIBWZJy15fMQeraBG/jLG0vzdLvm30cc9xOAuKTZZKMzKyonmumuPwRp8FLxC5eWSFaTdEkSblQNLUMLQ3i88oMCErlaoKdkkdI= 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 1605729563216713.2874346306672; Wed, 18 Nov 2020 11:59: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-500-QvmbO54ANHOC5f0T7JxQhw-1; Wed, 18 Nov 2020 14:59:19 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D4A91005D44; Wed, 18 Nov 2020 19:59:13 +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 3544910016FB; Wed, 18 Nov 2020 19:59: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 F192B8B2B6; Wed, 18 Nov 2020 19:59:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AIJwun3021586 for ; Wed, 18 Nov 2020 14:58:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD479112D40D; Wed, 18 Nov 2020 19:58:56 +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 A9AE9100414B for ; Wed, 18 Nov 2020 19:58:54 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 583AF1823603 for ; Wed, 18 Nov 2020 19:58:54 +0000 (UTC) Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-AHgIF8sCNWyRhlJ0crGgmQ-1; Wed, 18 Nov 2020 14:58:51 -0500 Received: by mail-qv1-f65.google.com with SMTP id z17so1649921qvy.11 for ; Wed, 18 Nov 2020 11:58:51 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:d88a:482:7c39:5cca:96f6]) by smtp.gmail.com with ESMTPSA id n21sm7022757qke.21.2020.11.18.11.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:58:50 -0800 (PST) X-MC-Unique: QvmbO54ANHOC5f0T7JxQhw-1 X-MC-Unique: AHgIF8sCNWyRhlJ0crGgmQ-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=OPdKkVe0MDYD6RiadmlPqtS2+qcXLx2pW+CM4A5Hoa4=; b=IN1rYANwTGeB6OtPKKxVNK4/bzITJ2ArxMxMOPZuSYc8XdcFOU7IAYnmsJR94g96cQ B4gpZjQFbTGUYQZJmtZaotBxLVGk+Ez74ZkRA/GHsBJXSVCdHFJ11Y75ViAw4nukfgDB 44LZiKq3MhpbDZefxXnFcF6pI3zej+j5m2qKqZj5Nlfboim41YVbL5F1qp7uj7dU06GL ueWTPfaK8dDcn7rKdjIr18aMzn8YB/S6Kmclvph33RnKYqSncEIQPKbd4G/rvU4UbWr8 +CobNjuGJnpoY4h/fEFDfgTmM6d+40TQXZt8aQvxsF0LBmriIXUyEUX5UeYX8yxC0OK0 DoFg== X-Gm-Message-State: AOAM530MzWd6H47jK69/In/w6VjtCQNgLbSMGxDri2k2mKR3xbV3upig 43OYykgAPALPxDM5WLVU1bVxZ+E8ScM= X-Google-Smtp-Source: ABdhPJw7A+1Dbhdr7QiVBotet72X3Ay1o2t5wEvhouf8wXL4IWfx0TXoqIEEehlHXBq1nypN0h30LA== X-Received: by 2002:a05:6214:6a2:: with SMTP id s2mr6435306qvz.58.1605729530517; Wed, 18 Nov 2020 11:58:50 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 1/6] qemu_process.c: check migrateURI when setting VIR_QEMU_PROCESS_START_NEW Date: Wed, 18 Nov 2020 16:58:29 -0300 Message-Id: <20201118195834.1187381-2-danielhb413@gmail.com> In-Reply-To: <20201118195834.1187381-1-danielhb413@gmail.com> References: <20201118195834.1187381-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.78 on 10.11.54.3 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.84 on 10.5.11.22 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" qemuProcessCreatePretendCmdPrepare() is setting the VIR_QEMU_PROCESS_START_NEW regardless of whether this is a migration case or not. This behavior differs from what we're doing in qemuProcessStart(), where the flag is set only if !migrate && !snapshot. Fix it by making the flag setting consistent with what we're doing in qemuProcessStart(). Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_process.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 579b3c3713..3677da635c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7436,7 +7436,10 @@ qemuProcessCreatePretendCmdPrepare(virQEMUDriverPtr = driver, VIR_QEMU_PROCESS_START_AUTODESTROY, -1); =20 flags |=3D VIR_QEMU_PROCESS_START_PRETEND; - flags |=3D VIR_QEMU_PROCESS_START_NEW; + + if (!migrateURI) + flags |=3D VIR_QEMU_PROCESS_START_NEW; + if (standalone) flags |=3D VIR_QEMU_PROCESS_START_STANDALONE; =20 --=20 2.26.2 From nobody Thu Apr 25 23:15:26 2024 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=1605729565; cv=none; d=zohomail.com; s=zohoarc; b=WSV51IiJvA45B+g3CXSg10b6rYzkgXy1WFZ1Y3uSaYR9qBVsptS0VyFdh74/hwZU5BCOBL4g04aJBdNhXF5E03YH2nBx+T8cP1v9EFKtZP3rR5qDxLglt6NgXAPoYLWx8gQeflPuny+MBTAapr+9+AU3BVgmLwFbZAwSLHZw/GE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605729565; 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=6mDBvpqkNtQravJ5h6zGf8p8VrqXHk+K9TJdx4BbOO0=; b=LbhQrmCwSlQSzDsBOMuOy0GY+hv538CjlGXw5etxHfJXk+GhhzG4YFfOvJTgCxyKEdfQ0LJQZiFMB/yuGgosROLeNBn926s6k7o/WZbWxPgHbdJ4sQxWVZfUi/Gm/HGHi6zw35SrRgTNHrlnx6KOSNu4fI+z66c1Rzl+FUhulK4= 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 1605729565759893.6913281143311; Wed, 18 Nov 2020 11:59:25 -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-502-Tak0NphHO02K2JzBM8eDjw-1; Wed, 18 Nov 2020 14:59:22 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8631810919E8; Wed, 18 Nov 2020 19:59:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F6CC10016FF; Wed, 18 Nov 2020 19:59:16 +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 DABA41809CA2; Wed, 18 Nov 2020 19:59:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AIJwvMV021591 for ; Wed, 18 Nov 2020 14:58:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D8622166BA3; Wed, 18 Nov 2020 19:58:57 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 688332166BA2 for ; Wed, 18 Nov 2020 19:58:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 1D0531021F7C for ; Wed, 18 Nov 2020 19:58:55 +0000 (UTC) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-65-o-a1NH-VNvqKrxyKTqNeKA-1; Wed, 18 Nov 2020 14:58:52 -0500 Received: by mail-qk1-f176.google.com with SMTP id u4so3057662qkk.10 for ; Wed, 18 Nov 2020 11:58:52 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:d88a:482:7c39:5cca:96f6]) by smtp.gmail.com with ESMTPSA id n21sm7022757qke.21.2020.11.18.11.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:58:51 -0800 (PST) X-MC-Unique: Tak0NphHO02K2JzBM8eDjw-1 X-MC-Unique: o-a1NH-VNvqKrxyKTqNeKA-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=6mDBvpqkNtQravJ5h6zGf8p8VrqXHk+K9TJdx4BbOO0=; b=GLJSJn5rYhm0DCzd8tJ9bJ5EKmMMSqwu5YsPnn4rlI7asLVt5RGhoKXcLcYs+adld8 1O5r+T3sbfHG8fiI8Wxn43gbsvtBcKgn2jOPJBHrqzb9HYNAx4EATBncQ0sm38ih0nvB Q97u8rqFJ2wPnGgKcs0MBO2oBcPjI7M1xg30q2RYscq9aFMYZ7UqGPJLMJiZnC2o4+CJ TG8V2k6cM8kZ+1Yh6TjN5H0Y6Rd6hccD9CdbXzRkF40L9+KFQj2M5T4ty6Cq7qUhnRao vJEaZZ3ClMF9xp2qjmLhz3FyJKUNeOdFwELObNKUlsJYBW3wNuQ9WfWkmWar9zt86TNg TuKQ== X-Gm-Message-State: AOAM533OuKXQekcWuFkX5qs71f4t7r0tEWuZqHokyUSSo5dk835AikAc y9LfFZNyeyQSgkrEvcWm8+NHtyECg7Y= X-Google-Smtp-Source: ABdhPJzMsQPLqYIPpWxLER71vFNvnmrguSln/ikjE4+lIj4UlA2jQotYJxqniByqiJIKp7ANZTaP8Q== X-Received: by 2002:a37:9e16:: with SMTP id h22mr6462227qke.481.1605729531991; Wed, 18 Nov 2020 11:58:51 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 2/6] qemu: move memory size align to qemuProcessPrepareDomain() Date: Wed, 18 Nov 2020 16:58:30 -0300 Message-Id: <20201118195834.1187381-3-danielhb413@gmail.com> In-Reply-To: <20201118195834.1187381-1-danielhb413@gmail.com> References: <20201118195834.1187381-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.78 on 10.11.54.6 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.84 on 10.5.11.22 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" qemuBuildCommandLine() is calling qemuDomainAlignMemorySizes(), which is an operation that changes live XML and domain and has little to do with the command line build process. Move it to qemuProcessPrepareDomain() where we're supposed to make live XML and domain changes before launch. qemuProcessStart() is setting VIR_QEMU_PROCESS_START_NEW if !migrate && !snapshot, same conditions used in qemuBuildCommandLine() to call qemuDomainAlignMemorySizes(), making this change seamless. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_command.c | 3 --- src/qemu/qemu_process.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 34b5746c1a..2bcdb28244 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9792,9 +9792,6 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, =20 qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps); =20 - if (!migrateURI && !snapshot && qemuDomainAlignMemorySizes(def) < 0) - return NULL; - if (qemuBuildMemCommandLine(cmd, def, qemuCaps, priv) < 0) return NULL; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3677da635c..39c3edf4b9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6493,6 +6493,12 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, if (qemuExtDevicesPrepareDomain(driver, vm) < 0) return -1; =20 + if (flags & VIR_QEMU_PROCESS_START_NEW) { + VIR_DEBUG("Aligning guest memory"); + if (qemuDomainAlignMemorySizes(vm->def) < 0) + return -1; + } + for (i =3D 0; i < vm->def->nchannels; i++) { if (qemuDomainPrepareChannel(vm->def->channels[i], priv->channelTargetDir) < 0) --=20 2.26.2 From nobody Thu Apr 25 23:15:26 2024 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=1605729552; cv=none; d=zohomail.com; s=zohoarc; b=K0jt30pBOxlMoJqi20yTzjl0jD9T5E1oSp0YbQRfbRiCR0b3idPyi5YDqvPVPACYdsW3HBZT+L0/WAzZ3DDsgWWqOJYOhiLCBJIT0Y7iP/HEL1YS5JzHXI7+ncGj8A5RTS+zA3EfqPB5w9ejA062d6qS2Er8qfCAwK6qxqbKIGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605729552; 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=/rkgMI7klqfy+YWxseigt9SszeQV7AGqgUK32dDZn/w=; b=dwKmoep/EQ/tjmEJQzAX9AmYDLHx9zpuCp/AGtDIyJfzYZsxp9MBjv9P13THNI7/xxLcj6PVxOX2/qvsY0W+UHvKjcXwjYyTeg/V0LrRYhSe9UzFE9ylOfBCVerHNlz5gGIx/YgYrWXKxwt71EKjpTtGAeV5I81Q8ssBxOZ4FkA= 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 1605729552306313.6544431895396; Wed, 18 Nov 2020 11:59:12 -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-244-2RBr1Lw1MOGq-e-A2mkAAA-1; Wed, 18 Nov 2020 14:59:09 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 746F21005D4C; Wed, 18 Nov 2020 19:59:03 +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 762251964E; Wed, 18 Nov 2020 19:59:02 +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 0FAED44A5C; Wed, 18 Nov 2020 19:59:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AIJwwvk021598 for ; Wed, 18 Nov 2020 14:58:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2ADB12166BA3; Wed, 18 Nov 2020 19:58:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 261B02166B44 for ; Wed, 18 Nov 2020 19:58:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 15592858F11 for ; Wed, 18 Nov 2020 19:58:58 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-54-eTm8OcXOMGSFAjDgKw3qpg-1; Wed, 18 Nov 2020 14:58:56 -0500 Received: by mail-qk1-f196.google.com with SMTP id q5so3045639qkc.12 for ; Wed, 18 Nov 2020 11:58:55 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:d88a:482:7c39:5cca:96f6]) by smtp.gmail.com with ESMTPSA id n21sm7022757qke.21.2020.11.18.11.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:58:52 -0800 (PST) X-MC-Unique: 2RBr1Lw1MOGq-e-A2mkAAA-1 X-MC-Unique: eTm8OcXOMGSFAjDgKw3qpg-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=/rkgMI7klqfy+YWxseigt9SszeQV7AGqgUK32dDZn/w=; b=oCRRVKPG1WzYDDCGIZMz4+3vEu67hBAY0OLyC7K3foRnUGw0qjtenijWZDN+hQ1UQj pJd9qVA96NwwpMFELW4iYfjzyQj9dXq4Ozr+foG98i0knw4rsDs4+ULqAio+fI4oeFu0 REEDWZYxi0amvz6iYy4zko7BlOt89UEKWkxvM/uFeUQmNI+V0QhHxulqG1daszyDHu4o 6/txOoiPjgC8N2Uf8PrsGcgADQM17UcbVTvPEtES0I3WGLhh7RVGuwPL2pWAHs3bA+D/ jYuIk2pA8pCw8cS4N1wfEzjDIrlbk4y/7avJf3Cz77ReCSOM1+JJGNTUY9un6rVlmy4L F2Gw== X-Gm-Message-State: AOAM5301SqrgqDjpvS0m2qiOTlFNJ7vVtC9Ds5bwvdy4byxVWXy6Z4EM NvlR+6fY84jB58qxRCoOrgDkwrzR2Yd5fA== X-Google-Smtp-Source: ABdhPJzX8nZeH3z+vGGrx2K4IpYUbJVTAjSirgTeJHXLd1ahL1FiTsdQypA6XoHo4JIx2i7e6fw7vw== X-Received: by 2002:a37:6351:: with SMTP id x78mr6389592qkb.301.1605729533414; Wed, 18 Nov 2020 11:58:53 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 3/6] Revert "domain_conf.c: auto-align pSeries NVDIMM in virDomainMemoryDefPostParse()" Date: Wed, 18 Nov 2020 16:58:31 -0300 Message-Id: <20201118195834.1187381-4-danielhb413@gmail.com> In-Reply-To: <20201118195834.1187381-1-danielhb413@gmail.com> References: <20201118195834.1187381-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.78 on 10.11.54.6 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.84 on 10.5.11.23 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 code to align ppc64 NVDIMMs on post parse was introduced in commit d3f3c2c97f9b. That commit failed to realize that we can't align memory unconditionally. As of commit c7d7ba85a624 ("qemu: command: Align memory sizes only on fresh starts"), all memory alignment should be executed only when we're not migrating or in a snapshot. This revert does not break any guests in the wild, given that ppc64 NVDIMMs are still being aligned in qemuDomainAlignMemorySizes(). Next patch will introduce a mechanism where we can have post parse NVDIMM alignment for pSeries without breaking the intended design, as defined by c7d7ba85a624. This reverts commit d3f3c2c97f9b92c982ff809479495f44614edb88. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 23 +------------------ .../memory-hotplug-nvdimm-ppc64.xml | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 498a8b6ef0..961f292e1f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5351,24 +5351,6 @@ virDomainVsockDefPostParse(virDomainVsockDefPtr vsoc= k) } =20 =20 -static int -virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, - const virDomainDef *def) -{ - /* Although only the QEMU driver implements PPC64 support, this - * code is related to the platform specification (PAPR), i.e. it - * is hypervisor agnostic, and any future PPC64 hypervisor driver - * will have the same restriction. - */ - if (ARCH_IS_PPC64(def->os.arch) && - mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - virDomainNVDimmAlignSizePseries(mem) < 0) - return -1; - - return 0; -} - - static int virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, const virDomainDef *def, @@ -5414,10 +5396,6 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef= Ptr dev, ret =3D 0; break; =20 - case VIR_DOMAIN_DEVICE_MEMORY: - ret =3D virDomainMemoryDefPostParse(dev->data.memory, def); - break; - case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_INPUT: @@ -5432,6 +5410,7 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefP= tr dev, case VIR_DOMAIN_DEVICE_SHMEM: case VIR_DOMAIN_DEVICE_TPM: case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_MEMORY: case VIR_DOMAIN_DEVICE_IOMMU: case VIR_DOMAIN_DEVICE_AUDIO: ret =3D 0; diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml index ecb1b83b4a..ae5a17d3c8 100644 --- a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml +++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml @@ -38,7 +38,7 @@ /tmp/nvdimm - 524416 + 550000 0