All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99
@ 2019-01-14 17:45 Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 20/27] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Thomas Huth
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thomas Huth @ 2019-01-14 17:45 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Li Qiang

 Hi Peter!

The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16:

  Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000)

are available in the git repository at:

  https://gitlab.com/huth/qemu.git tags/pull-request-2019-01-14v2

for you to fetch changes up to 650db715681ad1a042705484776e1974f288f3d4:

  tests/hexloader-test: Don't pass -nographic to the QEMU under test (2019-01-14 18:21:29 +0100)

----------------------------------------------------------------
- Remove deprecated "ivshmem" legacy device
- Bug fix for vhost-user-test
- Use more CONFIG Makefile switches for qtests
- Get rid of global_qtests in some more qtests
- typedef cleanups
- Fixes for compiling with Clang
- Force C standard to gnu99
----------------------------------------------------------------

Li Qiang (3):
      tests: vhost-user-test: initialize 'fd' in chr_read
      vhost-user: fix ioeventfd_enabled
      util: check the return value of fcntl in qemu_set_{block, nonblock}

Peter Maydell (1):
      tests/hexloader-test: Don't pass -nographic to the QEMU under test

Philippe Mathieu-Daudé (12):
      hw/input/ps2: Remove PS2State from "qemu/typedefs.h"
      hw/pcmcia: Remove PCMCIACardState from "qemu/typedefs.h"
      hw/ide/ahci: Remove AllwinnerAHCIState from "qemu/typedefs.h"
      hw/i2c/smbus: Remove SMBusDevice from "qemu/typedefs.h"
      hw/bt: Remove HCIInfo from "qemu/typedefs.h"
      hw/char/serial: Remove SerialState from "qemu/typedefs.h"
      hw/i386: Remove PCMachineClass from "qemu/typedefs.h"
      audio: Remove AudioState from "qemu/typedefs.h"
      ui/console: Remove QemuDmaBuf from "qemu/typedefs.h"
      ui/console: Remove DisplayState/DisplaySurface from "qemu/typedefs.h"
      ui/console: Remove MouseTransformInfo from qemu/typedefs.h
      ui/console: Remove PixelFormat from qemu/typedefs.h

Thomas Huth (11):
      hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device
      tests/Makefile: Use some more CONFIG switches for x86 tests
      tests/Makefile: Use some more CONFIG switches for ppc tests
      tests/endianesss: Make test independent of global_qtest
      tests/boot-order: Make test independent of global_qtest
      tests/pnv-xscom: Make test independent of global_qtest
      linux-user: Fix compilation with clang 3.4
      ppc: Move spapr-related prototypes from xics.h into a seperate header file
      ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode
      block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode
      configure: Force the C standard to gnu99

 audio/audio_int.h           |   4 +-
 block/iscsi.c               |   2 +
 configure                   |   5 +-
 docs/specs/ivshmem-spec.txt |   8 +-
 hw/i386/pc_piix.c           |   1 -
 hw/intc/xics_kvm.c          |   1 +
 hw/intc/xics_spapr.c        |   1 +
 hw/misc/ivshmem.c           | 210 +---------------------------
 hw/ppc/spapr_irq.c          |   1 +
 hw/virtio/vhost-user.c      |   2 +-
 include/hw/arm/pxa.h        |   1 +
 include/hw/char/serial.h    |   4 +-
 include/hw/devices.h        |   1 +
 include/hw/i2c/smbus.h      |   2 +
 include/hw/i386/pc.h        |   4 +-
 include/hw/ide/ahci.h       |   4 +-
 include/hw/input/ps2.h      |   2 +
 include/hw/pcmcia.h         |   4 +-
 include/hw/ppc/spapr.h      |   5 +-
 include/hw/ppc/spapr_xive.h |   2 -
 include/hw/ppc/xics.h       |   7 -
 include/hw/ppc/xics_spapr.h |  37 +++++
 include/qemu/compiler.h     |   4 +
 include/qemu/typedefs.h     |  13 --
 include/sysemu/bt.h         |   4 +-
 include/ui/console.h        |  24 ++--
 include/ui/qemu-pixman.h    |  10 ++
 linux-user/qemu.h           |   6 +-
 qemu-deprecated.texi        |   5 -
 scripts/device-crash-test   |   1 -
 target/ppc/cpu.h            |  13 +-
 tests/Makefile.include      |  22 +--
 tests/boot-order-test.c     |  59 ++++----
 tests/endianness-test.c     | 329 ++++++++++++++++++++++----------------------
 tests/hexloader-test.c      |   2 +-
 tests/ivshmem-test.c        |  67 ++++-----
 tests/pnv-xscom-test.c      |  29 ++--
 tests/vhost-user-test.c     |   2 +-
 util/oslib-posix.c          |   8 +-
 39 files changed, 363 insertions(+), 543 deletions(-)
 create mode 100644 include/hw/ppc/xics_spapr.h

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

* [Qemu-devel] [PULL v2 20/27] ui/console: Remove MouseTransformInfo from qemu/typedefs.h
  2019-01-14 17:45 [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Thomas Huth
@ 2019-01-14 17:45 ` Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 21/27] ui/console: Remove PixelFormat " Thomas Huth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2019-01-14 17:45 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Li Qiang

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Header files requiring MouseTransformInfo already include "ui/console.h".

To clean "qemu/typedefs.h", move the declaration to "ui/console.h"
(removing the forward declaration).

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/hw/devices.h    | 1 +
 include/qemu/typedefs.h | 1 -
 include/ui/console.h    | 4 ++--
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/hw/devices.h b/include/hw/devices.h
index 0e27feb..b5f1662 100644
--- a/include/hw/devices.h
+++ b/include/hw/devices.h
@@ -4,6 +4,7 @@
 /* Devices that have nowhere better to go.  */
 
 #include "hw/hw.h"
+#include "ui/console.h"
 
 /* smc91c111.c */
 void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 3a57dfd..38ec1fd 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -51,7 +51,6 @@ typedef struct MigrationIncomingState MigrationIncomingState;
 typedef struct MigrationState MigrationState;
 typedef struct Monitor Monitor;
 typedef struct MonitorDef MonitorDef;
-typedef struct MouseTransformInfo MouseTransformInfo;
 typedef struct MSIMessage MSIMessage;
 typedef struct NetClientState NetClientState;
 typedef struct NetFilterState NetFilterState;
diff --git a/include/ui/console.h b/include/ui/console.h
index 0a19037..aa9f975 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -65,13 +65,13 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
 
 void kbd_put_ledstate(int ledstate);
 
-struct MouseTransformInfo {
+typedef struct MouseTransformInfo {
     /* Touchscreen resolution */
     int x;
     int y;
     /* Calibration values as used/generated by tslib */
     int a[7];
-};
+} MouseTransformInfo;
 
 void hmp_mouse_set(Monitor *mon, const QDict *qdict);
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL v2 21/27] ui/console: Remove PixelFormat from qemu/typedefs.h
  2019-01-14 17:45 [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 20/27] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Thomas Huth
@ 2019-01-14 17:45 ` Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 25/27] block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
  2019-01-15 13:16 ` [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Peter Maydell
  3 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2019-01-14 17:45 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Li Qiang

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Header files requiring PixelFormat already include "ui/qemu-pixman.h".

To clean "qemu/typedefs.h", move the declaration to "ui/qemu-pixman.h"
(removing the forward declaration).

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/qemu/typedefs.h  |  1 -
 include/ui/console.h     | 10 ----------
 include/ui/qemu-pixman.h | 10 ++++++++++
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 38ec1fd..5d1a2d8 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -71,7 +71,6 @@ typedef struct PCIExpressHost PCIExpressHost;
 typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
 typedef struct PCMachineState PCMachineState;
-typedef struct PixelFormat PixelFormat;
 typedef struct PostcopyDiscardState PostcopyDiscardState;
 typedef struct Property Property;
 typedef struct PropertyInfo PropertyInfo;
diff --git a/include/ui/console.h b/include/ui/console.h
index aa9f975..fef900d 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -121,16 +121,6 @@ struct QemuConsoleClass {
 
 #define QEMU_ALLOCATED_FLAG     0x01
 
-struct PixelFormat {
-    uint8_t bits_per_pixel;
-    uint8_t bytes_per_pixel;
-    uint8_t depth; /* color depth in bits */
-    uint32_t rmask, gmask, bmask, amask;
-    uint8_t rshift, gshift, bshift, ashift;
-    uint8_t rmax, gmax, bmax, amax;
-    uint8_t rbits, gbits, bbits, abits;
-};
-
 typedef struct DisplaySurface {
     pixman_format_code_t format;
     pixman_image_t *image;
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index b7c82d1..0668109 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -53,6 +53,16 @@
 
 /* -------------------------------------------------------------------- */
 
+typedef struct PixelFormat {
+    uint8_t bits_per_pixel;
+    uint8_t bytes_per_pixel;
+    uint8_t depth; /* color depth in bits */
+    uint32_t rmask, gmask, bmask, amask;
+    uint8_t rshift, gshift, bshift, ashift;
+    uint8_t rmax, gmax, bmax, amax;
+    uint8_t rbits, gbits, bbits, abits;
+} PixelFormat;
+
 PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format);
 pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian);
 pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL v2 25/27] block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode
  2019-01-14 17:45 [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 20/27] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Thomas Huth
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 21/27] ui/console: Remove PixelFormat " Thomas Huth
@ 2019-01-14 17:45 ` Thomas Huth
  2019-01-15 13:16 ` [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Peter Maydell
  3 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2019-01-14 17:45 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Li Qiang

The header "scsi-lowlevel.h" of libiscsi 1.9.0 contains some bad
"inline" prototype definitions which GCC refuses to compile in its
gnu99 mode:

In file included from block/iscsi.c:52:0:
/usr/include/iscsi/scsi-lowlevel.h:810:13: error: inline function
‘scsi_set_uint16’ declared but never defined [-Werror]
 inline void scsi_set_uint16(unsigned char *c, uint16_t val);
             ^
/usr/include/iscsi/scsi-lowlevel.h:809:13: error: inline function
‘scsi_set_uint32’ declared but never defined [-Werror]
 inline void scsi_set_uint32(unsigned char *c, uint32_t val);
             ^
[...]

This has been fixed by upstream libiscsi in version 1.10.0 (see
https://github.com/sahlberg/libiscsi/commit/7692027d6c11 ), but
since we still want to support 1.9.0 for CentOS 7 / RHEL7, we
have to work-around the issue by redefining the "inline" keyword
to use the old "gnu89" mode behavior via "gnu_inline" instead.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 block/iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index a7e8c1f..ff47320 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -49,7 +49,9 @@
 /* Conflict between scsi/utils.h and libiscsi! :( */
 #define SCSI_XFER_NONE ISCSI_XFER_NONE
 #include <iscsi/iscsi.h>
+#define inline __attribute__((gnu_inline))  /* required for libiscsi v1.9.0 */
 #include <iscsi/scsi-lowlevel.h>
+#undef inline
 #undef SCSI_XFER_NONE
 QEMU_BUILD_BUG_ON((int)SCSI_XFER_NONE != (int)ISCSI_XFER_NONE);
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99
  2019-01-14 17:45 [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Thomas Huth
                   ` (2 preceding siblings ...)
  2019-01-14 17:45 ` [Qemu-devel] [PULL v2 25/27] block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
@ 2019-01-15 13:16 ` Peter Maydell
  2019-01-15 14:32   ` Thomas Huth
  3 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2019-01-15 13:16 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Developers, Philippe Mathieu-Daudé, Li Qiang

On Mon, 14 Jan 2019 at 17:45, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi Peter!
>
> The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16:
>
>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000)
>
> are available in the git repository at:
>
>   https://gitlab.com/huth/qemu.git tags/pull-request-2019-01-14v2
>
> for you to fetch changes up to 650db715681ad1a042705484776e1974f288f3d4:
>
>   tests/hexloader-test: Don't pass -nographic to the QEMU under test (2019-01-14 18:21:29 +0100)
>
> ----------------------------------------------------------------
> - Remove deprecated "ivshmem" legacy device
> - Bug fix for vhost-user-test
> - Use more CONFIG Makefile switches for qtests
> - Get rid of global_qtests in some more qtests
> - typedef cleanups
> - Fixes for compiling with Clang
> - Force C standard to gnu99
> ----------------------------------------------------------------

Hi; another compile failure on that ppc64 system, I'm afraid:

/home/pm215/qemu/qemu-seccomp.c:45:1: error: initializer element is not constant
 };
 ^
/home/pm215/qemu/qemu-seccomp.c:45:1: error: (near initialization for
‘sched_setscheduler_arg[0]’)

(I did a quick check with 'make -k' and it looks like there aren't
any more lurking after that one.)

The system libseccomp is libseccomp-2.3.1-3.el7.

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99
  2019-01-15 13:16 ` [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Peter Maydell
@ 2019-01-15 14:32   ` Thomas Huth
  2019-01-15 14:58     ` Daniel P. Berrangé
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2019-01-15 14:32 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Developers, Philippe Mathieu-Daudé,
	Li Qiang, Eduardo Otubo, Daniel P. Berrangé,
	Eric Blake, Markus Armbruster

On 2019-01-15 14:16, Peter Maydell wrote:
> On Mon, 14 Jan 2019 at 17:45, Thomas Huth <thuth@redhat.com> wrote:
>>
>>  Hi Peter!
>>
>> The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16:
>>
>>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000)
>>
>> are available in the git repository at:
>>
>>   https://gitlab.com/huth/qemu.git tags/pull-request-2019-01-14v2
>>
>> for you to fetch changes up to 650db715681ad1a042705484776e1974f288f3d4:
>>
>>   tests/hexloader-test: Don't pass -nographic to the QEMU under test (2019-01-14 18:21:29 +0100)
>>
>> ----------------------------------------------------------------
>> - Remove deprecated "ivshmem" legacy device
>> - Bug fix for vhost-user-test
>> - Use more CONFIG Makefile switches for qtests
>> - Get rid of global_qtests in some more qtests
>> - typedef cleanups
>> - Fixes for compiling with Clang
>> - Force C standard to gnu99
>> ----------------------------------------------------------------
> 
> Hi; another compile failure on that ppc64 system, I'm afraid:
> 
> /home/pm215/qemu/qemu-seccomp.c:45:1: error: initializer element is not constant
>  };
>  ^
> /home/pm215/qemu/qemu-seccomp.c:45:1: error: (near initialization for
> ‘sched_setscheduler_arg[0]’)
> 
> (I did a quick check with 'make -k' and it looks like there aren't
> any more lurking after that one.)
> 
> The system libseccomp is libseccomp-2.3.1-3.el7.

Darn, I think this time it is a compiler bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567

It's only fixed in GCC >= v5.0 :-(

I see two options:

1) Expand the macro manually:

diff --git a/qemu-seccomp.c b/qemu-seccomp.c
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -41,7 +41,7 @@ struct QemuSeccompSyscall {
 };

 const struct scmp_arg_cmp sched_setscheduler_arg[] = {
-    SCMP_A1(SCMP_CMP_NE, SCHED_IDLE)
+    { .arg = 1, .op = SCMP_CMP_NE, .datum_a = SCHED_IDLE }
 };

... then it compiles fine for me in gnu99 mode, too.

2) Scratch the whole idea with gnu99 again ...

Opinions?

 Thomas

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

* Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99
  2019-01-15 14:32   ` Thomas Huth
@ 2019-01-15 14:58     ` Daniel P. Berrangé
  2019-01-15 17:10       ` Markus Armbruster
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel P. Berrangé @ 2019-01-15 14:58 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Peter Maydell, QEMU Developers, Philippe Mathieu-Daudé,
	Li Qiang, Eduardo Otubo, Eric Blake, Markus Armbruster

On Tue, Jan 15, 2019 at 03:32:10PM +0100, Thomas Huth wrote:
> On 2019-01-15 14:16, Peter Maydell wrote:
> > On Mon, 14 Jan 2019 at 17:45, Thomas Huth <thuth@redhat.com> wrote:
> >>
> >>  Hi Peter!
> >>
> >> The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16:
> >>
> >>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000)
> >>
> >> are available in the git repository at:
> >>
> >>   https://gitlab.com/huth/qemu.git tags/pull-request-2019-01-14v2
> >>
> >> for you to fetch changes up to 650db715681ad1a042705484776e1974f288f3d4:
> >>
> >>   tests/hexloader-test: Don't pass -nographic to the QEMU under test (2019-01-14 18:21:29 +0100)
> >>
> >> ----------------------------------------------------------------
> >> - Remove deprecated "ivshmem" legacy device
> >> - Bug fix for vhost-user-test
> >> - Use more CONFIG Makefile switches for qtests
> >> - Get rid of global_qtests in some more qtests
> >> - typedef cleanups
> >> - Fixes for compiling with Clang
> >> - Force C standard to gnu99
> >> ----------------------------------------------------------------
> > 
> > Hi; another compile failure on that ppc64 system, I'm afraid:
> > 
> > /home/pm215/qemu/qemu-seccomp.c:45:1: error: initializer element is not constant
> >  };
> >  ^
> > /home/pm215/qemu/qemu-seccomp.c:45:1: error: (near initialization for
> > ‘sched_setscheduler_arg[0]’)
> > 
> > (I did a quick check with 'make -k' and it looks like there aren't
> > any more lurking after that one.)
> > 
> > The system libseccomp is libseccomp-2.3.1-3.el7.
> 
> Darn, I think this time it is a compiler bug:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567
> 
> It's only fixed in GCC >= v5.0 :-(
> 
> I see two options:
> 
> 1) Expand the macro manually:
> 
> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
> --- a/qemu-seccomp.c
> +++ b/qemu-seccomp.c
> @@ -41,7 +41,7 @@ struct QemuSeccompSyscall {
>  };
> 
>  const struct scmp_arg_cmp sched_setscheduler_arg[] = {
> -    SCMP_A1(SCMP_CMP_NE, SCHED_IDLE)
> +    { .arg = 1, .op = SCMP_CMP_NE, .datum_a = SCHED_IDLE }
>  };
> 
> ... then it compiles fine for me in gnu99 mode, too.
> 
> 2) Scratch the whole idea with gnu99 again ...

I'd prefer 1, since I think its important for us to actually have a
consistent compiler standard to target, even if we have to do some
short terms hacks like the one you show.  As long as a put a comment
next to it, we can revert the hack when we eventually ditch support for the
GCC <= 5.0

Also, I'd probably argue that the seccomp syntax without the macro
is clearer to understand regardless :-)

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99
  2019-01-15 14:58     ` Daniel P. Berrangé
@ 2019-01-15 17:10       ` Markus Armbruster
  0 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2019-01-15 17:10 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Thomas Huth, Eduardo Otubo, Peter Maydell, Li Qiang,
	QEMU Developers, Philippe Mathieu-Daudé

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, Jan 15, 2019 at 03:32:10PM +0100, Thomas Huth wrote:
>> On 2019-01-15 14:16, Peter Maydell wrote:
>> > On Mon, 14 Jan 2019 at 17:45, Thomas Huth <thuth@redhat.com> wrote:
>> >>
>> >>  Hi Peter!
>> >>
>> >> The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16:
>> >>
>> >>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000)
>> >>
>> >> are available in the git repository at:
>> >>
>> >>   https://gitlab.com/huth/qemu.git tags/pull-request-2019-01-14v2
>> >>
>> >> for you to fetch changes up to 650db715681ad1a042705484776e1974f288f3d4:
>> >>
>> >>   tests/hexloader-test: Don't pass -nographic to the QEMU under test (2019-01-14 18:21:29 +0100)
>> >>
>> >> ----------------------------------------------------------------
>> >> - Remove deprecated "ivshmem" legacy device
>> >> - Bug fix for vhost-user-test
>> >> - Use more CONFIG Makefile switches for qtests
>> >> - Get rid of global_qtests in some more qtests
>> >> - typedef cleanups
>> >> - Fixes for compiling with Clang
>> >> - Force C standard to gnu99
>> >> ----------------------------------------------------------------
>> > 
>> > Hi; another compile failure on that ppc64 system, I'm afraid:
>> > 
>> > /home/pm215/qemu/qemu-seccomp.c:45:1: error: initializer element is not constant
>> >  };
>> >  ^
>> > /home/pm215/qemu/qemu-seccomp.c:45:1: error: (near initialization for
>> > ‘sched_setscheduler_arg[0]’)
>> > 
>> > (I did a quick check with 'make -k' and it looks like there aren't
>> > any more lurking after that one.)
>> > 
>> > The system libseccomp is libseccomp-2.3.1-3.el7.
>> 
>> Darn, I think this time it is a compiler bug:
>> 
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567
>> 
>> It's only fixed in GCC >= v5.0 :-(
>> 
>> I see two options:
>> 
>> 1) Expand the macro manually:
>> 
>> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
>> --- a/qemu-seccomp.c
>> +++ b/qemu-seccomp.c
>> @@ -41,7 +41,7 @@ struct QemuSeccompSyscall {
>>  };
>> 
>>  const struct scmp_arg_cmp sched_setscheduler_arg[] = {
>> -    SCMP_A1(SCMP_CMP_NE, SCHED_IDLE)
>> +    { .arg = 1, .op = SCMP_CMP_NE, .datum_a = SCHED_IDLE }
>>  };
>> 
>> ... then it compiles fine for me in gnu99 mode, too.
>> 
>> 2) Scratch the whole idea with gnu99 again ...
>
> I'd prefer 1, since I think its important for us to actually have a
> consistent compiler standard to target, even if we have to do some
> short terms hacks like the one you show.  As long as a put a comment
> next to it, we can revert the hack when we eventually ditch support for the
> GCC <= 5.0

Yes, nailing down the language dialect is worth a few temporary hacks.

> Also, I'd probably argue that the seccomp syntax without the macro
> is clearer to understand regardless :-)

Me too, except SCMP_A1 & friends come from /usr/include/seccomp.h.

Expanding the macro until we upgrade compilers feels tolerable.  Any
better ideas?

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

end of thread, other threads:[~2019-01-15 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 17:45 [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Thomas Huth
2019-01-14 17:45 ` [Qemu-devel] [PULL v2 20/27] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Thomas Huth
2019-01-14 17:45 ` [Qemu-devel] [PULL v2 21/27] ui/console: Remove PixelFormat " Thomas Huth
2019-01-14 17:45 ` [Qemu-devel] [PULL v2 25/27] block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
2019-01-15 13:16 ` [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99 Peter Maydell
2019-01-15 14:32   ` Thomas Huth
2019-01-15 14:58     ` Daniel P. Berrangé
2019-01-15 17:10       ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.