From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOjKV-0003AG-HQ for qemu-devel@nongnu.org; Thu, 18 Oct 2012 02:11:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOjKR-0004g5-A2 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 02:11:39 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOjKR-0004g1-2G for qemu-devel@nongnu.org; Thu, 18 Oct 2012 02:11:35 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so8083430pbb.4 for ; Wed, 17 Oct 2012 23:11:34 -0700 (PDT) From: Kashyap Chamarthy Date: Thu, 18 Oct 2012 11:25:34 +0530 Message-Id: <1350539734-10115-1-git-send-email-kashyap.cv@gmail.com> Subject: [Qemu-devel] [PATCH v3] qemu-img: document 'info --backing-chain' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Kashyap Chamarthy Signed-off-by: Kashyap Chamarthy --- qemu-img-cmds.hx | 4 ++-- qemu-img.texi | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 0ef82e9ac7a89d607e1f2c8e38461cee5b438dba..a18136302d2ca7a7540672f1b9ef89603e89edc0 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -34,9 +34,9 @@ STEXI ETEXI DEF("info", img_info, - "info [-f fmt] [--output=ofmt] filename") + "info [-f fmt] [--output=ofmt] [--backing-chain] filename") STEXI -@item info [-f @var{fmt}] [--output=@var{ofmt}] @var{filename} +@item info [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] @var{filename} ETEXI DEF("snapshot", img_snapshot, diff --git a/qemu-img.texi b/qemu-img.texi index 8b05f2c42801a2535ab4390b47bc415eb880625a..fa4ced6e5a24eed0adf1b44b471d6959055a58a1 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -28,6 +28,10 @@ Command parameters: is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats. +@item --backing-chain +will enumerate information about backing files in a disk image chain. Refer +below for further description. + @item size is the disk image size in bytes. Optional suffixes @code{k} or @code{K} (kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M) @@ -129,7 +133,7 @@ created as a copy on write image of the specified base image; the @var{backing_file} should have the same content as the input's base image, however the path, image format, etc may differ. -@item info [-f @var{fmt}] [--output=@var{ofmt}] @var{filename} +@item info [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] @var{filename} Give information about the disk image @var{filename}. Use it in particular to know the size reserved on disk which can be different @@ -137,6 +141,21 @@ 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}. +If a disk image has a backing file chain, information about each disk image in +the chain can be recursively enumerated by using the option @code{--backing-chain}. + +For instance, if you have an image chain like: + +@example +base.qcow2 <- snap1.qcow2 <- snap2.qcow2 +@end example + +To enumerate information about each disk image in the above chain, starting from top to base, do: + +@example +qemu-img info --backing-chain snap2.qcow2 +@end example + @item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename} List, apply, create or delete snapshots in image @var{filename}. -- 1.7.12.1