From nobody Sun Feb 8 22:20:47 2026 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=1691590500; cv=none; d=zohomail.com; s=zohoarc; b=CImTb0XRkQd3WgXnFUAEQl5iNHAQWgKxiQ/aanOPl2FbLnoeogPxWZ2It3EE/FDNbFsXAue7J3RnkidxExtWKPXBepRkzNXrSjC5YYic8iV4iqL+AP2DeaQ0Uno9ZyNqfztc3kkEDQvvE7HuLCCNP6VTWnJuglD7K2MH2eQyh7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691590500; 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=RVPv9Func7u51oBo4Gl3fNfznzjSGlTa17SBG9+EocE=; b=SguTrGFwvKLMBET/ftZfrk40j+bXiSpBKldswnUqDJgn1PE5GI8bRMj18sPiOnmX+Bqq874XkC7E4czAEsaBqLXDUdLzd3HdkYRm/gU4E94F4yaxj/1OdVCNhPZVIlRvX14DqSw6hDgdkY+5N57Er/SbggjdGSOSLZZIias4Y3o= 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 1691590500753947.3350840550017; Wed, 9 Aug 2023 07:15:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-nklq1aKsNc27-hvmwbZjJw-1; Wed, 09 Aug 2023 10:14:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EDFF3C0FCA2; Wed, 9 Aug 2023 14:14:51 +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 A7E8DC15E6B; Wed, 9 Aug 2023 14:14:50 +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 7AAD819465B8; Wed, 9 Aug 2023 14:14:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 945C019465A3 for ; Wed, 9 Aug 2023 14:14:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6F0DD401E6A; Wed, 9 Aug 2023 14:14:26 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5E18401E63 for ; Wed, 9 Aug 2023 14:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691590499; 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=RVPv9Func7u51oBo4Gl3fNfznzjSGlTa17SBG9+EocE=; b=SORiLTh5Yx6C4D2Tub05dn2hj3vDcZzg+8YYuK/pm+srveLr4ukgkb1o7MOlVTLXUhBLmn AoY7veaYFhaWoa1WlrXasKHaWRi1sbrIogphVfCteXoYSOGgJmAjGcNrt7nqbrBasy6Sfp y58Ks17LXDkcxZ3CiXK2z7Q7mQ1hfxQ= X-MC-Unique: nklq1aKsNc27-hvmwbZjJw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/4] qemuMigrationSrcBeginPhase: Require storage migration when 'migrate_disks' parameter is specified Date: Wed, 9 Aug 2023 16:14:21 +0200 Message-ID: <031ea84b93c2ee2fdfc646e1d02662bb3843dce5.1691590342.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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.8 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: 1691590546129100001 Content-Type: text/plain; charset="utf-8" If a user passes a list of disks to migrate but don't actually use 'VIR_MIGRATE_NON_SHARED_DISK' or 'VIR_MIGRATE_NON_SHARED_INC' flags the parameter would be simply ignored without informing the user of the error. Add a proper error in such case. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a3fe6be4e9..9057590c94 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2644,6 +2644,12 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver, migrate_disks, nmigrate_disks)) cookieFlags |=3D QEMU_MIGRATION_COOKIE_NBD; + } else { + if (nmigrate_disks > 0) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("use of the 'VIR_MIGRATE_PARAM_MIGRATE_DISKS'= requires use of 'VIR_MIGRATE_NON_SHARED_DISK' or 'VIR_MIGRATE_NON_SHARED_I= NC' flag")); + return NULL; + } } if (virDomainDefHasMemoryHotplug(vm->def) || --=20 2.41.0