From nobody Sat May 4 09:18:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1579799236; cv=none; d=zohomail.com; s=zohoarc; b=eJ7d5oNSIRXUVkcuc4+XxaYkuIhWHyFPclwl9QzOnaNULiKeJk6goFkJD1Rgr05LK52RWM9Gjt39Y/CRr/c09rGGlU7aTpmgCCga2BlTziesIXsrxgUAgWE9hXWG2aB/zzFGqKbnsmaHS+cRYQH7Nd1Km5YYZ+UYTCLGVlLMu4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579799236; 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=SHcaPinD1BCHUlobsEabtM0Xa9mleaX3e8Pi+06vfvA=; b=GN9ofpiLa1JRnw+wzLwsL61kUwypA2hLhHksHYjq8ZddWnmqPnFECVd0hRlfGUBXEd7f8abvOr87c3gq0HiJWyvomSbOdN0rOJRiLtq1vTz6BaMgYHn8zwOliHfW0O+vLJkqwHGWDuKBOZoolc08PZI5ftG4W/8WGHxWpy9yT1g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579799236552243.98268843603944; Thu, 23 Jan 2020 09:07:16 -0800 (PST) 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-173-uVfUYXHUNN2Ga0Yz99_lkg-1; Thu, 23 Jan 2020 12:05:25 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42634100550E; Thu, 23 Jan 2020 17:05:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B0CC5DA85; Thu, 23 Jan 2020 17:05:16 +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 8D7188594A; Thu, 23 Jan 2020 17:05:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NH5BDu018346 for ; Thu, 23 Jan 2020 12:05:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id E06B35C1BB; Thu, 23 Jan 2020 17:05:11 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B05A5C1B2 for ; Thu, 23 Jan 2020 17:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579799235; 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=SHcaPinD1BCHUlobsEabtM0Xa9mleaX3e8Pi+06vfvA=; b=YzMeoK0TaKCuvmxwGtGXML248pkpoRvCiqIDLWUI9ZEH95rIaT8hArJ9Wk9euUxNWrvc5C BCBY7qwAl5h21pG+G4cb4lJQPUoJQUGbgs76jV64CvmmvJQGeHbulZ6gC7AmpEj3EF3q1r 2/mLhw7E8nPsv5IAxQYCIVbrNys1cBo= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: block: Don't skip creation of 'luks' formatted images Date: Thu, 23 Jan 2020 18:05:08 +0100 Message-Id: <6ee640b7c88a38f3a257c01a3fefd7ae7d374119.1579799088.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.14 X-MC-Unique: uVfUYXHUNN2Ga0Yz99_lkg-1 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" libvirt treats 'luks' images as raw+encryption. The logic in qemuBlockStorageSourceCreateFormat skipped the creation if the requested image was raw but didn't take into account the encryption. This manifested itself e.g. when attempting to do a virsh blockcopy with the following XML: Where qemu would report the following error: unable to execute QEMU command 'blockdev-add': Volume is not in LUKS format rather than actually formatting the image first. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index eab21bc107..22f03da485 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2479,7 +2479,8 @@ qemuBlockStorageSourceCreateFormat(virDomainObjPtr vm, g_autoptr(virJSONValue) createformatprops =3D NULL; int ret; - if (src->format =3D=3D VIR_STORAGE_FILE_RAW) + if (src->format =3D=3D VIR_STORAGE_FILE_RAW && + !src->encryption) return 0; if (qemuBlockStorageSourceCreateGetFormatProps(src, backingStore, --=20 2.24.1