From nobody Thu Apr 25 00:57:28 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=1683292542; cv=none; d=zohomail.com; s=zohoarc; b=N12DV/RCcAay6mgSfW2nDkPzdVEeTlAa+5L/mYBCuCgQ2PjD9cI5w+uYmqHHuTIZcevCZFkJ4XBm6yYz5PCcUE9m8jXT3L5MF2QjPGno+h/jJFAxl/79K/+JM4r6WAaFES/XATi5uU5eU6sWNBNEqZkrC6bXgUObW7zSasZJUqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292542; 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=OT+l8zlpIeSm9CPYWr0LBjetqZgVwnSh/JumR4a3Cbw=; b=idSoPGmNH1Gli3noRb+GSAjAa+Ac3vr1JEpGcetJWESoAcBJQH5gVI+5nMsLw3126KyU3TRaRUfzbVNaBU7FccEhRE4/HfaKZk1jMHB0POXzE9KAk1vYCglPmWgDjRFHc156D8NrhQaGCBCkDGLt+b+S+DkkKuWwQfUJMnDqZTw= 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 1683292542248960.1156925327001; Fri, 5 May 2023 06:15:42 -0700 (PDT) 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-56-ZvCEYgRgOF6vCHjOHUVAkw-1; Fri, 05 May 2023 09:15:37 -0400 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 C9F7288462B; Fri, 5 May 2023 13:15:34 +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 4C17140C206F; Fri, 5 May 2023 13:15:34 +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 263451946A48; Fri, 5 May 2023 13:15:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C30811946A43 for ; Fri, 5 May 2023 13:15:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A3C8F2026D25; Fri, 5 May 2023 13:15:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D50D2026D16 for ; Fri, 5 May 2023 13:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683292541; 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=OT+l8zlpIeSm9CPYWr0LBjetqZgVwnSh/JumR4a3Cbw=; b=GgkBZnGl77UuyfuWm1/W3ga0oMeChZblIk0wIp09U0KCxUW8PFT4Q1rnOSGVTvtHQs5PM0 s+5/DQPlYocCCz0DLEq3uVNbzKHFkEAE98PgtQBfc8RhBLzTJsx8qLcrYSXOV/6tifoLYu q0u8SEcHMDrry/fKaotGsJ8aZ9AHq6Y= X-MC-Unique: ZvCEYgRgOF6vCHjOHUVAkw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: hotplug: Reorder setup of disk backend metadata Date: Fri, 5 May 2023 15:15:31 +0200 Message-Id: <61e7a0c70283501ea56886a4d8e36126c3a5479e.1683292531.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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: 1683292544299100001 Content-Type: text/plain; charset="utf-8" The regular VM startup code first calls the setup of the disk backing chain as defined in the XML and then calls the function to load the rest of the backing chain from the image metadata. The hotplug code did it the other way around, thus causing a failure when attempting to attach a QCOW2 image via FD passing. Reorder the hotplug code to have the same order. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2193315 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8c14540275..54b5a2c2c9 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -921,9 +921,6 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *d= river, if (virDomainDiskTranslateSourcePool(disk) < 0) goto cleanup; - if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0) - goto cleanup; - for (i =3D 0; i < vm->def->ndisks; i++) { if (virDomainDiskDefCheckDuplicateInfo(vm->def->disks[i], disk) < = 0) goto cleanup; @@ -1007,6 +1004,9 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver = *driver, if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) goto cleanup; + if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0) + goto cleanup; + if (qemuHotplugAttachManagedPR(vm, disk->src, VIR_ASYNC_JOB_NONE) < 0) goto cleanup; --=20 2.40.0