From nobody Mon Feb 9 16:53:51 2026 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 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580975584850363.5198293201421; Wed, 5 Feb 2020 23:53:04 -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-238-iyk0qptdM_Ko4yFgx-bWYA-1; Thu, 06 Feb 2020 02:52:39 -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 E500C2F61; Thu, 6 Feb 2020 07:52:34 +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 BE2355DA83; Thu, 6 Feb 2020 07:52:34 +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 800F7866B3; Thu, 6 Feb 2020 07:52:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0167qIJt009980 for ; Thu, 6 Feb 2020 02:52:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3869A1001B2B; Thu, 6 Feb 2020 07:52:18 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id B54EC1001B07 for ; Thu, 6 Feb 2020 07:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580975582; 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=VL654TE5pwlBBg+E9N2ejFzg5tyq3HD3bgna83Idnlk=; b=VpPh/1vEYqr3SQ3R0qc/zpn8Cu03TTInY0pAMP/td553o8pPFFQrzxgU1X4AGHDrZVHpRO hcaMk0f6EJw5sZaEZ9bhN5YVKxq/LS+bwWeOOrjsFZS1Aumt7zGrHH3ZXUbhKHNFoiNP8m ETuiQrOmqFVDwvthGKc5YDpABQ8BF4c= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/15] qemuBlockStorageSourceGetFormatRawProps: format 'offset' and 'size' for slice Date: Thu, 6 Feb 2020 08:52:01 +0100 Message-Id: <407c48ace753352b8a02d0fd222935f787579b37.1580975374.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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: iyk0qptdM_Ko4yFgx-bWYA-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" If we have a 'format' type slice for a raw driver we can directly format the values. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 63116ef5f2..5fac8c17b4 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1187,16 +1187,18 @@ qemuBlockStorageSourceGetFormatRawProps(virStorageS= ourcePtr src, secretalias =3D srcPriv->encinfo->s.aes.alias; } - /* currently unhandled properties for the 'raw' driver: - * 'offset' - * 'size' - */ - if (virJSONValueObjectAdd(props, "s:driver", driver, "S:key-secret", secretalias, NULL) < 0) return -1; + if (src->sliceFormat && + virJSONValueObjectAdd(props, + "p:offset", src->sliceFormat->offset, + "p:size", src->sliceFormat->size, + NULL) < 0) + return -1; + return 0; } --=20 2.24.1