From nobody Fri May 3 01:57:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1590503438; cv=none; d=zohomail.com; s=zohoarc; b=nSzUj1tb1sWuMCw6eEuEbE9nc5vJEq5dVnIUjk0EccVHCGn7MhoglfXdFUe9blr6FxcGS4QZWubKR59U8/x83HgK87KV/KZu9P9UZgdZAvEtC763rgceXi4OvHydkC8dTNtpFw7P6Ymjo7TkVWLSJpJ0Zy7mJaiPkCEFqPhlAK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590503438; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=OaFWVZGkyNe0iFSJacwj/K7b2qknKXjQYktptXlJ5K8=; b=DIZSTKk+5AxbMDY7ACiGT+EBbV2Lci/wy58oovI3ud2utkv03wpagHzjvGWkfkGpiHuscHWBUikr2TY8/9LISW/xP1bdx8rHgis6LJlhMbYcwn4y0GgalhHUgsY/DC64nROhoC/6CvF9dMc66vDPQAfSqwLU0g60REqbLiOcsM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1590503438642829.3008952131555; Tue, 26 May 2020 07:30:38 -0700 (PDT) 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-96-QdueMVnXMTWr3TGnR3gwuA-1; Tue, 26 May 2020 10:30:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 257B680183C; Tue, 26 May 2020 14:30:29 +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 B6D805C1BB; Tue, 26 May 2020 14:30:27 +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 5E0041809541; Tue, 26 May 2020 14:30:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QEUNp6017168 for ; Tue, 26 May 2020 10:30:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id B7D445D9E8; Tue, 26 May 2020 14:30:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3725E5D9E5 for ; Tue, 26 May 2020 14:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590503437; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OaFWVZGkyNe0iFSJacwj/K7b2qknKXjQYktptXlJ5K8=; b=WYARjMK7EdJpYez714dCYWj9nqbQOjub4PFFWP+I1tdV6U8+i7IPZlsyi4XYToiiZqErOJ hk5jzTGVWnW9CRbs6DNldRz65T3YfHwM4kzoT897fatoaZjPrhwWkySwHJm9l04FHrV7Bc t/AE7Vzfqen6mkc/35cma/Bu0bSC684= X-MC-Unique: QdueMVnXMTWr3TGnR3gwuA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2] qemu: Skip pre-creation of NVMe disks Date: Tue, 26 May 2020 16:30:17 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Upon migration with disks, libvirt determines if each disk exists on the destination and tries to pre-create missing ones. Well, NVMe disks can't be pre-created, but they can be checked for presence. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1823639 Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- Technically, this is a v2 of: https://www.redhat.com/archives/libvir-list/2020-May/msg00253.html but I've taken what I'm suggesting in a BZ comment and posting it as a patch. src/qemu/qemu_migration.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 02e8271e42..7ee5b5eda8 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -315,6 +315,7 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm, for (i =3D 0; i < nbd->ndisks; i++) { virDomainDiskDefPtr disk; const char *diskSrcPath; + g_autofree char *nvmePath =3D NULL; =20 VIR_DEBUG("Looking up disk target '%s' (capacity=3D%llu)", nbd->disks[i].target, nbd->disks[i].capacity); @@ -326,7 +327,12 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm, goto cleanup; } =20 - diskSrcPath =3D virDomainDiskGetSource(disk); + if (disk->src->type =3D=3D VIR_STORAGE_TYPE_NVME) { + virPCIDeviceAddressGetSysfsFile(&disk->src->nvme->pciAddr, &nv= mePath); + diskSrcPath =3D nvmePath; + } else { + diskSrcPath =3D virDomainDiskGetSource(disk); + } =20 /* Skip disks we don't want to migrate and already existing disks.= */ if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks)= || --=20 2.26.2