From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.ebner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 7075599C60
 for <pve-devel@lists.proxmox.com>; Wed, 11 Oct 2023 14:31:24 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 51F018DF6
 for <pve-devel@lists.proxmox.com>; Wed, 11 Oct 2023 14:30:54 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (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 firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Wed, 11 Oct 2023 14:30:51 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7022544786;
 Wed, 11 Oct 2023 14:30:51 +0200 (CEST)
Message-ID: <1a8ae488-7f5e-4cf3-b63c-d7ba384c98a7@proxmox.com>
Date: Wed, 11 Oct 2023 14:30:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Alexandre Derumier <aderumier@odiso.com>
References: <20231010153717.2282543-1-aderumier@odiso.com>
From: Fiona Ebner <f.ebner@proxmox.com>
In-Reply-To: <20231010153717.2282543-1-aderumier@odiso.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.087 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH qemu-server] Fix: cpu hotplug feature can't
 be changed online
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 11 Oct 2023 12:31:24 -0000

Am 10.10.23 um 17:37 schrieb Alexandre Derumier:
> The cpus are passed as devices with specific id only when cpu hotplug is enable
> at start.
> We can't enable/disable it online or vcpu hotplug api will thrown errors
> not finding core id.

When removing cores after enabling the option this is true, but I can
1. start a VM without CPU hotplug and fewer than max vCPUs
2. enable CPU hotplug
3. add more cores

And doing the disable of the option online also doesn't seem problematic
at a first glance. So I thought this would technically be a breaking change.

But actually, the change is completely justified, because of migration.
Because the QEMU commandline changes based on the hotplug setting, so
the source and target VM will not agree and loading the state on the
target will get confused and crash:

> Oct 11 14:08:23 pve8a2 QEMU[160882]: kvm: get_pci_config_device: Bad config data: i=0x9a read: 8 device: 3 cmask: ff wmask: 0 w1cmask:0
> Oct 11 14:08:23 pve8a2 QEMU[160882]: kvm: Failed to load PCIDevice:config
> Oct 11 14:08:23 pve8a2 QEMU[160882]: kvm: Failed to load virtio-scsi:virtio
> Oct 11 14:08:23 pve8a2 QEMU[160882]: kvm: error while loading state for instance 0x0 of device '0000:00:05.0/virtio-scsi'
> Oct 11 14:08:23 pve8a2 QEMU[160882]: kvm: load of migration failed: Invalid argument

Therefore,
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>