qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v4] tests/qtest: netdev: test stream and dgram backends
Date: Wed, 4 Jan 2023 15:36:10 +0100	[thread overview]
Message-ID: <dfcd52a8-b5fa-6ad6-ae69-317f3dab664a@redhat.com> (raw)
In-Reply-To: <f59bd50b-abf7-88ae-7c09-e5c204e08e9a@redhat.com>

On 03/01/2023 15.46, Laurent Vivier wrote:
> On 1/3/23 15:08, Thomas Huth wrote:
>> On 03/01/2023 12.00, Laurent Vivier wrote:
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>>> ---
>>>
>>> Notes:
>>>      v4:
>>>        - rework EXPECT_STATE()
>>>        - use g_dir_make_tmp()
>>>      v3:
>>>      - Add "-M none" to avoid error:
>>>        "No machine specified, and there is no default"
>>>      v2:
>>>      - Fix ipv6 free port allocation
>>>      - Check for IPv4, IPv6, AF_UNIX
>>>      - Use g_mkdtemp() rather than g_file_open_tmp()
>>>      - Use socketpair() in test_stream_fd()
>>>      v1: compared to v14 of "qapi: net: add unix socket type support to 
>>> netdev backend":
>>>      - use IP addresses 127.0.0.1 and ::1 rather than localhost
>>>
>>>   tests/qtest/meson.build     |   2 +
>>>   tests/qtest/netdev-socket.c | 434 ++++++++++++++++++++++++++++++++++++
>>>   2 files changed, 436 insertions(+)
>>>   create mode 100644 tests/qtest/netdev-socket.c
>> [...]
>>> +int main(int argc, char **argv)
>>> +{
>>> +    int ret;
>>> +    bool has_ipv4, has_ipv6, has_afunix;
>>> +    g_autoptr(GError) err = NULL;
>>> +
>>> +    g_test_init(&argc, &argv, NULL);
>>> +
>>> +    if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) {
>>> +        g_printerr("socket_check_protocol_support() failed\n");
>>> +        goto end;
>>> +    }
>>> +
>>> +    tmpdir = g_dir_make_tmp("netdev-socket.XXXXXX", &err);
>>> +    if (tmpdir == NULL) {
>>> +        g_error("Can't create temporary directory in %s: %s",
>>> +                g_get_tmp_dir(), err->message);
>>
>> Should there also be a "goto end" here?
> 
> No, g_error() is fatal.
> 
> https://docs.gtk.org/glib/func.error.html

Ah, alright, then this is fine, thanks for the clarification!

  Thomas



  reply	other threads:[~2023-01-04 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 11:00 [PATCH v4] tests/qtest: netdev: test stream and dgram backends Laurent Vivier
2023-01-03 14:08 ` Thomas Huth
2023-01-03 14:46   ` Laurent Vivier
2023-01-04 14:36     ` Thomas Huth [this message]
2023-01-04 14:38 ` Thomas Huth
2023-01-04 15:41   ` Philippe Mathieu-Daudé
2023-01-04 18:37 ` Thomas Huth
2023-01-04 20:10   ` Laurent Vivier
2023-01-05  6:24     ` Thomas Huth

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=dfcd52a8-b5fa-6ad6-ae69-317f3dab664a@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 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).