On Wed, Mar 27, 2024 at 08:20:10PM +0300, Виталя Иванво wrote:
[...]
> I'm faced with the problem of creating a block device with the SCP protocol.
> For example, I write 2 commands:
> 1. In the first terminal
> nbdkit --unix /tmp/usb1.sock --verbose --readonly curl url=scp://10.199.30.16/
> home/user/4Mfile user=user password=+/home/root/pass -D curl.verbose= 1 -f

If what you really want to do is access SSH servers, how about using
nbdkit-ssh-plugin instead?  It is very well tested.

https://libguestfs.org/nbdkit-ssh-plugin.1.html

> 2. In the second terminal
> nbd-client -t 30 -u /tmp/usb1.sock /dev/nbd1 -n
>
> Output log:
> nbdkit: curl[1]: debug: newstyle negotiation: flags: export 0x103
> nbdkit: curl[1]: debug: replying to NBD_OPT_GO with NBD_REP_ACK
> nbdkit: curl[1]: debug: handshake complete, processing requests serially
> nbdkit: curl[1]: debug: curl: pread count=512 offset=0
> nbdkit: curl[1]: debug: Found bundle for host 10.199.30.16: 0x75d0bbd0
> [serially]
> nbdkit: curl[1]: debug: Re-using existing connection! (#0) with host
> 10.199.30.16
> nbdkit: curl[1]: debug: Connected to 10.199.30.16 (10.199.30.16) port 22 (#0)
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> 
> ...
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: Connection #0 to host 10.199.30.16 left intact
> nbdkit: curl[1]: debug: curl: pread count=512 offset=2560
> nbdkit: curl[1]: debug: Found bundle for host 10.199.30.16: 0x75d0bbd0
> [serially]
> nbdkit: curl[1]: debug: Re-using existing connection! (#0) with host
> 10.199.30.16
> nbdkit: curl[1]: debug: Connected to 10.199.30.16 (10.199.30.16) port 22 (#0)
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> 
> ...
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: <data with size=16384>
> nbdkit: curl[1]: debug: Connection #0 to host 10.199.30.16 left intact
> nbdkit: curl[1]: error: write reply: NBD_CMD_READ: Broken pipe
> nbdkit: curl[1]: debug: curl: finalize
> nbdkit: curl[1]: debug: curl: close
> 
> The problem is that I cannot send a file larger than 2-3 megabytes. Not to
> mention that we want to send large images.
> I'm using the latest version of nbdkit 1.33.11.
> Such a breakdown only happens with STP, that is, FTP and other protocols can
> accept large files.

It must be something in curl.  If you really want to use curl (not
nbdkit-ssh-plugin which I'd recommend instead), then you'll need to
enable curl debugging, ie. adding some of these flags:

  https://libguestfs.org/nbdkit-curl-plugin.1.html#DEBUG-FLAGS

> Please tell me if there are patches that solve this problem.
> Thanks, Nikita Pavlov.

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
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to