block/nbd: Add missing <qemu/bswap.h> include
The inlined nbd_readXX() functions call beXX_to_cpu(), themselves declared in <qemu/bswap.h>. This fixes when refactoring:
In file included from ../../block/nbd.c:44:
include/block/nbd.h: In function 'nbd_read16':
include/block/nbd.h:383:12: error: implicit declaration of function 'be16_to_cpu' [-Werror=implicit-function-declaration]
383 | *val = be##bits##_to_cpu(*val); \
| ^~
include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N'
387 | DEF_NBD_READ_N(16) /* Defines nbd_read16(). */
| ^~~~~~~~~~~~~~--- include/block/nbd.h | 1 + 1 file changed, 1 insertion(+)
include/block/nbd.h +1 -0
@@ -24,6 +24,7 @@#include "io/channel-socket.h" #include "crypto/tlscreds.h" #include "qapi/error.h" +#include "qemu/bswap.h" extern const BlockExportDriver blk_exp_nbd;
Signature · 1 line
2.38.1
Vladimir Sementsov-Ogievskiy
Reviewed-byQuoted 12 lines · Philippe Mathieu-Daudé
The inlined
nbd_readXX()functions callbeXX_to_cpu(), themselves declared in <qemu/bswap.h>. This fixes when refactoring:In file included from ../../block/nbd.c:44: include/block/nbd.h: In function 'nbd_read16': include/block/nbd.h:383:12: error: implicit declaration of function 'be16_to_cpu' [-Werror=implicit-function-declaration] 383 | *val = be##bits##_to_cpu(*val); \ | ^~ include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N' 387 | DEF_NBD_READ_N(16) /* Defines nbd_read16(). */ | ^~~~~~~~~~~~~~
Quoted 1 line
Signed-off-by Philippe Mathieu-Daudé<[email protected]>
Signature · 2 lines
Best regards, Vladimir
Hi, can this reviewed patch get merged via a block tree?
Quoted 29 lines · Philippe Mathieu-Daudé
The inlined
nbd_readXX()functions callbeXX_to_cpu(), themselves declared in <qemu/bswap.h>. This fixes when refactoring:In file included from ../../block/nbd.c:44: include/block/nbd.h: In function 'nbd_read16': include/block/nbd.h:383:12: error: implicit declaration of function 'be16_to_cpu' [-Werror=implicit-function-declaration] 383 | *val = be##bits##_to_cpu(*val); \ | ^~ include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N' 387 | DEF_NBD_READ_N(16) /* Defines nbd_read16(). */ | ^~~~~~~~~~~~~~Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/block/nbd.h | 1 + 1 file changed, 1 insertion(+)include/block/nbd.h +1
-0@@ -24,6 +24,7 @@#include "io/channel-socket.h" #include "crypto/tlscreds.h" #include "qapi/error.h" +#include "qemu/bswap.h" extern const BlockExportDriver blk_exp_nbd;
Le 12/01/2023 à 13:00, Philippe Mathieu-Daudé a écrit :
Quoted 1 line
Hi, can this reviewed patch get merged via a block tree?
I can take this via trivial.
Thanks,
Laurent
Quoted 31 lines · Philippe Mathieu-Daudé
Quoted 27 lines
The inlined
nbd_readXX()functions callbeXX_to_cpu(), themselves declared in <qemu/bswap.h>. This fixes when refactoring:In file included from
../../block/nbd.c:44:
include/block/nbd.h: In function 'nbd_read16':
include/block/nbd.h:383:12: error: implicit declaration of function 'be16_to_cpu' [-Werror=implicit-function-declaration] 383 | *val = be##bits##_to_cpu(*val); \
| ^~
include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N'
387 |DEF_NBD_READ_N(16)/* Definesnbd_read16(). */
| ^~~~~~~~~~~~~~Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
include/block/nbd.h| 1 +1 file changed, 1 insertion(+)include/block/nbd.h +1
-0@@ -24,6 +24,7 @@ #include "io/channel-socket.h" #include "crypto/tlscreds.h" #include "qapi/error.h" +#include "qemu/bswap.h" extern const BlockExportDriver blk_exp_nbd;
Kevin Wolf
AppliedAm 25.11.2022 um 18:53 hat Philippe Mathieu-Daudé geschrieben:
Quoted 6 lines
The inlined
nbd_readXX()functions callbeXX_to_cpu(), themselves declared in <qemu/bswap.h>. This fixes when refactoring:In file included from
../../block/nbd.c:44:
include/block/nbd.h: In function 'nbd_read16':
include/block/nbd.h:383:12: error: implicit declaration of function 'be16_to_cpu' [-Werror=implicit-function-declaration]
Quoted 7 lines
383 | *val = be##bits##_to_cpu(*val); \ | ^~ include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N' 387 | DEF_NBD_READ_N(16) /* Defines nbd_read16(). */ | ^~~~~~~~~~~~~~Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Thanks, applied to the block branch.
Kevin