All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH] tests/qtest: netdev: test stream and dgram backends
Date: Fri, 4 Nov 2022 08:15:33 -0400	[thread overview]
Message-ID: <20221104081513-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <680deee3-ccf7-b32c-2dfe-189ab02463d4@redhat.com>

On Fri, Nov 04, 2022 at 11:58:29AM +0100, Laurent Vivier wrote:
> On 11/4/22 10:41, Daniel P. Berrangé wrote:
> ...
> > > +static void test_stream_unix(void)
> > > +{
> > > +    QTestState *qts0, *qts1;
> > > +    char *expect;
> > > +    gchar *path;
> > > +    int ret;
> > > +
> > > +    ret = g_file_open_tmp("netdev-XXXXXX", &path, NULL);
> > > +    g_assert_true(ret >= 0);
> > > +    close(ret);
> > 
> > This is creating a zero length plain file, and then paassing
> > that as a path for the UNIX socket.
> > 
> > This is pretty dubious and only works because the code will
> > be doing 'unlink' on the path. Just delete this as there's
> > no reason to pre-create anything on disk for UNIX sockets.
> > 
> 
> The idea here is to generate a path for the socket and to be sure this path
> is actually not already in use.

if you unlink before use then it's racy though.

> The same for the abstract one, how to be sure we are not running the same
> test concurrently and select a different unix name?
> 
> I'm going to address all your comments and send a new version of the patch.
> 
> Thanks,
> Laurent



  parent reply	other threads:[~2022-11-04 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  9:22 [PATCH] tests/qtest: netdev: test stream and dgram backends Laurent Vivier
2022-11-04  9:41 ` Daniel P. Berrangé
2022-11-04 10:58   ` Laurent Vivier
2022-11-04 11:13     ` Daniel P. Berrangé
2022-11-04 12:15     ` Michael S. Tsirkin [this message]
2022-11-04 13:24       ` Laurent Vivier

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=20221104081513-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=berrange@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --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.