[Libguestfs] [PATCH nbdkit v2] ssh: Allow the remote file to be created

Richard W.M. Jones rjones at redhat.com
Sun Apr 17 09:52:52 UTC 2022


On Sun, Apr 17, 2022 at 10:09:32AM +0100, Richard W.M. Jones wrote:
> On Sun, Apr 17, 2022 at 09:32:03AM +0200, Laszlo Ersek wrote:
> > (3) What is the thread model of this plugin? Is it possible for two
> > opens to run in parallel?
> 
> It's SERIALIZE_REQUESTS so we're OK.

Actually no we're not OK.  Two connections could run .open in parallel
so that's not safe.

As an aside, the whole reason we use SERIALIZE_REQUESTS (and not
PARALLEL) in the first place is because SFTP has no atomic
pread/pwrite calls, so we have to simulate them with seek +
read/write.  We could open multiple SFTP connections which AIUI would
get multiplexed over the SSH TCP connection, but the implementation
would be significantly more complicated, and you get most of the
benefit using NBD multi-conn.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top


More information about the Libguestfs mailing list