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


Reply via email to