From nobody Sun May 19 07:12:07 2024 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=1674831929; cv=none; d=zohomail.com; s=zohoarc; b=O+3SkDab6SZGPKGf7K/6rr/GOBElHLj803FJjAdFJA4qyXfNz9vgIj2hMI6VUoEnGDSYTVFAsb0HMxq+WJqZgG8+FHdjk71UOTF1jpYG3vliR3QmkLOdBUtQMryoY9kZvOA6bg2MUT9h8nKnEq3Wuok9/XOW6anhFS7twWhrfOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674831929; 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=8dOjSDUI6ZBgqptKcl0WLUtuj5eyAiqiVd/Hdwe5g/Y=; b=jhdE1Y8hWKSPaWS3dFuQWZVjtTCWiR59Hr93sw1+PER4r2LWapJLRu+19+J3jwexBHAgaYDnd0GxWbji2ymL0UzeWGHxTOGX3JLs9tYVsLUh4Ll8U8LrtJN5MnepbpMMQuHDwDAaFYG2vEmFOcgIRwAaLU93zrRdk530p1s8FLk= 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 1674831929798292.2427470316404; Fri, 27 Jan 2023 07:05:29 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-R8hfHYovPiKskdbXvMAQUg-1; Fri, 27 Jan 2023 10:05:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA3BC80D0E6; Fri, 27 Jan 2023 15:05:14 +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 A03F92166B31; Fri, 27 Jan 2023 15:05:14 +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 8DE1D19465B8; Fri, 27 Jan 2023 15:05:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A20A194658C for ; Fri, 27 Jan 2023 15:05:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F144318EC1; Fri, 27 Jan 2023 15:05:10 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 992827AD4 for ; Fri, 27 Jan 2023 15:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674831928; 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=8dOjSDUI6ZBgqptKcl0WLUtuj5eyAiqiVd/Hdwe5g/Y=; b=B7NQjIYG3KwmdIzHxrm+tlnjxK5Jx26L79+SpDEz6L4SP6EV5FLQvpBXGE4dwbOk+Q3++y fz2tYb84gDsg8M6sPjgNro0S2n6n/DEvV+493+9L79L2BMzQHRSDCCgZS1/PC8BpSoTw48 VtG0HURsPQwAKT9UJkJ0ObHvzdjDLZw= X-MC-Unique: R8hfHYovPiKskdbXvMAQUg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] qemuProcessStop: Fix detection of outgoing migration for external devices Date: Fri, 27 Jan 2023 16:05:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.6 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: 1674831930680100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When cleaning up host in qemuProcessStop(), our external helper processes (e.g. swtpm) want to know whether the domain is being migrated out or not (so that they restore seclabels on a device state that's on a shared storage). This fact is reflected in the @outgoingMigration variable which is set to true if asyncJob is anything but VIR_ASYNC_JOB_MIGRATION_IN. Well, we have a specific job for outgoing migration (VIR_ASYNC_JOB_MIGRATION_OUT) and thus we should check for that. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4afd12e3fa..6718915293 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8398,7 +8398,7 @@ void qemuProcessStop(virQEMUDriver *driver, qemuDomainCleanupRun(driver, vm); =20 outgoingMigration =3D (flags & VIR_QEMU_PROCESS_STOP_MIGRATED) && - (asyncJob !=3D VIR_ASYNC_JOB_MIGRATION_IN); + (asyncJob =3D=3D VIR_ASYNC_JOB_MIGRATION_OUT); qemuExtDevicesStop(driver, vm, outgoingMigration); =20 qemuDBusStop(driver, vm); --=20 2.39.1 From nobody Sun May 19 07:12:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1674831923; cv=none; d=zohomail.com; s=zohoarc; b=VxEhbAECJ3VT/qNZEB/oEln0uGC+OGFxWn5rvkRfYWibWfyPjlnhdQlpSSuyXPd2pZU3Yi8Ug408Q6Y0Dm9AnYW+B/w7M0dUpGzw+twqEN1XUqJhefpOYfA/noVSUH0r34+BwBcWAFVmu7Ul7WfCvezQJMlAgUZ/Wq0m2UkocLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674831923; 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=l8PpY6j4+08sbA7lqMLBt9l2fC5pSyztZlb6liz6wfk=; b=VRqbXBgYcEt4LEzktkLStU/w17qJONGqon0skjP6mK7XiilY05wbWpxRrUqRV5kmT18ki3/Ypegox91hNlrjrr249ZzI0d4Uj8RCO1OyNi2HV06nKcCEdVOjUlLrYF5c7+/Hw/RsxBhL4aMEAqim4XiWGSnZqRMLz+p09IecYbk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1674831923008281.5177863312224; Fri, 27 Jan 2023 07:05:23 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179-oxU2XMp2PSClwKfVmFQV3A-1; Fri, 27 Jan 2023 10:05:19 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 75A231875042; Fri, 27 Jan 2023 15:05:14 +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 5FD3040C200D; Fri, 27 Jan 2023 15:05:14 +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 539EA194658D; Fri, 27 Jan 2023 15:05:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A7D4B194658C for ; Fri, 27 Jan 2023 15:05:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8DD9F18EC1; Fri, 27 Jan 2023 15:05:11 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34CD27AD4 for ; Fri, 27 Jan 2023 15:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674831922; 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=l8PpY6j4+08sbA7lqMLBt9l2fC5pSyztZlb6liz6wfk=; b=Hx1wk0E8LUTr9YyF6dAZB1T0eoAbWdYJxiWjPKh/E8LdmqpTNmj7EwmjTpX5u/5qtUyGl4 LNS///IM/dwbT52S9mgaVXAr6qSJQNjvkEuK48hpH/GFhskzDEx1OijPOvKMTsMk75S5Dg UaAcJrAX6XdYkQifCEQZClrCqvYYifM= X-MC-Unique: oxU2XMp2PSClwKfVmFQV3A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] qemuExtTPMStop: Restore TPM state label more often Date: Fri, 27 Jan 2023 16:05:07 +0100 Message-Id: <807005cffcbaaf4d41d7c6d12b5a11c9f0dbdaad.1674831875.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.1 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: 1674831924535100002 Content-Type: text/plain; charset="utf-8"; x-default="true" When stopping swtpm we can restore the label either on just the swtpm's domain specific logfile (/var/log/swtpm/libvirt/qemu/...), or on the logfile and the state too (/var/lib/libvirt/swtpm/...). The deciding factor is whether the guest is stopped because of outgoing migration OR the state is on a shared filesystem. But this is not correct condition, because for instance saving the guest into a file (virsh save) is also an outgoing migration. Alternatively, when the swtpm state is stored on a shared filesystem, but the guest is destroyed (virsh destroy), i.e. stopped because of different reason than migration, we want to restore the seclabels. The correct condition is: skip restoring the state on outgoing migration AND shared filesystem. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2161557 Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index b2748eb6a4..5831ffc32e 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -1142,7 +1142,7 @@ qemuExtTPMStop(virQEMUDriver *driver, return; =20 qemuTPMEmulatorStop(cfg->swtpmStateDir, shortName); - if (outgoingMigration || qemuTPMHasSharedStorage(vm->def)) + if (outgoingMigration && qemuTPMHasSharedStorage(vm->def)) restoreTPMStateLabel =3D false; =20 if (qemuSecurityRestoreTPMLabels(driver, vm, restoreTPMStateLabel) < 0) --=20 2.39.1 From nobody Sun May 19 07:12:07 2024 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=1674831968; cv=none; d=zohomail.com; s=zohoarc; b=h+AWYiyHDK2XBGQbIBP7E2xPOowmCK269PcIAyz4+ysaV5Maq7I46k9TpWE/2zFZnAtbHX1rW8remtGCvUQLfcOVXVJPX9VLB2+OUqum/XNX1eEB+HsjVGsP1kUefP5xqOoClpYUQDZ0terjKdqsqgpqwYD+6QrW0KP7O6vbtHk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674831968; 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=/PA++QDIjQp8yiHK0tFAa8HRl00mfpJZOJUfaTE5McQ=; b=XdwWjvEXULjQTeHfgSrj0+H1n45HxbGOqg3KCph6PervEOukHJuWVwWkdI8r57KI/GuEHk8B3Jns3DAKgzdNoa4zCzKLoycWDvhWWKxQa+RNiuKX4b1RPXCcLTblntFVFSntep2rtVFdCrdTZe/s36+jaPUKb3w8JdsrWVFCsDM= 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 1674831968389674.1674016117947; Fri, 27 Jan 2023 07:06:08 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-u4bSDtmjPJWqOXpiWw7ONg-1; Fri, 27 Jan 2023 10:05:20 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14431857A89; Fri, 27 Jan 2023 15:05:14 +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 AD7572026D4B; Fri, 27 Jan 2023 15:05:13 +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 5439D194658D; Fri, 27 Jan 2023 15:05:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 43D8F19465B7 for ; Fri, 27 Jan 2023 15:05:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2766B7AD4; Fri, 27 Jan 2023 15:05:12 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id C34BB18EC1 for ; Fri, 27 Jan 2023 15:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674831967; 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=/PA++QDIjQp8yiHK0tFAa8HRl00mfpJZOJUfaTE5McQ=; b=PhsqNpcYQbACgSmG7u7kywhWpbguzJiHS+o7OOKHBB68XOEyTDVczOpCmhQ/ySu8Btt4bT UozGs7IIRiqx1VwXxD3Yoadj3JLxmjkN/pyeklx3H6QmnRmQTDcE2F9/umuNp+DaLub780 5fmMBNspr3Nc/pCCnA3J3z+t4TF3VKs= X-MC-Unique: u4bSDtmjPJWqOXpiWw7ONg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/3] qemuProcessLaunch: Tighten rules for external devices wrt incoming migration Date: Fri, 27 Jan 2023 16:05:08 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.4 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: 1674831968870100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When starting a guest, helper processes are started first. But they need a bit of special handling. Just consider a regular cold boot and an incoming migration. For instance, in case of swtpm with its state on a shared volume, we want to set label on the state for the cold boot case, but don't want to touch the label in case of incoming migration (because the source very specifically did not restore it either). Until now, these two cases were differentiated by testing @incoming against NULL. And while that makes sense for other aspects of domain startup, for external devices we need a bit more, because a restore from a save file is also 'incoming migration'. Now, there is a difference between regular migration and restore from a save file. In the former case we do not want to set seclabels in the save state. BUT, in the latter case we do need to set them, because the code that saves the machine restored seclabels. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6718915293..f9789650bc 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7621,6 +7621,7 @@ qemuProcessLaunch(virConnectPtr conn, size_t nnicindexes =3D 0; g_autofree int *nicindexes =3D NULL; unsigned long long maxMemLock =3D 0; + bool incomingMigrationExtDevices =3D false; =20 VIR_DEBUG("conn=3D%p driver=3D%p vm=3D%p name=3D%s id=3D%d asyncJob=3D= %d " "incoming.uri=3D%s " @@ -7675,7 +7676,13 @@ qemuProcessLaunch(virConnectPtr conn, if (qemuDomainSchedCoreStart(cfg, vm) < 0) goto cleanup; =20 - if (qemuExtDevicesStart(driver, vm, incoming !=3D NULL) < 0) + /* For external devices the rules of incoming migration are a bit stri= cter, + * than plain @incoming !=3D NULL. They need to differentiate between + * incoming migration and restore from a save file. */ + incomingMigrationExtDevices =3D incoming && + vmop =3D=3D VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START; + + if (qemuExtDevicesStart(driver, vm, incomingMigrationExtDevices) < 0) goto cleanup; =20 if (!(cmd =3D qemuBuildCommandLine(vm, --=20 2.39.1