[Libguestfs] [PATCH] api: Add a special type for the flags argument.

Richard W.M. Jones rjones at redhat.com
Tue May 28 15:11:59 UTC 2019


On Tue, May 28, 2019 at 09:58:45AM -0500, Eric Blake wrote:
> h.zero (64*1024, 0, nbd.CMD_FLAG_FUA, nbd.CMD_FLAG_NO_HOLE)
> 
> instead (two arguments, each with one flag, which the glue code then
> combines into a single integer; compared to the existing approach of
> letting Python do the bitwise math and pass in a single integer up front).

We check the Flags argument appears only once at the end, but while
that means this is possible it will make the generator a bit more
complicated because it loses the one-to-one mapping of args with
Python arguments.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list