qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] block/ssh: Add basic .bdrv_truncate()
@ 2018-02-14 20:49 Max Reitz
  2018-02-14 20:49 ` [Qemu-devel] [PATCH 1/3] block/ssh: Pull ssh_grow_file() from ssh_create() Max Reitz
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Max Reitz @ 2018-02-14 20:49 UTC (permalink / raw)
  To: qemu-block
  Cc: qemu-devel, Max Reitz, Kevin Wolf, Richard W . M . Jones,
	Jeff Cody

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(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-23 13:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 20:49 [Qemu-devel] [PATCH 0/3] block/ssh: Add basic .bdrv_truncate() Max Reitz
2018-02-14 20:49 ` [Qemu-devel] [PATCH 1/3] block/ssh: Pull ssh_grow_file() from ssh_create() Max Reitz
2018-02-14 21:08   ` Eric Blake
2018-02-14 20:49 ` [Qemu-devel] [PATCH 2/3] block/ssh: Make ssh_grow_file() blocking Max Reitz
2018-02-14 21:11   ` Eric Blake
2018-02-14 21:28     ` Max Reitz
2018-02-14 20:49 ` [Qemu-devel] [PATCH 3/3] block/ssh: Add basic .bdrv_truncate() Max Reitz
2018-02-14 21:12   ` Eric Blake
2018-02-15 11:12   ` Richard W.M. Jones
2018-02-23 13:51 ` [Qemu-devel] [PATCH 0/3] " Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).