[v5,1/2] examples/vhost_scsi: Don't build without virtio_scsi.h

Message ID 20190207220114.8020-2-msantana@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Introduce travis support |

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Michael Santana Feb. 7, 2019, 10:01 p.m. UTC
  From: Aaron Conole <aconole@redhat.com>

The vhost_scsi example code is set to build, even if the requisite header
file virtio_scsi.h isn't available.  This happens on some Ubuntu systems
when some versions of the libc-dev package aren't available.

Check whether the virtio_scsi.h file exists, and if not, set the build
flag to false.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
v5:
  Nothing changed in this patch since v3.

 examples/vhost_scsi/meson.build | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Thomas Monjalon Feb. 27, 2019, 2:09 p.m. UTC | #1
07/02/2019 23:01, Michael Santana:
> From: Aaron Conole <aconole@redhat.com>
> 
> The vhost_scsi example code is set to build, even if the requisite header
> file virtio_scsi.h isn't available.  This happens on some Ubuntu systems
> when some versions of the libc-dev package aren't available.
> 
> Check whether the virtio_scsi.h file exists, and if not, set the build
> flag to false.
> 
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> v5:
>   Nothing changed in this patch since v3.

Patch 1 applied alone to allow Travis refinement separately, thanks.
  

Patch

diff --git a/examples/vhost_scsi/meson.build b/examples/vhost_scsi/meson.build
index 2303bcaed..ca1248023 100644
--- a/examples/vhost_scsi/meson.build
+++ b/examples/vhost_scsi/meson.build
@@ -9,6 +9,11 @@ 
 if host_machine.system() != 'linux'
 	build = false
 endif
+
+if not cc.has_header('virtio_scsi.h')
+	build = false
+endif
+
 deps += 'vhost'
 cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(