[Libguestfs] [PATCH nbdkit] log: Decode the extent type in output.
Martin Kletzander
mkletzan at redhat.com
Mon Apr 1 13:03:18 UTC 2019
On Mon, Apr 01, 2019 at 07:40:14AM -0500, Eric Blake wrote:
>On 4/1/19 6:53 AM, Richard W.M. Jones wrote:
>> Instead of printing something like ‘type=0’ or ‘type=3’, this changes
>> the output to show the hole and zero flags separately. For example:
>>
>> $ ./nbdkit -U - --filter=log sh - logfile=/dev/stdout \
>> --run 'qemu-img map $nbd' <<'EOF'
>> case "$1" in
>> get_size) echo 1M ;;
>> pread) dd if=/dev/zero count=$3 iflag=count_bytes ;;
>> can_extents) exit 0 ;;
>> extents)
>> echo "0 32K zero"
>> echo "32K 32K hole,zero"
>> echo "64K 983040 "
>> ;;
>> *) exit 2 ;;
>> esac
>> EOF
>> [...]
>> 2019-04-01 11:49:40.818357 connection=1 Extents id=2 offset=0x0 count=0x100000 req_one=1 ...
>> 2019-04-01 11:49:40.819848 connection=1 ...Extents id=2 extents=[{ offset=0x0, length=0x8000, hole=0, zero=1 }, { offset=0x8000, length=0x8000, hole=1, zero=1 }, { offset=0x10000, length=0xf0000, hole=0, zero=0 }] return=0
>>
>> Updates commit ed868b00f192cd72e91265e4fcdf3c3fbe8b7613.
>
>Yes, that's nicer.
>
Even nicer than what I thought of.
>>
>> Thanks: Martin Kletzander
>> ---
>> filters/log/log.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>
>--
>Eric Blake, Principal Software Engineer
>Red Hat, Inc. +1-919-301-3226
>Virtualization: qemu.org | libvirt.org
>
>_______________________________________________
>Libguestfs mailing list
>Libguestfs at redhat.com
>https://www.redhat.com/mailman/listinfo/libguestfs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190401/c8001dac/attachment.sig>
More information about the Libguestfs
mailing list