Skip to content

block/ssh: Add basic .bdrv_truncate()

Max Reitz qemu-devel 1 version Applied

Status from this message: Applied to my block branch.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3block/ssh: Pull ssh_grow_file() from ssh_create()block/ssh.c+22 -81 reply
2/3block/ssh: Make ssh_grow_file() blockingblock/ssh.c+7 -02 replies
3/3block/ssh: Add basic .bdrv_truncate()block/ssh.c+24 -02 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchEric BlakeRichard W.M. Jones
1/3R-b
2/3R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] block/ssh: Add basic .bdrv_truncate()

For (x-)blockdev-create, all protocol drivers that support image creation also need to offer a .bdrv_truncate() implementation that matches in features. A previous series of mine brought gluster's and sheepdog's implementation up to par regarding preallocated truncation; but I forgot about drivers that have a .bdrv_create() but no .bdrv_truncate() at all.

There is only one of these, and that is ssh. Since libssh2 does not seem to know any way of truncating files, we can only support growing files -- but that is what we need for (x-)blockdev-create.

Note that there are also drivers which do not support growing files, namely iscsi and file-posix for host devices (maybe more? I hope not). But these also pretty much ignore the specified size on .bdrv_create() and just use the size of the existing device. They just check that the specified size does not exceed the actual size, so that pretty much matches what their .bdrv_truncate() supports, and we should be fine there.

Max Reitz (3):
block/ssh: Pull ssh_grow_file() from ssh_create() block/ssh: Make ssh_grow_file() blocking block/ssh: Add basic .bdrv_truncate()

 block/ssh.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 53 insertions(+), 8 deletions(-)
Signature · 1 line
2.14.3