[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] iotests: Add poke_file_[bl]e functions
From: |
Eric Blake |
Subject: |
Re: [PATCH 2/3] iotests: Add poke_file_[bl]e functions |
Date: |
Tue, 24 Mar 2020 09:43:13 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 3/10/20 12:22 PM, Max Reitz wrote:
+# poke_file_le 'test.img' 512 2 65534
+poke_file_le()
+{
I like the interface. However, the implementation is a bit bloated (but
then again, that's why you cc'd me for review ;)
+ local img=$1 ofs=$2 len=$3 val=$4 str=''
Noticing that this is not in yet, I have one more suggestion:
The initial doc comment is not helpful without reading the rest of the
function: Is 512 the offset or the value being written? Better might be:
# poke_file_le test.img $offset $width $value
+
+# poke_file_be 'test.img' 512 2 65279
+poke_file_be()
and here, too.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org