[Qemu-devel] [PATCH] modules-test: fix const cast

Paolo Bonzini posted 1 patch 4 years, 7 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1566495734-23297-1-git-send-email-pbonzini@redhat.com
Maintainers: Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>
tests/modules-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Paolo Bonzini 4 years, 7 months ago
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


Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Marc-André Lureau 4 years, 7 months ago
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
>
>


-- 
Marc-André Lureau

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Thomas Huth 4 years, 7 months ago
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>

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Peter Maydell 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Paolo Bonzini 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Peter Maydell 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Paolo Bonzini 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Thomas Huth 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Peter Maydell 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Marc-André Lureau 4 years, 7 months ago
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



-- 
Marc-André Lureau

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Peter Maydell 4 years, 7 months ago
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

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Miroslav Rezanina 4 years, 7 months ago
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>

Re: [Qemu-devel] [PATCH] modules-test: fix const cast
Posted by Peter Maydell 4 years, 7 months ago
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