diff mbox series

modules-test: fix const cast

Message ID 1566495734-23297-1-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series modules-test: fix const cast | expand

Commit Message

Paolo Bonzini Aug. 22, 2019, 5:42 p.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/modules-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc-André Lureau Aug. 23, 2019, 7:13 a.m. UTC | #1
On Thu, Aug 22, 2019 at 9:42 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  tests/modules-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index 3aef0e5..a8118e9 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -4,7 +4,7 @@
>  static void test_modules_load(const void *data)
>  {
>      QTestState *qts;
> -    const char **args = data;
> +    const char **args = (const char **)data;
>
>      qts = qtest_init(NULL);
>      qtest_module_load(qts, args[0], args[1]);
> --
> 1.8.3.1
>
>
Thomas Huth Aug. 23, 2019, 9:06 a.m. UTC | #2
On 8/22/19 7:42 PM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/modules-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index 3aef0e5..a8118e9 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -4,7 +4,7 @@
>  static void test_modules_load(const void *data)
>  {
>      QTestState *qts;
> -    const char **args = data;
> +    const char **args = (const char **)data;
>  
>      qts = qtest_init(NULL);
>      qtest_module_load(qts, args[0], args[1]);

Why did nobody notice this before? ... some additional words in the
patch description would be fine.

Anyway:

Reviewed-by: Thomas Huth <thuth@redhat.com>
Peter Maydell Aug. 23, 2019, 9:11 a.m. UTC | #3
On Fri, 23 Aug 2019 at 10:06, Thomas Huth <thuth@redhat.com> wrote:
>
> On 8/22/19 7:42 PM, Paolo Bonzini wrote:
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  tests/modules-test.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/modules-test.c b/tests/modules-test.c
> > index 3aef0e5..a8118e9 100644
> > --- a/tests/modules-test.c
> > +++ b/tests/modules-test.c
> > @@ -4,7 +4,7 @@
> >  static void test_modules_load(const void *data)
> >  {
> >      QTestState *qts;
> > -    const char **args = data;
> > +    const char **args = (const char **)data;
> >
> >      qts = qtest_init(NULL);
> >      qtest_module_load(qts, args[0], args[1]);
>
> Why did nobody notice this before? ... some additional words in the
> patch description would be fine.

It got into the tree because I don't have an --enable-modules
config in my set of things I run before merging. It's in
the Travis build set, but that only runs after the fact.

thanks
-- PMM
Paolo Bonzini Aug. 23, 2019, 12:04 p.m. UTC | #4
On 23/08/19 11:11, Peter Maydell wrote:
> On Fri, 23 Aug 2019 at 10:06, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 8/22/19 7:42 PM, Paolo Bonzini wrote:
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> ---
>>>  tests/modules-test.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/modules-test.c b/tests/modules-test.c
>>> index 3aef0e5..a8118e9 100644
>>> --- a/tests/modules-test.c
>>> +++ b/tests/modules-test.c
>>> @@ -4,7 +4,7 @@
>>>  static void test_modules_load(const void *data)
>>>  {
>>>      QTestState *qts;
>>> -    const char **args = data;
>>> +    const char **args = (const char **)data;
>>>
>>>      qts = qtest_init(NULL);
>>>      qtest_module_load(qts, args[0], args[1]);
>>
>> Why did nobody notice this before? ... some additional words in the
>> patch description would be fine.
> 
> It got into the tree because I don't have an --enable-modules
> config in my set of things I run before merging. It's in
> the Travis build set, but that only runs after the fact.

Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
not built as module" to qemu.git directly?

Thanks in advance,

Paolo
Peter Maydell Aug. 23, 2019, 12:07 p.m. UTC | #5
On Fri, 23 Aug 2019 at 13:04, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 23/08/19 11:11, Peter Maydell wrote:
> > On Fri, 23 Aug 2019 at 10:06, Thomas Huth <thuth@redhat.com> wrote:
> >>
> >> On 8/22/19 7:42 PM, Paolo Bonzini wrote:
> >>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >>> ---
> >>>  tests/modules-test.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/tests/modules-test.c b/tests/modules-test.c
> >>> index 3aef0e5..a8118e9 100644
> >>> --- a/tests/modules-test.c
> >>> +++ b/tests/modules-test.c
> >>> @@ -4,7 +4,7 @@
> >>>  static void test_modules_load(const void *data)
> >>>  {
> >>>      QTestState *qts;
> >>> -    const char **args = data;
> >>> +    const char **args = (const char **)data;
> >>>
> >>>      qts = qtest_init(NULL);
> >>>      qtest_module_load(qts, args[0], args[1]);
> >>
> >> Why did nobody notice this before? ... some additional words in the
> >> patch description would be fine.
> >
> > It got into the tree because I don't have an --enable-modules
> > config in my set of things I run before merging. It's in
> > the Travis build set, but that only runs after the fact.
>
> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
> not built as module" to qemu.git directly?

Is the other one also needed as a build fix ?

I was planning to apply this one directly, yes, but I was
waiting to see if you and Thomas wanted to agree any change
to the commit message.

thanks
-- PMM
Paolo Bonzini Aug. 23, 2019, 12:10 p.m. UTC | #6
On 23/08/19 14:07, Peter Maydell wrote:
>> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
>> not built as module" to qemu.git directly?
> Is the other one also needed as a build fix ?

Yes, otherwise the test fails (it didn't fail in the meson tree).

> I was planning to apply this one directly, yes, but I was
> waiting to see if you and Thomas wanted to agree any change
> to the commit message.

Just "Fix build failure with --enable-modules" would be as verbose as it
needs to be, I guess.

Paolo
Thomas Huth Aug. 23, 2019, 12:11 p.m. UTC | #7
On 8/23/19 2:10 PM, Paolo Bonzini wrote:
> On 23/08/19 14:07, Peter Maydell wrote:
>>> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
>>> not built as module" to qemu.git directly?
>> Is the other one also needed as a build fix ?
> 
> Yes, otherwise the test fails (it didn't fail in the meson tree).
> 
>> I was planning to apply this one directly, yes, but I was
>> waiting to see if you and Thomas wanted to agree any change
>> to the commit message.
> 
> Just "Fix build failure with --enable-modules" would be as verbose as it
> needs to be, I guess.

Fine for me.

 Thomas
Miroslav Rezanina Aug. 23, 2019, 12:32 p.m. UTC | #8
On Thu, Aug 22, 2019 at 07:42:13PM +0200, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/modules-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index 3aef0e5..a8118e9 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -4,7 +4,7 @@
>  static void test_modules_load(const void *data)
>  {
>      QTestState *qts;
> -    const char **args = data;
> +    const char **args = (const char **)data;
>  
>      qts = qtest_init(NULL);
>      qtest_module_load(qts, args[0], args[1]);
> -- 
> 1.8.3.1
> 
> 

Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
Peter Maydell Aug. 23, 2019, 2:13 p.m. UTC | #9
On Thu, 22 Aug 2019 at 18:42, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/modules-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index 3aef0e5..a8118e9 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -4,7 +4,7 @@
>  static void test_modules_load(const void *data)
>  {
>      QTestState *qts;
> -    const char **args = data;
> +    const char **args = (const char **)data;
>
>      qts = qtest_init(NULL);
>      qtest_module_load(qts, args[0], args[1]);
> --
> 1.8.3.1

Applied to master as a build fix, thanks.

-- PMM
Peter Maydell Aug. 27, 2019, noon UTC | #10
On Fri, 23 Aug 2019 at 13:10, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 23/08/19 14:07, Peter Maydell wrote:
> >> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
> >> not built as module" to qemu.git directly?
> > Is the other one also needed as a build fix ?
>
> Yes, otherwise the test fails (it didn't fail in the meson tree).

Both this fix and the ui-spice-app one are now in master, but
the 'enable-modules' Travis build still seems to be consistently
failing -- could somebody take a look, please?

thanks
-- PMM
Marc-André Lureau Aug. 27, 2019, 1:38 p.m. UTC | #11
Hi

On Tue, Aug 27, 2019 at 4:02 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 23 Aug 2019 at 13:10, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > On 23/08/19 14:07, Peter Maydell wrote:
> > >> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
> > >> not built as module" to qemu.git directly?
> > > Is the other one also needed as a build fix ?
> >
> > Yes, otherwise the test fails (it didn't fail in the meson tree).
>
> Both this fix and the ui-spice-app one are now in master, but
> the 'enable-modules' Travis build still seems to be consistently
> failing -- could somebody take a look, please?
>

I am looking at, it seems to be related to default machine

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64
QTEST_QEMU_IMG=qemu-img tests/modules-test -m=quick -k --tap <
/dev/null | ./scripts/tap-driver.pl --test-name="modules-test"

qemu-system-aarch64: -machine accel=qtest: No machine specified, and
there is no default

Use -machine help to list supported machines

  TEST    iotest-qcow2: 159

socket_accept failed: Resource temporarily unavailable

**

ERROR:tests/libqtest.c:268:qtest_init_without_qmp_handshake: assertion
failed: (s->fd >= 0 && s->qmp_fd >= 0)

tests/libqtest.c:137: kill_qemu() tried to terminate QEMU process but
encountered exit status 1

Aborted (core dumped)

ERROR - too few tests run (expected 9, got 0)

/home/travis/build/elmarco/qemu/tests/Makefile.include:900: recipe for
target 'check-qtest-arm' failed
Peter Maydell Aug. 27, 2019, 2:26 p.m. UTC | #12
On Tue, 27 Aug 2019 at 14:39, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Tue, Aug 27, 2019 at 4:02 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Fri, 23 Aug 2019 at 13:10, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > >
> > > On 23/08/19 14:07, Peter Maydell wrote:
> > > >> Are you going to apply this and "[PATCH] modules-test: ui-spice-app is
> > > >> not built as module" to qemu.git directly?
> > > > Is the other one also needed as a build fix ?
> > >
> > > Yes, otherwise the test fails (it didn't fail in the meson tree).
> >
> > Both this fix and the ui-spice-app one are now in master, but
> > the 'enable-modules' Travis build still seems to be consistently
> > failing -- could somebody take a look, please?
> >
>
> I am looking at, it seems to be related to default machine
>
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
> QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64
> QTEST_QEMU_IMG=qemu-img tests/modules-test -m=quick -k --tap <
> /dev/null | ./scripts/tap-driver.pl --test-name="modules-test"
>
> qemu-system-aarch64: -machine accel=qtest: No machine specified, and
> there is no default
>
> Use -machine help to list supported machines

Yeah, you need a machine type. If you need to run code on the
QEMU instance you need to know what machine type you're expecting;
if you aren't and you're just doing qtest stuff then -machine none
may be appropriate.

thanks
-- PMM
diff mbox series

Patch

diff --git a/tests/modules-test.c b/tests/modules-test.c
index 3aef0e5..a8118e9 100644
--- a/tests/modules-test.c
+++ b/tests/modules-test.c
@@ -4,7 +4,7 @@ 
 static void test_modules_load(const void *data)
 {
     QTestState *qts;
-    const char **args = data;
+    const char **args = (const char **)data;
 
     qts = qtest_init(NULL);
     qtest_module_load(qts, args[0], args[1]);