From nobody Sat Apr 20 12:54:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557907303; cv=none; d=zoho.com; s=zohoarc; b=ItQeYYI5RFHMG78Xw0eSl4OuZQn24pC/vx5u8ow1LEEKJl/6StTiUaPydVDkFVN0rcOtyLQ0T9KL2TcF3O0DteBZ7ve+aIOedVLnb9S4JWXRxhFcJC+iDzmjvk4KyAIjer5CDkh0oWaOVZeIDc+wgdLDOxRmbwqblt/J1LQkOKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557907303; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=PE3o+JYvwwrmeKnJgahxYPKkTov4VfEcHgo8vRGI0m0=; b=AtdJXQZVF9WVIlOiBjO32dSYw6qcJjt56qit18CInHlPmGdGrxDXWZStoq0IoS7qnRlfmyMJpofSd4vOwW4fen1wsxaId7tZI9DDq0XwEQcqWN5Df3/rVTwQD3NOjP46QtQCu0Sz9Nbzkm5nKi9DadBtjbpJsM+iH60YGkEG93k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557907303982537.3659933626877; Wed, 15 May 2019 01:01:43 -0700 (PDT) Received: from localhost ([127.0.0.1]:33097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQoqy-0006EX-VN for importer@patchew.org; Wed, 15 May 2019 04:01:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQoow-00052o-Ie for qemu-devel@nongnu.org; Wed, 15 May 2019 03:59:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQoov-0004Wr-Du for qemu-devel@nongnu.org; Wed, 15 May 2019 03:59:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35686) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQoos-0004MT-Tn; Wed, 15 May 2019 03:59:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 469C2307EA93; Wed, 15 May 2019 07:59:22 +0000 (UTC) Received: from localhost (ovpn-204-29.brq.redhat.com [10.40.204.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2D145D6A6; Wed, 15 May 2019 07:59:21 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 15 May 2019 09:59:16 +0200 Message-Id: <20190515075917.24980-2-mreitz@redhat.com> In-Reply-To: <20190515075917.24980-1-mreitz@redhat.com> References: <20190515075917.24980-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 15 May 2019 07:59:22 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] qemu-img.texi: Be specific about JSON object types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Just writing that --output=3Djson outputs JSON information does not really help; we should also make a note of what QAPI type the result object has. (The map subcommand does not emit a QAPI-typed object, but its section already describes the object structure well enough.) Signed-off-by: Max Reitz --- qemu-img.texi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qemu-img.texi b/qemu-img.texi index 724f244ba1..39562317ee 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -230,6 +230,7 @@ overridden with a pattern byte specified by @var{patter= n}. =20 Perform a consistency check on the disk image @var{filename}. The command = can output in the format @var{ofmt} which is either @code{human} or @code{json= }. +The JSON output is an object of QAPI type @code{ImageCheck}. =20 If @code{-r} is specified, qemu-img tries to repair any inconsistencies fo= und during the check. @code{-r leaks} repairs only cluster leaks, whereas @@ -406,8 +407,7 @@ The size syntax is similar to dd(1)'s size syntax. Give information about the disk image @var{filename}. Use it in particular to know the size reserved on disk which can be different from the displayed size. If VM snapshots are stored in the disk image, -they are displayed too. The command can output in the format @var{ofmt} -which is either @code{human} or @code{json}. +they are displayed too. =20 If a disk image has a backing file chain, information about each disk imag= e in the chain can be recursively enumerated by using the option @code{--backin= g-chain}. @@ -424,6 +424,10 @@ To enumerate information about each disk image in the = above chain, starting from qemu-img info --backing-chain snap2.qcow2 @end example =20 +The command can output in the format @var{ofmt} which is either @code{huma= n} or +@code{json}. The JSON output is an object of QAPI type @code{ImageInfo}; = with +@code{--backing-chain}, it is an array of @code{ImageInfo} objects. + @item map [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--outp= ut=3D@var{ofmt}] [-U] @var{filename} =20 Dump the metadata of image @var{filename} and its backing file chain. @@ -485,7 +489,8 @@ Calculate the file size required for a new image. This= information can be used to size logical volumes or SAN LUNs appropriately for the image that will = be placed in them. The values reported are guaranteed to be large enough to = fit the image. The command can output in the format @var{ofmt} which is either -@code{human} or @code{json}. +@code{human} or @code{json}. The JSON output is an object of QAPI type +@code{BlockMeasureInfo}. =20 If the size @var{N} is given then act as if creating a new empty image file using @command{qemu-img create}. If @var{filename} is given then act as if --=20 2.21.0 From nobody Sat Apr 20 12:54:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557907329; cv=none; d=zoho.com; s=zohoarc; b=Pvx9K+hsukvjDElvhROorJsJ/FILWOTLwuGeHbcTil7VhrL3aeaHk8JDChl3VHs+pneDAaS7Y8lgfdP+7q0eo8pl6Lhi0WnrFyC5pKJOTDjvpLn4CEo8bpY0TDnJCwO089ZRtWgTzWAwPXCcgH/W+t1aE+hi3RP1dl94jwDt5Cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557907329; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=61agUuRF+TkrD3CFSsGrP06fNs48Ud/jKhK1s4xbaOs=; b=JoK7+AJmv8LL0GWvk95sMYAztLzcwq3op7z03hQjYB8XIKIqTRjxbE5vO818kashgw8XZiZGgoccGM20iz4FOPW086JX/W2bvrRCMSqIn5R6OjYjyoBBAXdzQvrfe6zmxHBIIuiIDGBmr7OnWuPz/3JsugKqIU9QYHgrzL46j/E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155790732999355.61898147332283; Wed, 15 May 2019 01:02:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:33095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQoqr-0006Ad-8j for importer@patchew.org; Wed, 15 May 2019 04:01:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQooy-00054g-J6 for qemu-devel@nongnu.org; Wed, 15 May 2019 03:59:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQoox-0004aI-Kf for qemu-devel@nongnu.org; Wed, 15 May 2019 03:59:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQoov-0004VJ-Cm; Wed, 15 May 2019 03:59:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A29C23082DD3; Wed, 15 May 2019 07:59:24 +0000 (UTC) Received: from localhost (ovpn-204-29.brq.redhat.com [10.40.204.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3AE235D710; Wed, 15 May 2019 07:59:24 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 15 May 2019 09:59:17 +0200 Message-Id: <20190515075917.24980-3-mreitz@redhat.com> In-Reply-To: <20190515075917.24980-1-mreitz@redhat.com> References: <20190515075917.24980-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 15 May 2019 07:59:24 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] qemu-img.texi: Describe human-readable info output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Ideally, it should be self-explanatory. However, keys like "disk size" arguably really are not self-explanatory. In any case, there is no harm in going into a some more detail here. Signed-off-by: Max Reitz --- qemu-img.texi | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index 39562317ee..e8bc0fd7a2 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -428,6 +428,47 @@ The command can output in the format @var{ofmt} which = is either @code{human} or @code{json}. The JSON output is an object of QAPI type @code{ImageInfo}; = with @code{--backing-chain}, it is an array of @code{ImageInfo} objects. =20 +@code{--output=3Dhuman} reports the following information (for every image= in the +chain): +@table @var +@item image +The image file name + +@item file format +The image format + +@item virtual size +The size of the guest disk + +@item disk size +How much space the image file occupies on the host file system (may be sho= wn as +0 if this information is unavailable, e.g. because there is no file system) + +@item cluster_size +Cluster size of the image format, if applicable + +@item encrypted +Whether the image is encrypted (only present if so) + +@item cleanly shut down +This is shown as @code{no} if the image is dirty and will have to be +auto-repaired the next time it is opened in qemu. + +@item backing file +The backing file name, if present + +@item backing file format +The format of the backing file, if the image enforces it + +@item Snapshot list +A list of all internal snapshots + +@item Format specific information +Further information whose structure depends on the image format. This sec= tion +is a textual representation of the respective @code{ImageInfoSpecific*} QA= PI +object (e.g. @code{ImageInfoSpecificQCow2} for qcow2 images). +@end table + @item map [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--outp= ut=3D@var{ofmt}] [-U] @var{filename} =20 Dump the metadata of image @var{filename} and its backing file chain. --=20 2.21.0