[Libguestfs] [libnbd PATCH 2/2] tests: Test server response to oversize requests

2022-11-09 Thread Eric Blake
Improve some existing tests to cover client safety valves for oversize requests, and add a new test that tests libnbd behavior on server errors to the same sort of requests. The new test requires a parallel patch posted to nbdkit to teach 'nbdkit eval' how to forcefully disconnect the server on

[Libguestfs] [libnbd PATCH 1/2] api: Add LIBNBD_STRICT_PAYLOAD to honor qemu 32M write limit

2022-11-09 Thread Eric Blake
Modern qemu tends to advertise a strict 32M payload limit. Yet we default to allowing the user to attempt up to 64M in pwrite. For pread, qemu will reply with EINVAL but keep the connection up; but for pwrite, an overlarge buffer is fatal. It's time to teach libnbd to honor qemu's max buffer by

[Libguestfs] [libnbd PATCH 0/2] default to client-side enforcing of max block size

2022-11-09 Thread Eric Blake
I'm getting closer to posting v2 of my 64-bit NBD extension patches. On the way, I noticed that libnbd was not obeying block-size maximum constraints, which becomes all the more important when we want to allow for even larger buffer sizes for servers that support it. Eric Blake (2): api: Add

Re: [Libguestfs] [nbdkit PATCH v2 2/2] sh: Add exit status triggers for nbdkit_{shutdown, disconnect}

2022-11-09 Thread Eric Blake
On Wed, Nov 09, 2022 at 02:43:53PM -0600, Eric Blake wrote: > Make it possible for the sh and eval plugins to disconnect a client or > shut down the entire nbdkit server by use of special return values. > Prior to this patch we had reserved 4-7 for future use; this defines > 4-8, and extends the

[Libguestfs] [nbdkit PATCH v2 2/2] sh: Add exit status triggers for nbdkit_{shutdown, disconnect}

2022-11-09 Thread Eric Blake
Make it possible for the sh and eval plugins to disconnect a client or shut down the entire nbdkit server by use of special return values. Prior to this patch we had reserved 4-7 for future use; this defines 4-8, and extends the set of reserved return values to 9-15. We figure it is unlikely that

[Libguestfs] [nbdkit PATCH v2 0/2] Allow sh/eval plugins to disconnect

2022-11-09 Thread Eric Blake
I think this addresses all the feedback given on v1. Instead of packing things into 3 new status values, and using silent/noisy stderr as the deciding factor between returning OK or ERROR (which in turn required either code duplication or a nasty goto for control flow), this version uses 5 new

[Libguestfs] [nbdkit PATCH v2 1/2] sh: Advertise max known status in --dump-plugin

2022-11-09 Thread Eric Blake
We are about to define specific meaning to more return status values. To make it easier to probe if nbdkit is new enough to honor such definitions (and thus whether it makes sense to write a script that tries to utilize such special return values), it is worth advertising the max known status

Re: [Libguestfs] [nbdkit PATCH] sh: Add exit status triggers for nbdkit_{shutdown, disconnect}

2022-11-09 Thread Eric Blake
On Wed, Nov 02, 2022 at 01:36:26PM +, Richard W.M. Jones wrote: > > > -=item 4, 5, 6, 7 > > > +=item S<4> > > > > The S<> notation seems new here (so it's going to be inconsistent with > > the rest of this file, I think). > > I was going to mention this too. The S<> notation is used to

[Libguestfs] [p2v PATCH] disks.c: skip SCSI floppy drives with no disk inserted

2022-11-09 Thread Laszlo Ersek
A SCSI floppy drive with no disk inserted looks like a normal /dev/sd* node, but causes the nbdkit file plugin to fail with ENOMEDIUM. Filter out such devices altogether -- unlike CD-ROMs (for which we create a device model in the target, albeit with no medium inserted), empty floppies should not