On Thu, Mar 08, 2018 at 05:03:10PM -0600, Eric Blake wrote:
Recent patches clarified documentation to point out that within
the life of a single connection, the .can_FOO helpers should
return consistent results, and that callers may cache those
results. But at least in the case of .can_fua, we aren't really
caching things; depending on the overhead involved, calling out
to the plugin's .can_fua on every .pwrite with FUA requested
may be noticeable overhead compared to caching it. Any cache
must not be a static variable, as it can differ between
connections.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
TODO | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/TODO b/TODO
index b6fb0b1..1e0f483 100644
--- a/TODO
+++ b/TODO
@@ -40,6 +40,10 @@ General ideas for improvements
ones like offset) can fail to initialize if they can't guarantee
strict alignment and don't want to deal with bounce buffers.
+* Add per-connection caching of .can_FOO callbacks (we already have
+ some: .can_write is only called once, but .can_fua is called on
+ every request with the FUA flag set).
+
Suggestions for plugins
-----------------------
ACK series up to and including this patch.
I've got some comments on the final (RFC) patch.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://libguestfs.org