* [Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code
@ 2019-02-20 0:05 Philippe Mathieu-Daudé
2019-02-20 11:30 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-02-20 0:05 UTC (permalink / raw)
To: qemu-devel
Cc: Max Reitz, Paolo Bonzini, Peter Lieven, qemu-block, Kevin Wolf,
Ronnie Sahlberg, Philippe Mathieu-Daudé
Some Linux specific code is missing guards, leading to
build failure on OSX:
$ sudo brew install libiscsi
$ ./configure && make
[...]
CC block/iscsi.o
qemu/block/iscsi.c:338:24: error: 'iscsi_aiocb_info' defined but not used [-Werror=unused-const-variable=]
static const AIOCBInfo iscsi_aiocb_info = {
^~~~~~~~~~~~~~~~
qemu/block/iscsi.c:168:1: error: 'iscsi_schedule_bh' defined but not used [-Werror=unused-function]
iscsi_schedule_bh(IscsiAIOCB *acb)
^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Add guards to restrict this code for Linux.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
There are various Linux specific code, we could split it out to
another file such block/iscsi-lnx.o and guard with Makefile,
but that's another patch.
block/iscsi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index ff473206e6..85daa9a481 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -145,6 +145,8 @@ static const unsigned iscsi_retry_times[] = {8, 32, 128, 512, 2048, 8192, 32768}
* unallocated. */
#define ISCSI_CHECKALLOC_THRES 64
+#ifdef __linux__
+
static void
iscsi_bh_cb(void *p)
{
@@ -172,6 +174,8 @@ iscsi_schedule_bh(IscsiAIOCB *acb)
qemu_bh_schedule(acb->bh);
}
+#endif
+
static void iscsi_co_generic_bh_cb(void *opaque)
{
struct IscsiTask *iTask = opaque;
@@ -290,6 +294,8 @@ static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask)
};
}
+#ifdef __linux__
+
/* Called (via iscsi_service) with QemuMutex held. */
static void
iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data,
@@ -338,6 +344,7 @@ static const AIOCBInfo iscsi_aiocb_info = {
.cancel_async = iscsi_aio_cancel,
};
+#endif
static void iscsi_process_read(void *arg);
static void iscsi_process_write(void *arg);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code
2019-02-20 0:05 [Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code Philippe Mathieu-Daudé
@ 2019-02-20 11:30 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-02-20 11:30 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Max Reitz, Peter Lieven, qemu-block, Kevin Wolf, Ronnie Sahlberg
On 20/02/19 01:05, Philippe Mathieu-Daudé wrote:
> Some Linux specific code is missing guards, leading to
> build failure on OSX:
>
> $ sudo brew install libiscsi
> $ ./configure && make
> [...]
> CC block/iscsi.o
> qemu/block/iscsi.c:338:24: error: 'iscsi_aiocb_info' defined but not used [-Werror=unused-const-variable=]
> static const AIOCBInfo iscsi_aiocb_info = {
> ^~~~~~~~~~~~~~~~
> qemu/block/iscsi.c:168:1: error: 'iscsi_schedule_bh' defined but not used [-Werror=unused-function]
> iscsi_schedule_bh(IscsiAIOCB *acb)
> ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Add guards to restrict this code for Linux.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> There are various Linux specific code, we could split it out to
> another file such block/iscsi-lnx.o and guard with Makefile,
> but that's another patch.
>
> block/iscsi.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index ff473206e6..85daa9a481 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -145,6 +145,8 @@ static const unsigned iscsi_retry_times[] = {8, 32, 128, 512, 2048, 8192, 32768}
> * unallocated. */
> #define ISCSI_CHECKALLOC_THRES 64
>
> +#ifdef __linux__
> +
> static void
> iscsi_bh_cb(void *p)
> {
> @@ -172,6 +174,8 @@ iscsi_schedule_bh(IscsiAIOCB *acb)
> qemu_bh_schedule(acb->bh);
> }
>
> +#endif
> +
> static void iscsi_co_generic_bh_cb(void *opaque)
> {
> struct IscsiTask *iTask = opaque;
> @@ -290,6 +294,8 @@ static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask)
> };
> }
>
> +#ifdef __linux__
> +
> /* Called (via iscsi_service) with QemuMutex held. */
> static void
> iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data,
> @@ -338,6 +344,7 @@ static const AIOCBInfo iscsi_aiocb_info = {
> .cancel_async = iscsi_aio_cancel,
> };
>
> +#endif
>
> static void iscsi_process_read(void *arg);
> static void iscsi_process_write(void *arg);
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-20 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 0:05 [Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code Philippe Mathieu-Daudé
2019-02-20 11:30 ` Paolo Bonzini
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).