qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
@ 2017-07-13 17:03 Peter Maydell
  2017-07-13 18:40 ` Kamil Rytarowski
  2017-07-14  8:34 ` Peter Maydell
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2017-07-13 17:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, Kamil Rytarowski, Markus Armbruster

This patchset fixes the build on NetBSD by making sure we only
build the ivshmem-client and ivshmem-server tools if the host OS
actually supports ivshmem. (Previously we were only gating building
of the within-QEMU ivshmem PCI device.)

Most of this patchset is the work of Kamil Rytarowski; I just
split it up into easily-reviewable patches and fixed a few bugs.

Tested on Linux, on NetBSD, and on Linux with a '--disable-linux-user
--disable-system' config (which was the one that was failing with
our previous attempt to fix this bug).

NB: we still have some things we need to fix to be able to put
NetBSD into the build-test set. The next issue is that 'make check'
fails with

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
sh: arith: syntax error: "RANDOM % 255 + 1"

likely because we're using a bashism there.

thanks
-- PMM

Kamil Rytarowski (2):
  configure: Use an explicit CONFIG_IVSHMEM rather than CONFIG_EVENTFD
  configure: Don't build ivshmem tools unless CONFIG_IVSHMEM is set

Peter Maydell (1):
  configure: Rename CONFIG_IVSHMEM to CONFIG_IVSHMEM_DEVICE

 configure               | 11 +++++++++++
 Makefile                |  2 ++
 Makefile.objs           |  4 ++--
 hw/misc/Makefile.objs   |  2 +-
 tests/Makefile.include  |  4 ++--
 default-configs/pci.mak |  2 +-
 6 files changed, 19 insertions(+), 6 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-13 17:03 [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools) Peter Maydell
@ 2017-07-13 18:40 ` Kamil Rytarowski
  2017-07-13 20:12   ` Eric Blake
  2017-07-14  8:34 ` Peter Maydell
  1 sibling, 1 reply; 9+ messages in thread
From: Kamil Rytarowski @ 2017-07-13 18:40 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Markus Armbruster, patches

[-- Attachment #1: Type: text/plain, Size: 2324 bytes --]

On 13.07.2017 19:03, Peter Maydell wrote:
> This patchset fixes the build on NetBSD by making sure we only
> build the ivshmem-client and ivshmem-server tools if the host OS
> actually supports ivshmem. (Previously we were only gating building
> of the within-QEMU ivshmem PCI device.)
> 
> Most of this patchset is the work of Kamil Rytarowski; I just
> split it up into easily-reviewable patches and fixed a few bugs.
> 

Thank you for improving the patches!

> Tested on Linux, on NetBSD, and on Linux with a '--disable-linux-user
> --disable-system' config (which was the one that was failing with
> our previous attempt to fix this bug).
> 
> NB: we still have some things we need to fix to be able to put
> NetBSD into the build-test set. The next issue is that 'make check'
> fails with
> 
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
> sh: arith: syntax error: "RANDOM % 255 + 1"
> 
> likely because we're using a bashism there.
> 

This is an extension to a POSIX shell. We were lately adding it as an
extension to our sh(1) in the distribution. Were also thinking about
prompting POSIX to standarize it.

$ echo $((RANDOM % 255))
52

As of now, one portable solution is to parse /dev/urandom, or use a 3rd
party tool like awk(1).

To make the life easier we can try to request bash to run tests. A
portable shebang is "/usr/bin/env bash".

From the NetBSD point of view I see nothing wrong with using bash for tests.

We can also request NetBSD 8.0 for running tests, busy wait till getting
this compatibility issue gone. As of now NetBSD 8.0 is in beta.
Personally I don't intend to invest to much time into pre-8.0 releases.

> thanks
> -- PMM
> 
> Kamil Rytarowski (2):
>   configure: Use an explicit CONFIG_IVSHMEM rather than CONFIG_EVENTFD
>   configure: Don't build ivshmem tools unless CONFIG_IVSHMEM is set
> 
> Peter Maydell (1):
>   configure: Rename CONFIG_IVSHMEM to CONFIG_IVSHMEM_DEVICE
> 
>  configure               | 11 +++++++++++
>  Makefile                |  2 ++
>  Makefile.objs           |  4 ++--
>  hw/misc/Makefile.objs   |  2 +-
>  tests/Makefile.include  |  4 ++--
>  default-configs/pci.mak |  2 +-
>  6 files changed, 19 insertions(+), 6 deletions(-)
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-13 18:40 ` Kamil Rytarowski
@ 2017-07-13 20:12   ` Eric Blake
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Blake @ 2017-07-13 20:12 UTC (permalink / raw)
  To: Kamil Rytarowski, Peter Maydell, qemu-devel; +Cc: Markus Armbruster, patches

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On 07/13/2017 01:40 PM, Kamil Rytarowski wrote:

>> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
>> sh: arith: syntax error: "RANDOM % 255 + 1"
>>
>> likely because we're using a bashism there.

Yes, assuming that $RANDOM exists is a bashism.

>>
> 
> This is an extension to a POSIX shell. We were lately adding it as an
> extension to our sh(1) in the distribution. Were also thinking about
> prompting POSIX to standarize it.
> 
> $ echo $((RANDOM % 255))
> 52
> 
> As of now, one portable solution is to parse /dev/urandom, or use a 3rd
> party tool like awk(1).

It's also portable (although less random) to do:

$(( ${RANDOM:-0} + 1))

(the whole idea of MALLOC_PERTURB_ only works on glibc anyways, so it
really doesn't matter what you set it to on other systems).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
@ 2017-07-14  8:33 Peter Maydell
  2017-07-20  9:43 ` Peter Maydell
  2017-07-20 11:20 ` Markus Armbruster
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2017-07-14  8:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, Kamil Rytarowski, Markus Armbruster

This patchset fixes the build on NetBSD by making sure we only
build the ivshmem-client and ivshmem-server tools if the host OS
actually supports ivshmem. (Previously we were only gating building
of the within-QEMU ivshmem PCI device.)

Most of this patchset is the work of Kamil Rytarowski; I just
split it up into easily-reviewable patches and fixed a few bugs.

Tested on Linux, on NetBSD, and on Linux with a '--disable-linux-user
--disable-system' config (which was the one that was failing with
our previous attempt to fix this bug).

NB: we still have some things we need to fix to be able to put
NetBSD into the build-test set. The next issue is that 'make check'
fails with

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
sh: arith: syntax error: "RANDOM % 255 + 1"

likely because we're using a bashism there.

thanks
-- PMM

Kamil Rytarowski (2):
  configure: Use an explicit CONFIG_IVSHMEM rather than CONFIG_EVENTFD
  configure: Don't build ivshmem tools unless CONFIG_IVSHMEM is set

Peter Maydell (1):
  configure: Rename CONFIG_IVSHMEM to CONFIG_IVSHMEM_DEVICE

 configure               | 11 +++++++++++
 Makefile                |  2 ++
 Makefile.objs           |  4 ++--
 hw/misc/Makefile.objs   |  2 +-
 tests/Makefile.include  |  4 ++--
 default-configs/pci.mak |  2 +-
 6 files changed, 19 insertions(+), 6 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-13 17:03 [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools) Peter Maydell
  2017-07-13 18:40 ` Kamil Rytarowski
@ 2017-07-14  8:34 ` Peter Maydell
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2017-07-14  8:34 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Kamil Rytarowski, Markus Armbruster, patches@linaro.org

On 13 July 2017 at 18:03, Peter Maydell <peter.maydell@linaro.org> wrote:
> This patchset fixes the build on NetBSD by making sure we only
> build the ivshmem-client and ivshmem-server tools if the host OS
> actually supports ivshmem. (Previously we were only gating building
> of the within-QEMU ivshmem PCI device.)

Markus pointed out that I'd accidentally only sent out the
cover letter -- I've just resent the whole set.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-14  8:33 Peter Maydell
@ 2017-07-20  9:43 ` Peter Maydell
  2017-07-20 11:20 ` Markus Armbruster
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2017-07-20  9:43 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Kamil Rytarowski, Markus Armbruster, patches@linaro.org

Ping for review? It would be nice to get the NetBSD host into
the build-test rotation...

thanks
-- PMM

On 14 July 2017 at 09:33, Peter Maydell <peter.maydell@linaro.org> wrote:
> This patchset fixes the build on NetBSD by making sure we only
> build the ivshmem-client and ivshmem-server tools if the host OS
> actually supports ivshmem. (Previously we were only gating building
> of the within-QEMU ivshmem PCI device.)
>
> Most of this patchset is the work of Kamil Rytarowski; I just
> split it up into easily-reviewable patches and fixed a few bugs.
>
> Tested on Linux, on NetBSD, and on Linux with a '--disable-linux-user
> --disable-system' config (which was the one that was failing with
> our previous attempt to fix this bug).
>
> NB: we still have some things we need to fix to be able to put
> NetBSD into the build-test set. The next issue is that 'make check'
> fails with
>
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
> sh: arith: syntax error: "RANDOM % 255 + 1"
>
> likely because we're using a bashism there.
>
> thanks
> -- PMM
>
> Kamil Rytarowski (2):
>   configure: Use an explicit CONFIG_IVSHMEM rather than CONFIG_EVENTFD
>   configure: Don't build ivshmem tools unless CONFIG_IVSHMEM is set
>
> Peter Maydell (1):
>   configure: Rename CONFIG_IVSHMEM to CONFIG_IVSHMEM_DEVICE
>
>  configure               | 11 +++++++++++
>  Makefile                |  2 ++
>  Makefile.objs           |  4 ++--
>  hw/misc/Makefile.objs   |  2 +-
>  tests/Makefile.include  |  4 ++--
>  default-configs/pci.mak |  2 +-
>  6 files changed, 19 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-14  8:33 Peter Maydell
  2017-07-20  9:43 ` Peter Maydell
@ 2017-07-20 11:20 ` Markus Armbruster
  2017-07-20 15:35   ` Peter Maydell
  1 sibling, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2017-07-20 11:20 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Kamil Rytarowski, patches

Peter Maydell <peter.maydell@linaro.org> writes:

> This patchset fixes the build on NetBSD by making sure we only
> build the ivshmem-client and ivshmem-server tools if the host OS
> actually supports ivshmem. (Previously we were only gating building
> of the within-QEMU ivshmem PCI device.)
>
> Most of this patchset is the work of Kamil Rytarowski; I just
> split it up into easily-reviewable patches and fixed a few bugs.
>
> Tested on Linux, on NetBSD, and on Linux with a '--disable-linux-user
> --disable-system' config (which was the one that was failing with
> our previous attempt to fix this bug).
>
> NB: we still have some things we need to fix to be able to put
> NetBSD into the build-test set. The next issue is that 'make check'
> fails with
>
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m=quick tests/check-qdict
> sh: arith: syntax error: "RANDOM % 255 + 1"
>
> likely because we're using a bashism there.

Regardless of my inability to find CONFIG_IVSHMEM confusing (see PATCH
1), series
Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-20 11:20 ` Markus Armbruster
@ 2017-07-20 15:35   ` Peter Maydell
  2017-07-20 16:59     ` Kamil Rytarowski
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2017-07-20 15:35 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers, Kamil Rytarowski, patches@linaro.org

On 20 July 2017 at 12:20, Markus Armbruster <armbru@redhat.com> wrote:
> Regardless of my inability to find CONFIG_IVSHMEM confusing (see PATCH
> 1), series
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Thanks; patchset applied to master.

-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools)
  2017-07-20 15:35   ` Peter Maydell
@ 2017-07-20 16:59     ` Kamil Rytarowski
  0 siblings, 0 replies; 9+ messages in thread
From: Kamil Rytarowski @ 2017-07-20 16:59 UTC (permalink / raw)
  To: Peter Maydell, Markus Armbruster; +Cc: QEMU Developers, patches@linaro.org

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On 20.07.2017 17:35, Peter Maydell wrote:
> On 20 July 2017 at 12:20, Markus Armbruster <armbru@redhat.com> wrote:
>> Regardless of my inability to find CONFIG_IVSHMEM confusing (see PATCH
>> 1), series
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 
> Thanks; patchset applied to master.
> 
> -- PMM
> 

Thank you for this!


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-20 16:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 17:03 [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools) Peter Maydell
2017-07-13 18:40 ` Kamil Rytarowski
2017-07-13 20:12   ` Eric Blake
2017-07-14  8:34 ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2017-07-14  8:33 Peter Maydell
2017-07-20  9:43 ` Peter Maydell
2017-07-20 11:20 ` Markus Armbruster
2017-07-20 15:35   ` Peter Maydell
2017-07-20 16:59     ` Kamil Rytarowski

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).