From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708350782859302.21460173384776; Mon, 19 Feb 2024 05:53:02 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id B83771DCA; Mon, 19 Feb 2024 08:53:01 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 94DF21B51; Mon, 19 Feb 2024 08:50:05 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id ABDC8186A; Mon, 19 Feb 2024 08:49:57 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A0B971A1B for ; Mon, 19 Feb 2024 08:49:56 -0500 (EST) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-250-Rpe0AVaJMZi6lOuidWdQ1w-1; Mon, 19 Feb 2024 08:49:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6258285F981 for ; Mon, 19 Feb 2024 13:49:54 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E02A1BDD1 for ; Mon, 19 Feb 2024 13:49:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: Rpe0AVaJMZi6lOuidWdQ1w-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 1/8] qemuMigrationDstPrepareStorage: Use 'switch' statement to include all storage types Date: Mon, 19 Feb 2024 14:49:45 +0100 Message-ID: <7f04e09813a8d04d9ad514090d69ff46bc007e66.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: EOVW4HWFUKYWVL7UZ3XZ34HA3RJ2SUIM X-Message-ID-Hash: EOVW4HWFUKYWVL7UZ3XZ34HA3RJ2SUIM X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708350783687100001 Decrease the likelyhood that addition of a new storage type will be forgotten. This patch also unifies the type check to consult the 'actual' type of the storage in both cases as the NVMe check looked for the XML declared type while virStorageSourceIsLocalStorage() looks for the actual/translated type. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 01ab803842..3e0aae4e7c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -465,11 +465,27 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks)) continue; - if (disk->src->type =3D=3D VIR_STORAGE_TYPE_NVME) { + switch (virStorageSourceGetActualType(disk->src)) { + case VIR_STORAGE_TYPE_FILE: + case VIR_STORAGE_TYPE_BLOCK: + case VIR_STORAGE_TYPE_DIR: + diskSrcPath =3D virDomainDiskGetSource(disk); + break; + + case VIR_STORAGE_TYPE_NVME: + /* While NVMe disks are local, they are not accessible via src= ->path. + * Therefore, we have to return false here. */ virPCIDeviceAddressGetSysfsFile(&disk->src->nvme->pciAddr, &nv= mePath); diskSrcPath =3D nvmePath; - } else if (virStorageSourceIsLocalStorage(disk->src)) { - diskSrcPath =3D virDomainDiskGetSource(disk); + break; + + case VIR_STORAGE_TYPE_NETWORK: + case VIR_STORAGE_TYPE_VOLUME: + case VIR_STORAGE_TYPE_VHOST_USER: + case VIR_STORAGE_TYPE_VHOST_VDPA: + case VIR_STORAGE_TYPE_LAST: + case VIR_STORAGE_TYPE_NONE: + break; } if (diskSrcPath) { --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708350863230433.36651972787035; Mon, 19 Feb 2024 05:54:23 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2A5691DDC; Mon, 19 Feb 2024 08:54:21 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 929151D7A; Mon, 19 Feb 2024 08:50:17 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id B8EFB1A22; Mon, 19 Feb 2024 08:49:58 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0C7DE1A1B for ; Mon, 19 Feb 2024 08:49:58 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-100-3YM0OMeINSeYNBmg76atzQ-1; Mon, 19 Feb 2024 08:49:56 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF7A3185A780 for ; Mon, 19 Feb 2024 13:49:55 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36AF48077 for ; Mon, 19 Feb 2024 13:49:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: 3YM0OMeINSeYNBmg76atzQ-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 2/8] qemuMigrationDstPrepareStorage: Properly consider path for 'vdpa' devices Date: Mon, 19 Feb 2024 14:49:46 +0100 Message-ID: <8199abda7a938ff05ddf0941afaa835fc98e3e56.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: AGFE55KSNIABV2ULMBXNS27UGAOTUMM6 X-Message-ID-Hash: AGFE55KSNIABV2ULMBXNS27UGAOTUMM6 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708350864064100001 Allow storage migration of VDPA devices by properly checking that they exist on the destionation. Pre-creation is not supported but if the device exists the migration should be able to succeed. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 3e0aae4e7c..5e27cd5dbe 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -479,10 +479,13 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, diskSrcPath =3D nvmePath; break; + case VIR_STORAGE_TYPE_VHOST_VDPA: + diskSrcPath =3D disk->src->vdpadev; + break; + case VIR_STORAGE_TYPE_NETWORK: case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_VHOST_USER: - case VIR_STORAGE_TYPE_VHOST_VDPA: case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_NONE: break; --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708351077146529.0580130599612; Mon, 19 Feb 2024 05:57:57 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1119D1D8F; Mon, 19 Feb 2024 08:57:56 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C270C1ABC; Mon, 19 Feb 2024 08:50:35 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3ADEF1A1B; Mon, 19 Feb 2024 08:50:01 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 946891A1F for ; Mon, 19 Feb 2024 08:49:58 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-6z_MxPcMPqmUJ4GQQE7Jow-1; Mon, 19 Feb 2024 08:49:56 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id B201B881B6B for ; Mon, 19 Feb 2024 13:49:56 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B58E111E8 for ; Mon, 19 Feb 2024 13:49:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: 6z_MxPcMPqmUJ4GQQE7Jow-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 3/8] qemuMigrationDstPrecreateDisk: Refactor cleanup Date: Mon, 19 Feb 2024 14:49:47 +0100 Message-ID: <68805a58b0740d2d4b41666e7593d095ef13590f.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: PJ2IEWR7ZTD4PIHTTRHJ35EIQY7CQAVZ X-Message-ID-Hash: PJ2IEWR7ZTD4PIHTTRHJ35EIQY7CQAVZ X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708351079181100001 Automatically free helper variables, remove the 'cleanup' label and use virBufferCurrentContent() to take the XML from the buffer rather than extracting it to a separate variable. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 42 +++++++++++++-------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5e27cd5dbe..32569ecbb4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -277,12 +277,11 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, virDomainDiskDef *disk, unsigned long long capacity) { - int ret =3D -1; - virStoragePoolPtr pool =3D NULL; - virStorageVolPtr vol =3D NULL; - char *volName =3D NULL, *basePath =3D NULL; - char *volStr =3D NULL; + g_autoptr(virStoragePool) pool =3D NULL; + g_autoptr(virStorageVol) vol =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + char *volName =3D NULL; + g_autofree char *basePath =3D NULL; const char *format =3D NULL; const char *compat =3D NULL; unsigned int flags =3D 0; @@ -303,7 +302,7 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, virReportError(VIR_ERR_INVALID_ARG, _("malformed disk path: %1$s"), disk->src->path); - goto cleanup; + return -1; } *volName =3D '\0'; @@ -311,11 +310,11 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, if (!*conn) { if (!(*conn =3D virGetConnectStorage())) - goto cleanup; + return -1; } if (!(pool =3D virStoragePoolLookupByTargetPath(*conn, basePath))) - goto cleanup; + return -1; format =3D virStorageFileFormatTypeToString(disk->src->format); if (disk->src->format =3D=3D VIR_STORAGE_FILE_QCOW2) { flags |=3D VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA; @@ -327,11 +326,11 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, case VIR_STORAGE_TYPE_VOLUME: if (!*conn) { if (!(*conn =3D virGetConnectStorage())) - goto cleanup; + return -1; } if (!(pool =3D virStoragePoolLookupByName(*conn, disk->src->srcpoo= l->pool))) - goto cleanup; + return -1; format =3D virStorageFileFormatTypeToString(disk->src->format); volName =3D disk->src->srcpool->volume; if (disk->src->format =3D=3D VIR_STORAGE_FILE_QCOW2) @@ -353,14 +352,13 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot precreate storage for disk type '%1$s'"), virStorageTypeToString(disk->src->type)); - goto cleanup; + return -1; } if ((vol =3D virStorageVolLookupByName(pool, volName))) { VIR_DEBUG("Skipping creation of already existing volume of name '%= s'", volName); - ret =3D 0; - goto cleanup; + return 0; } virBufferAddLit(&buf, "\n"); @@ -377,22 +375,10 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); - if (!(volStr =3D virBufferContentAndReset(&buf))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to create volume XML")); - goto cleanup; - } - - if (!(vol =3D virStorageVolCreateXML(pool, volStr, flags))) - goto cleanup; + if (!(vol =3D virStorageVolCreateXML(pool, virBufferCurrentContent(&bu= f), flags))) + return -1; - ret =3D 0; - cleanup: - VIR_FREE(basePath); - VIR_FREE(volStr); - virObjectUnref(vol); - virObjectUnref(pool); - return ret; + return 0; } static bool --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 170835096783941.32580544785526; Mon, 19 Feb 2024 05:56:07 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C5B831B59; Mon, 19 Feb 2024 08:56:06 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6F5AA1D8F; Mon, 19 Feb 2024 08:50:26 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4E6DC1A21; Mon, 19 Feb 2024 08:50:00 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 9FFD4186A for ; Mon, 19 Feb 2024 08:49:59 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-ZAos7ZbMOBKXa9OL5ZFMSQ-1; Mon, 19 Feb 2024 08:49:57 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98D6E8432A1 for ; Mon, 19 Feb 2024 13:49:57 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1214C1BDD1 for ; Mon, 19 Feb 2024 13:49:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: ZAos7ZbMOBKXa9OL5ZFMSQ-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 4/8] qemuMigrationDstPrepareStorage: Move block device specific logic Date: Mon, 19 Feb 2024 14:49:48 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: XVPJX32GYHAKLZOR2VGFELWTTAKSIFTB X-Message-ID-Hash: XVPJX32GYHAKLZOR2VGFELWTTAKSIFTB X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708350968659100003 Now that we have a switch statement, the code adding the 'slice' for block devices of non-equal sizes can be moved to appropriate location. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 41 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 32569ecbb4..2ac10ab5ff 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -452,8 +452,27 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, continue; switch (virStorageSourceGetActualType(disk->src)) { - case VIR_STORAGE_TYPE_FILE: case VIR_STORAGE_TYPE_BLOCK: + /* In case the destination of the storage migration is a block + * device it might be possible that for various reasons the si= ze + * will not be identical. Since qemu refuses to do a blockdev-= mirror + * into an image which doesn't have the exact same size we nee= d to + * install a slice on top of the top image */ + if (disk->src->format =3D=3D VIR_STORAGE_FILE_RAW && + disk->src->sliceStorage =3D=3D NULL) { + qemuDomainObjPrivate *priv =3D vm->privateData; + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetCon= fig(priv->driver); + qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVA= TE(disk); + + if (qemuDomainStorageUpdatePhysical(cfg, vm, disk->src) = =3D=3D 0 && + disk->src->physical > nbd->disks[i].capacity) { + disk->src->sliceStorage =3D g_new0(virStorageSourceSli= ce, 1); + disk->src->sliceStorage->size =3D nbd->disks[i].capaci= ty; + diskPriv->migrationslice =3D true; + } + } + G_GNUC_FALLTHROUGH; + case VIR_STORAGE_TYPE_FILE: case VIR_STORAGE_TYPE_DIR: diskSrcPath =3D virDomainDiskGetSource(disk); break; @@ -478,26 +497,6 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, } if (diskSrcPath) { - /* In case the destination of the storage migration is a block - * device it might be possible that for various reasons the si= ze - * will not be identical. Since qemu refuses to do a blockdev-= mirror - * into an image which doesn't have the exact same size we nee= d to - * install a slice on top of the top image */ - if (virStorageSourceIsBlockLocal(disk->src) && - disk->src->format =3D=3D VIR_STORAGE_FILE_RAW && - disk->src->sliceStorage =3D=3D NULL) { - qemuDomainObjPrivate *priv =3D vm->privateData; - g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetCon= fig(priv->driver); - qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVA= TE(disk); - - if (qemuDomainStorageUpdatePhysical(cfg, vm, disk->src) = =3D=3D 0 && - disk->src->physical > nbd->disks[i].capacity) { - disk->src->sliceStorage =3D g_new0(virStorageSourceSli= ce, 1); - disk->src->sliceStorage->size =3D nbd->disks[i].capaci= ty; - diskPriv->migrationslice =3D true; - } - } - /* don't pre-create existing disks */ if (virFileExists(diskSrcPath)) { VIR_DEBUG("Skipping pre-create of existing source for disk= '%s'", disk->dst); --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708351346618819.2657913098858; Mon, 19 Feb 2024 06:02:26 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 611691A22; Mon, 19 Feb 2024 09:02:25 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 39AF31D3E; Mon, 19 Feb 2024 08:51:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 06DEC1BEA; Mon, 19 Feb 2024 08:50:32 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CAFF11A71 for ; Mon, 19 Feb 2024 08:50:02 -0500 (EST) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-h98i1PYdOKeW7yHw2iZGQQ-1; Mon, 19 Feb 2024 08:49:58 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8257B3830080 for ; Mon, 19 Feb 2024 13:49:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEB888CEC for ; Mon, 19 Feb 2024 13:49:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: h98i1PYdOKeW7yHw2iZGQQ-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 5/8] qemuMigrationDstPrepareStorage: Rework storage existence check Date: Mon, 19 Feb 2024 14:49:49 +0100 Message-ID: <3b14efc91bbd099823550ada2c2fb35684918916.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: SLLID4MNTQGZLLUZDGXUTJRZG3VBNWMP X-Message-ID-Hash: SLLID4MNTQGZLLUZDGXUTJRZG3VBNWMP X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708351348793100001 Check the existance of storage per-type rather than trying to come up with a common "path". Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2ac10ab5ff..d248f87c2d 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -434,8 +434,7 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, for (i =3D 0; i < nbd->ndisks; i++) { virDomainDiskDef *disk; - const char *diskSrcPath =3D NULL; - g_autofree char *nvmePath =3D NULL; + bool exists =3D false; VIR_DEBUG("Looking up disk target '%s' (capacity=3D%llu)", nbd->disks[i].target, nbd->disks[i].capacity); @@ -471,21 +470,27 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, diskPriv->migrationslice =3D true; } } - G_GNUC_FALLTHROUGH; + + exists =3D virFileExists(disk->src->path); + break; + case VIR_STORAGE_TYPE_FILE: case VIR_STORAGE_TYPE_DIR: - diskSrcPath =3D virDomainDiskGetSource(disk); + exists =3D virFileExists(disk->src->path); break; - case VIR_STORAGE_TYPE_NVME: - /* While NVMe disks are local, they are not accessible via src= ->path. - * Therefore, we have to return false here. */ + case VIR_STORAGE_TYPE_NVME: { + /* While NVMe disks are local, they are not accessible via src= ->path */ + g_autofree char *nvmePath =3D NULL; + virPCIDeviceAddressGetSysfsFile(&disk->src->nvme->pciAddr, &nv= mePath); - diskSrcPath =3D nvmePath; + + exists =3D virFileExists(nvmePath); break; + } case VIR_STORAGE_TYPE_VHOST_VDPA: - diskSrcPath =3D disk->src->vdpadev; + exists =3D virFileExists(disk->src->vdpadev); break; case VIR_STORAGE_TYPE_NETWORK: @@ -496,20 +501,17 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, break; } - if (diskSrcPath) { - /* don't pre-create existing disks */ - if (virFileExists(diskSrcPath)) { - VIR_DEBUG("Skipping pre-create of existing source for disk= '%s'", disk->dst); - continue; - } - } + VIR_DEBUG("target=3D'%s' exists=3D'%d'", disk->dst, exists); + + if (exists) + continue; /* create the storage - if supported */ if (incremental) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("pre-creation of storage target '%1$s' for in= cremental storage migration of disk '%2$s' is not supported"), - NULLSTR(diskSrcPath), nbd->disks[i].target); + _("pre-creation of storage target for increment= al storage migration of disk '%1$s' is not supported"), + nbd->disks[i].target); return -1; } --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708351184838832.5077734792643; Mon, 19 Feb 2024 05:59:44 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id B414E1DDF; Mon, 19 Feb 2024 08:59:43 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C578E1C2B; Mon, 19 Feb 2024 08:50:43 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 83C5E1AE2; Mon, 19 Feb 2024 08:50:03 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 50871186A for ; Mon, 19 Feb 2024 08:50:01 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-Yqhkq-FaMDmWumFhqwvx1A-1; Mon, 19 Feb 2024 08:49:59 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6CA238432A0 for ; Mon, 19 Feb 2024 13:49:59 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id D81F68CEC for ; Mon, 19 Feb 2024 13:49:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: Yqhkq-FaMDmWumFhqwvx1A-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 6/8] qemuMigrationDstPrepareStorage: Reject migration into 'dir' and 'vhost-user' types Date: Mon, 19 Feb 2024 14:49:50 +0100 Message-ID: <0fa603220400e8a25c7fd577f835367be844f193.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: R4YCV2NXKCMYMDDPDQYNQCZREUK6BNTL X-Message-ID-Hash: R4YCV2NXKCMYMDDPDQYNQCZREUK6BNTL X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708351185633100001 Migrating into a 'directory' won't ever work as we ask qemu to emulate a fat filesystem, so restoring of the files won't be possible. Same for 'vhost-user' disks which don't support blockjobs as there's no block backend used in qemu. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d248f87c2d..4c524fafe4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -475,7 +475,6 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, break; case VIR_STORAGE_TYPE_FILE: - case VIR_STORAGE_TYPE_DIR: exists =3D virFileExists(disk->src->path); break; @@ -493,9 +492,15 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, exists =3D virFileExists(disk->src->vdpadev); break; + case VIR_STORAGE_TYPE_VHOST_USER: + case VIR_STORAGE_TYPE_DIR: + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("non-shared storage migration into '%1$s' tar= get is not supported"), + virStorageTypeToString(virStorageSourceGetActua= lType(disk->src))); + return -1; + case VIR_STORAGE_TYPE_NETWORK: case VIR_STORAGE_TYPE_VOLUME: - case VIR_STORAGE_TYPE_VHOST_USER: case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_NONE: break; --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708351260305196.92281756866555; Mon, 19 Feb 2024 06:01:00 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3328A1A86; Mon, 19 Feb 2024 09:00:59 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id BC9E31A72; Mon, 19 Feb 2024 08:50:52 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9D98F1A3F; Mon, 19 Feb 2024 08:50:28 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 904B01A3F for ; Mon, 19 Feb 2024 08:50:02 -0500 (EST) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492-CnpPcVUoPqagO0ompuHykg-1; Mon, 19 Feb 2024 08:50:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5408C285F986 for ; Mon, 19 Feb 2024 13:50:00 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id C08B71121F for ; Mon, 19 Feb 2024 13:49:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: CnpPcVUoPqagO0ompuHykg-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 7/8] qemuMigrationDstPrepareStorage: Move assumption that 'network' disks always exist Date: Mon, 19 Feb 2024 14:49:51 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: SSBRCNGUVWP6KQCIPPF6ZNCDNWPJUTKK X-Message-ID-Hash: SSBRCNGUVWP6KQCIPPF6ZNCDNWPJUTKK X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708351262340100001 Move the assumption from the code pre-creating the storage to qemuMigrationDstPrepareStorage where it's checked for other cases. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4c524fafe4..438aa4503e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -338,10 +338,6 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, break; case VIR_STORAGE_TYPE_NETWORK: - VIR_DEBUG("Skipping creation of network disk '%s'", - disk->dst); - return 0; - case VIR_STORAGE_TYPE_BLOCK: case VIR_STORAGE_TYPE_DIR: case VIR_STORAGE_TYPE_NVME: @@ -492,6 +488,12 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, exists =3D virFileExists(disk->src->vdpadev); break; + case VIR_STORAGE_TYPE_NETWORK: + /* For network disks we always assume they exist as the storag= e drivec + * can't create them */ + exists =3D true; + break; + case VIR_STORAGE_TYPE_VHOST_USER: case VIR_STORAGE_TYPE_DIR: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -499,7 +501,6 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, virStorageTypeToString(virStorageSourceGetActua= lType(disk->src))); return -1; - case VIR_STORAGE_TYPE_NETWORK: case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_NONE: --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 18 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1708351442675453.7455116383044; Mon, 19 Feb 2024 06:04:02 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 948951DBE; Mon, 19 Feb 2024 09:04:01 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id CA3CC1DF5; Mon, 19 Feb 2024 08:51:11 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 57AD21ABC; Mon, 19 Feb 2024 08:50:35 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6444F1ABC for ; Mon, 19 Feb 2024 08:50:03 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-tu26r7DbNIGDL1UvOWv4xQ-1; Mon, 19 Feb 2024 08:50:01 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E602185A782 for ; Mon, 19 Feb 2024 13:50:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id A99911BDD1 for ; Mon, 19 Feb 2024 13:50:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: tu26r7DbNIGDL1UvOWv4xQ-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 8/8] qemuMigrationDstPrepareStorage: Annotate that existance of 'volume' disks is checked elswhere Date: Mon, 19 Feb 2024 14:49:52 +0100 Message-ID: <1dd3cc47a9e56186f1eb5f8ca63e9cc35b325d35.1708350502.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: 5S4MI6UQH2GHVHUYZSUZO3KU5VD6TRCY X-Message-ID-Hash: 5S4MI6UQH2GHVHUYZSUZO3KU5VD6TRCY X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1708351445302100001 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 438aa4503e..1faab5dd23 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -502,6 +502,9 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm, return -1; case VIR_STORAGE_TYPE_VOLUME: + /* Existance of 'volume' type disks are handled when pre-creat= ing them */ + break; + case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_NONE: break; --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org