The libnfs asynch API has changed type signature in this new version.
This change breaks qemu and it wasn't immediately obvious to me how to
fix it.  In particular the new API requires a buffer to be passed, but
it's unclear what that would be.

Old signature:

EXTERN int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh,
                           uint64_t offset, uint64_t count, nfs_cb cb,
                           void *private_data);

New signature:

EXTERN int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh,
                           void *buf, size_t count, uint64_t offset,
                           nfs_cb cb, void *private_data);

(Similar changes are made to pwrite_async)

The compilation error is below.

I guess this needs upstream qemu attention.

Rich.

[1/1530] Generating qemu-version.h with a custom command (wrapped by meson to 
capture output)
[2/1529] Compiling C object libblock.a.p/block_nfs.c.o
FAILED: libblock.a.p/block_nfs.c.o 
cc -m64 -Ilibblock.a.p -I. -I.. -Iqapi -Itrace -Iui -Iui/shader -Iblock 
-I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 
-I/usr/include/sysprof-6 -flto=auto -fdiagnostics-color=auto -Wall 
-Winvalid-pch -std=gnu11 -O3 -g -Wempty-body -Wendif-labels 
-Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers 
-Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute 
-Wmissing-prototypes -Wnested-externs -Wold-style-declaration 
-Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes 
-Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs 
-Wno-psabi -Wno-shift-negative-value -isystem /home/rjones/d/qemu/linux-headers 
-isystem linux-headers -iquote . -iquote /home/rjones/d/qemu -iquote 
/home/rjones/d/qemu/include -iquote /home/rjones/d/qemu/host/include/x86_64 
-iquote /home/rjones/d/qemu/host/include/generic -iquote 
/home/rjones/d/qemu/tcg/i386 -pthread -mcx16 -msse2 -D_LARGEFILE_SOURCE 
-fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero 
-fzero-call-used-regs=used-gpr -march=native -fno-omit-frame-pointer -fPIE 
-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64 
-DUSE_POSIX_ACLS=1 -D_GNU_SOURCE -DWITH_GZFILEOP -MD -MQ 
libblock.a.p/block_nfs.c.o -MF libblock.a.p/block_nfs.c.o.d -o 
libblock.a.p/block_nfs.c.o -c ../block/nfs.c
../block/nfs.c: In function ‘nfs_co_preadv’:
../block/nfs.c:275:29: error: passing argument 3 of ‘nfs_pread_async’ makes 
pointer from integer without a cast [-Wint-conversion]
  275 |                             offset, bytes, nfs_co_generic_cb, &task) != 
0) {
      |                             ^~~~~~
      |                             |
      |                             int64_t {aka long int}
In file included from ../block/nfs.c:48:
/usr/include/nfsc/libnfs.h:723:34: note: expected ‘void *’ but argument is of 
type ‘int64_t’ {aka ‘long int’}
  723 |                            void *buf, size_t count, uint64_t offset,
      |                            ~~~~~~^~~
../block/nfs.c:275:44: error: passing argument 5 of ‘nfs_pread_async’ makes 
integer from pointer without a cast [-Wint-conversion]
  275 |                             offset, bytes, nfs_co_generic_cb, &task) != 
0) {
      |                                            ^~~~~~~~~~~~~~~~~
      |                                            |
      |                                            void (*)(int,  struct 
nfs_context *, void *, void *)
/usr/include/nfsc/libnfs.h:723:62: note: expected ‘uint64_t’ {aka ‘long 
unsigned int’} but argument is of type ‘void (*)(int,  struct nfs_context *, 
void *, void *)’
  723 |                            void *buf, size_t count, uint64_t offset,
      |                                                     ~~~~~~~~~^~~~~~
../block/nfs.c:275:63: error: passing argument 6 of ‘nfs_pread_async’ from 
incompatible pointer type [-Wincompatible-pointer-types]
  275 |                             offset, bytes, nfs_co_generic_cb, &task) != 
0) {
      |                                                               ^~~~~
      |                                                               |
      |                                                               NFSRPC *
/usr/include/nfsc/libnfs.h:724:35: note: expected ‘nfs_cb’ {aka ‘void (*)(int,  
struct nfs_context *, void *, void *)’} but argument is of type ‘NFSRPC *’
  724 |                            nfs_cb cb, void *private_data);
      |                            ~~~~~~~^~
../block/nfs.c:274:13: error: too few arguments to function ‘nfs_pread_async’
  274 |         if (nfs_pread_async(client->context, client->fh,
      |             ^~~~~~~~~~~~~~~
/usr/include/nfsc/libnfs.h:722:12: note: declared here
  722 | EXTERN int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh,
      |            ^~~~~~~~~~~~~~~
../block/nfs.c: In function ‘nfs_co_pwritev’:
../block/nfs.c:321:30: error: passing argument 3 of ‘nfs_pwrite_async’ makes 
pointer from integer without a cast [-Wint-conversion]
  321 |                              offset, bytes, buf,
      |                              ^~~~~~
      |                              |
      |                              int64_t {aka long int}
/usr/include/nfsc/libnfs.h:785:41: note: expected ‘const void *’ but argument 
is of type ‘int64_t’ {aka ‘long int’}
  785 |                             const void *buf, size_t count, uint64_t 
offset,
      |                             ~~~~~~~~~~~~^~~
../block/nfs.c:321:45: error: passing argument 5 of ‘nfs_pwrite_async’ makes 
integer from pointer without a cast [-Wint-conversion]
  321 |                              offset, bytes, buf,
      |                                             ^~~
      |                                             |
      |                                             char *
/usr/include/nfsc/libnfs.h:785:69: note: expected ‘uint64_t’ {aka ‘long 
unsigned int’} but argument is of type ‘char *’
  785 |                             const void *buf, size_t count, uint64_t 
offset,
      |                                                            
~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit


Reply via email to