From: Fabiano Rosas <farosas@suse.de>
To: Het Gala <het.gala@nutanix.com>, Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com,
thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH 1/2] tests/qtest/migration: Ignore if socket-address is missing to avoid crash below
Date: Wed, 20 Mar 2024 10:19:38 -0300 [thread overview]
Message-ID: <87sf0lm45x.fsf@suse.de> (raw)
In-Reply-To: <56ed1452-87ed-4cfb-912f-b15bc74609c1@nutanix.com>
Het Gala <het.gala@nutanix.com> writes:
> On 20/03/24 3:27 am, Peter Xu wrote:
>> On Tue, Mar 19, 2024 at 08:48:39PM +0000, Het Gala wrote:
>>> 'object' can return NULL if there is no socket-address, such as with a
>>> file migration. Then the visitor code below fails and the test crashes.
>>>
>>> Ignore and return NULL when socket-address is missing in the reply so
>>> we don't break future tests that use a non-socket type.
>> Hmm, this patch isn't as clear to me. Even if this can return NULL now,
>> it'll soon crash at some later point, no?
> It won't crash IMO, the next function SocketAddress_to_str for a non-socket
> type would return an proper error ?
>> IMHO such patch is more suitable to be included in the same patch where
>> such new tests will be introduced, then we're addressing some real test
>> code changes that will work, rather than worrying on what will happen in
>> the future (and as I mentioned, i don't think it fully resolved that either..)
>>
>> Thanks,
> Maybe, Fabiano can pick this patch, and add along file migration qtests
> patch ?
Yep.
>>> Suggested-by: Fabiano Rosas<farosas@suse.de>
>>> Signed-off-by: Het Gala<het.gala@nutanix.com>
>>> ---
>>> tests/qtest/migration-helpers.c | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
>>> index b2a90469fb..fb7156f09a 100644
>>> --- a/tests/qtest/migration-helpers.c
>>> +++ b/tests/qtest/migration-helpers.c
>>> @@ -90,6 +90,10 @@ static SocketAddress *migrate_get_socket_address(QTestState *who)
>>> QObject *object;
>>>
>>> rsp = migrate_query(who);
>>> +
>>> + if (!qdict_haskey(rsp, "socket-address")) {
>>> + return NULL;
>>> + }
>>> object = qdict_get(rsp, "socket-address");
>>>
>>> iv = qobject_input_visitor_new(object);
>>> --
>>> 2.22.3
>>>
> Regards,
> Het Gala
next prev parent reply other threads:[~2024-03-20 13:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 20:48 [PATCH 1/2] tests/qtest/migration: Ignore if socket-address is missing to avoid crash below Het Gala
2024-03-19 20:48 ` [PATCH 2/2] tests/qtest/migration: Fix typo for vsock in SocketAddress_to_str Het Gala
2024-03-19 21:57 ` Peter Xu
2024-03-19 20:52 ` [PATCH 1/2] tests/qtest/migration: Ignore if socket-address is missing to avoid crash below Het Gala
2024-03-19 21:57 ` Peter Xu
2024-03-20 5:17 ` Het Gala
2024-03-20 13:15 ` Peter Xu
2024-03-20 13:19 ` Fabiano Rosas [this message]
2024-03-20 14:01 ` Het Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sf0lm45x.fsf@suse.de \
--to=farosas@suse.de \
--cc=het.gala@nutanix.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.