[Libguestfs] [nbdkit PATCH v2 07/24] sh: Implement .cache script callback

Eric Blake eblake at redhat.com
Fri May 17 20:21:54 UTC 2019


On 5/17/19 12:12 PM, Richard W.M. Jones wrote:
> On Wed, May 15, 2019 at 10:57:57PM -0500, Eric Blake wrote:
>> It's easy to expose new callbacks to sh plugins, by borrowing
>> tri-state code from can_fua. It's possible that nbdkit emulate will
>> actually work well (in our example.sh script, the kernel caching a
>> pread from one dd invocation may indeed speed up the next access), but
>> for the sake of the example, I demonstrated advertising a no-op
>> handler.
>>
>> The shell plugin, coupled with Rich's work on libnbd as a client-side
>> library for actually exercising calls to NBD_CMD_CACHE, will be a
>> useful way to prove that cache commands even make it through the
>> stack. (Remember, qemu 3.0 was released with a fatally flawed
>> NBD_CMD_CACHE server implementation, because there were no open source
>> clients at the time that could actually send the command to test the
>> server with).
>>

>>
>>  Unlike in other languages, you B<must> provide the C<can_*> methods
>>  otherwise they are assumed to all return false and your C<pwrite>,
>> -C<flush>, C<trim>, C<zero> and C<extents> methods will never be
>> +C<flush>, C<trim>, C<zero>, and C<extents> methods will never be
> 
> I wonder if you meant to add C<cache> to this sentence?

Yes. Good catch :)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190517/ccc7153d/attachment.sig>


More information about the Libguestfs mailing list