<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt, branch 2024_08_06.ee36266</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>log, passt: Keep printing to stderr when passt is running in foreground</title>
<updated>2024-08-06T13:03:48+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-08-06T12:07:37+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=ee36266a55478672ad2c5f4efbd6ca0bef3d37cd'/>
<id>ee36266a55478672ad2c5f4efbd6ca0bef3d37cd</id>
<content type='text'>
There are two cases where we want to stop printing to stderr: if it's
closed, and if pasta spawned a shell (and --debug wasn't given).

But if passt is running in foreground, we currently stop to report any
message, even error messages, once we're ready, as reported by
Laurent, because we set the log_runtime flag, which we use to indicate
we're ready, regardless of whether we're running in foreground or not.

Turn that flag (back) to log_stderr, and set it only when we really
want to stop printing to stderr.

Reported-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Fixes: afd9cdc9bb48 ("log, passt: Always print to stderr before initialisation is complete")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two cases where we want to stop printing to stderr: if it's
closed, and if pasta spawned a shell (and --debug wasn't given).

But if passt is running in foreground, we currently stop to report any
message, even error messages, once we're ready, as reported by
Laurent, because we set the log_runtime flag, which we use to indicate
we're ready, regardless of whether we're running in foreground or not.

Turn that flag (back) to log_stderr, and set it only when we really
want to stop printing to stderr.

Reported-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Fixes: afd9cdc9bb48 ("log, passt: Always print to stderr before initialisation is complete")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp_splice: Fix side in OUT_WAIT flag setting</title>
<updated>2024-08-06T13:03:31+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-08-06T11:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=3a082c4ecb4b50d44aff21a1390826cd3a3d077e'/>
<id>3a082c4ecb4b50d44aff21a1390826cd3a3d077e</id>
<content type='text'>
If the "from" (input) side for a given transfer is 0, and we can't
complete the write right away, what we need to be waiting for is for
output readiness on side 1, not 0, and the other way around as well.

This causes random transfer failures for local TCP connections,
depending if we ever need to wait for output readiness.

Reported-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Link: https://github.com/containers/podman/issues/23517
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Tested-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the "from" (input) side for a given transfer is 0, and we can't
complete the write right away, what we need to be waiting for is for
output readiness on side 1, not 0, and the other way around as well.

This causes random transfer failures for local TCP connections,
depending if we ever need to wait for output readiness.

Reported-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Link: https://github.com/containers/podman/issues/23517
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Tested-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>util: Use unsigned (size_t) value for iov length</title>
<updated>2024-08-06T13:01:46+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2024-08-06T01:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=031df332e98d507ad153fc54ea8c4b7109b7dabf'/>
<id>031df332e98d507ad153fc54ea8c4b7109b7dabf</id>
<content type='text'>
The "correct" type for the length of an IOV is unclear: writev() and
readv() use an int, but sendmsg() and recvmsg() use a size_t.  Using the
unsigned size_t has some advantages, though, and it makes more sense for
the case of write_remainder.  Using size_t throughout here means we don't
have a signed vs. unsigned comparison, and we don't have to deal with
the case of iov_skip_bytes() returning a value which becomes negative
when assigned to an integer.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "correct" type for the length of an IOV is unclear: writev() and
readv() use an int, but sendmsg() and recvmsg() use a size_t.  Using the
unsigned size_t has some advantages, though, and it makes more sense for
the case of write_remainder.  Using size_t throughout here means we don't
have a signed vs. unsigned comparison, and we don't have to deal with
the case of iov_skip_bytes() returning a value which becomes negative
when assigned to an integer.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp_flow: move all udp_flow functions to udp_flow.c</title>
<updated>2024-08-05T15:38:17+00:00</updated>
<author>
<name>Laurent Vivier</name>
<email>lvivier@redhat.com</email>
</author>
<published>2024-08-02T16:10:36+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=e877f905e5fc5900c2c8dd9378e39705b21aec82'/>
<id>e877f905e5fc5900c2c8dd9378e39705b21aec82</id>
<content type='text'>
No code change.

They need to be exported to be available by the vhost-user version of
passt.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No code change.

They need to be exported to be available by the vhost-user version of
passt.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp_flow: Remove udp_meta_t from the parameters of udp_flow_from_sock()</title>
<updated>2024-08-05T15:37:53+00:00</updated>
<author>
<name>Laurent Vivier</name>
<email>lvivier@redhat.com</email>
</author>
<published>2024-08-02T16:10:35+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=623ceb1f2b9051e3c6b34c99463a22a558b74674'/>
<id>623ceb1f2b9051e3c6b34c99463a22a558b74674</id>
<content type='text'>
To be used with the vhost-user version of udp.c, we need to export the
udp_flow functions. To avoid to export udp_meta_t too that is specific
to the socket version of udp.c, don't pass udp_meta_t to it,
but the only needed field, s_in.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To be used with the vhost-user version of udp.c, we need to export the
udp_flow functions. To avoid to export udp_meta_t too that is specific
to the socket version of udp.c, don't pass udp_meta_t to it,
but the only needed field, s_in.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>log: Make logfile_write() private</title>
<updated>2024-08-05T13:03:33+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2024-07-29T04:22:59+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a5bbefa6fb799ba009b9704bb440e22778cd5d51'/>
<id>a5bbefa6fb799ba009b9704bb440e22778cd5d51</id>
<content type='text'>
logfile_write() is not used outside log.c, nor should it be.  It should
only be used externall via the general logging functions.  Make it static
in log.c.  To avoid forward declarations this requires moving a bunch of
functions earlier in the file.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
logfile_write() is not used outside log.c, nor should it be.  It should
only be used externall via the general logging functions.  Make it static
in log.c.  To avoid forward declarations this requires moving a bunch of
functions earlier in the file.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pasta: Save errno on signal handler entry, restore on return when needed</title>
<updated>2024-08-05T13:02:36+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-08-02T13:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=f30ed68c52734b549304f808b780972f93b0515d'/>
<id>f30ed68c52734b549304f808b780972f93b0515d</id>
<content type='text'>
Ed reported this:

  # Error: pasta failed with exit code 1:
  # Couldn't drop cap 3 from bounding set
  # : No child processes

in a Podman CI run with tests being run in parallel. The error message
itself, by the way, is fixed by commit 1cd773081f12 ("log: Drop
newlines in the middle of the perror()-like messages"), but how can we
possibly get ECHILD as failure code for prctl()?

Well, we don't, but if we exit early enough, pasta_child_handler()
might run before we're even done with isolation steps, and it calls
waitid(), which sets errno. We need to restore it before returning
from the signal handler (if we return after calling functions that
might set it), as signal-safety(7) also implies:

       Fetching and setting the value of errno is async-signal-safe
       provided that the signal handler saves errno on entry and
       restores its value before returning.

Eventually, we'll probably need to switch to signalfd(2) the day we
want to implement multithreading, but this will do for the moment.

Reported-by: Ed Santiago &lt;santiago@redhat.com&gt;
Link: https://github.com/containers/podman/issues/23478
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ed reported this:

  # Error: pasta failed with exit code 1:
  # Couldn't drop cap 3 from bounding set
  # : No child processes

in a Podman CI run with tests being run in parallel. The error message
itself, by the way, is fixed by commit 1cd773081f12 ("log: Drop
newlines in the middle of the perror()-like messages"), but how can we
possibly get ECHILD as failure code for prctl()?

Well, we don't, but if we exit early enough, pasta_child_handler()
might run before we're even done with isolation steps, and it calls
waitid(), which sets errno. We need to restore it before returning
from the signal handler (if we return after calling functions that
might set it), as signal-safety(7) also implies:

       Fetching and setting the value of errno is async-signal-safe
       provided that the signal handler saves errno on entry and
       restores its value before returning.

Eventually, we'll probably need to switch to signalfd(2) the day we
want to implement multithreading, but this will do for the moment.

Reported-by: Ed Santiago &lt;santiago@redhat.com&gt;
Link: https://github.com/containers/podman/issues/23478
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pasta: modify hostname when detaching new namespace</title>
<updated>2024-07-30T15:27:43+00:00</updated>
<author>
<name>Danish Prakash</name>
<email>contact@danishpraka.sh</email>
</author>
<published>2024-07-30T06:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=0149d11cc5043d618cf4a6e6e8201d5718836dd2'/>
<id>0149d11cc5043d618cf4a6e6e8201d5718836dd2</id>
<content type='text'>
When invoking pasta without any arguments, it's difficult
to tell whether we are in the new namespace or not leaving
users a bit confused. This change modifies the host namespace
to add a prefix "pasta-" to make it a bit more obvious.

Signed-off-by: Danish Prakash &lt;contact@danishpraka.sh&gt;
[sbrivio: coding style fixes]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When invoking pasta without any arguments, it's difficult
to tell whether we are in the new namespace or not leaving
users a bit confused. This change modifies the host namespace
to add a prefix "pasta-" to make it a bit more obvious.

Signed-off-by: Danish Prakash &lt;contact@danishpraka.sh&gt;
[sbrivio: coding style fixes]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typo in README file</title>
<updated>2024-07-29T17:02:35+00:00</updated>
<author>
<name>AbdAlRahman Gad</name>
<email>abdobngad@gmail.com</email>
</author>
<published>2024-07-29T02:20:06+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=8fae3b73cb1451f766037583c02d86971502f5eb'/>
<id>8fae3b73cb1451f766037583c02d86971502f5eb</id>
<content type='text'>
- remove duplicated 'the' in the 'Services' section

Signed-off-by: AbdAlRahman Gad &lt;abdobngad@gmail.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- remove duplicated 'the' in the 'Services' section

Signed-off-by: AbdAlRahman Gad &lt;abdobngad@gmail.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fedora/rpkg: List myself as author for changelog entries</title>
<updated>2024-07-26T14:40:41+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-07-26T14:40:41+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=f87b11c7be735d9d8d5267ae575d890b4226fb02'/>
<id>f87b11c7be735d9d8d5267ae575d890b4226fb02</id>
<content type='text'>
...instead of the latest author for contrib/fedora.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
...instead of the latest author for contrib/fedora.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
