<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/include/net, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/include/net?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/include/net?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-11-27T18:36:17+00:00</updated>
<entry>
<title>Add G_GNUC_PRINTF to function qemu_set_info_str and fix related issues</title>
<updated>2022-11-27T18:36:17+00:00</updated>
<author>
<name>Stefan Weil via</name>
</author>
<published>2022-11-26T15:25:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=ac149498215809bfb5c0ddce1953519fbfda5004'/>
<id>urn:sha1:ac149498215809bfb5c0ddce1953519fbfda5004</id>
<content type='text'>
With the G_GNUC_PRINTF function attribute the compiler detects
two potential insecure format strings:

../../../net/stream.c:248:31: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    qemu_set_info_str(&amp;s-&gt;nc, uri);
                              ^~~
../../../net/stream.c:322:31: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    qemu_set_info_str(&amp;s-&gt;nc, uri);
                              ^~~

There are also two other warnings:

../../../net/socket.c:182:35: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  182 |         qemu_set_info_str(&amp;s-&gt;nc, "");
      |                                   ^~
../../../net/stream.c:170:35: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  170 |         qemu_set_info_str(&amp;s-&gt;nc, "");

Reviewed-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Stefan Weil &lt;sw@weilnetz.de&gt;
Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Message-Id: &lt;20221126152507.283271-7-sw@weilnetz.de&gt;
</content>
</entry>
<entry>
<title>vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()</title>
<updated>2022-11-07T18:12:20+00:00</updated>
<author>
<name>Kangjie Xu</name>
</author>
<published>2022-10-17T09:25:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=10f8a115a862045a836932c5d519a848dda5d461'/>
<id>urn:sha1:10f8a115a862045a836932c5d519a848dda5d461</id>
<content type='text'>
Introduce vhost_net_virtqueue_restart(), which can restart the
specific virtqueue when the vhost net started running before.
If it fails to restart the virtqueue, the device will be stopped.

Here we do not reuse vhost_net_start_one() or vhost_dev_start()
because they work at queue pair level. The mem table and features
do not change, so we can call the vhost_virtqueue_start() to
restart a specific queue.

This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.

Signed-off-by: Kangjie Xu &lt;kangjie.xu@linux.alibaba.com&gt;
Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;20221017092558.111082-11-xuanzhuo@linux.alibaba.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()</title>
<updated>2022-11-07T18:12:20+00:00</updated>
<author>
<name>Kangjie Xu</name>
</author>
<published>2022-10-17T09:25:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c2daa08e1713c4799487bae6daf5d41e024ff736'/>
<id>urn:sha1:c2daa08e1713c4799487bae6daf5d41e024ff736</id>
<content type='text'>
Introduce vhost_virtqueue_reset(), which can reset the specific
virtqueue in the device. Then it will unmap vrings and the desc
of the virtqueue.

Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(),
because they work at queue pair level. We do not use
vhost_virtqueue_stop() because it may stop the device in the
backend.

This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.

Furthermore, we do not need net-&gt;nc-&gt;info-&gt;poll() because
it enables userspace datapath and we want to stop all
datapaths for this reset virtqueue here.

Signed-off-by: Kangjie Xu &lt;kangjie.xu@linux.alibaba.com&gt;
Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;20221017092558.111082-10-xuanzhuo@linux.alibaba.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: introduce qemu_set_info_str() function</title>
<updated>2022-10-28T05:28:52+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2022-10-21T09:09:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=53b85d9574f3c162c0aadbd988f95e207d4c6e31'/>
<id>urn:sha1:53b85d9574f3c162c0aadbd988f95e207d4c6e31</id>
<content type='text'>
Embed the setting of info_str in a function.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: net: introduce a way to bypass qemu_opts_parse_noisily()</title>
<updated>2022-10-28T05:28:52+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2022-10-21T09:09:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f3eedcddba36dddfb7769a8c96a0f710e894ffc0'/>
<id>urn:sha1:f3eedcddba36dddfb7769a8c96a0f710e894ffc0</id>
<content type='text'>
As qemu_opts_parse_noisily() flattens the QAPI structures ("type" field
of Netdev structure can collides with "type" field of SocketAddress),
we introduce a way to bypass qemu_opts_parse_noisily() and use directly
visit_type_Netdev() to parse the backend parameters.

More details from Markus:

qemu_init() passes the argument of -netdev, -nic, and -net to
net_client_parse().

net_client_parse() parses with qemu_opts_parse_noisily(), passing
QemuOptsList qemu_netdev_opts for -netdev, qemu_nic_opts for -nic, and
qemu_net_opts for -net.  Their desc[] are all empty, which means any
keys are accepted.  The result of the parse (a QemuOpts) is stored in
the QemuOptsList.

Note that QemuOpts is flat by design.  In some places, we layer non-flat
on top using dotted keys convention, but not here.

net_init_clients() iterates over the stored QemuOpts, and passes them to
net_init_netdev(), net_param_nic(), or net_init_client(), respectively.

These functions pass the QemuOpts to net_client_init().  They also do
other things with the QemuOpts, which we can ignore here.

net_client_init() uses the opts visitor to convert the (flat) QemOpts to
a (non-flat) QAPI object Netdev.  Netdev is also the argument of QMP
command netdev_add.

The opts visitor was an early attempt to support QAPI in
(QemuOpts-based) CLI.  It restricts QAPI types to a certain shape; see
commit eb7ee2cbeb "qapi: introduce OptsVisitor".

A more modern way to support QAPI is qobject_input_visitor_new_str().
It uses keyval_parse() instead of QemuOpts for KEY=VALUE,... syntax, and
it also supports JSON syntax.  The former isn't quite as expressive as
JSON, but it's a lot closer than QemuOpts + opts visitor.

This commit paves the way to use of the modern way instead.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: simplify net_client_parse() error management</title>
<updated>2022-10-28T05:28:52+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2022-10-21T09:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=21fccb2cbbacdc045f19605915e847de31ca9862'/>
<id>urn:sha1:21fccb2cbbacdc045f19605915e847de31ca9862</id>
<content type='text'>
All net_client_parse() callers exit in case of error.

Move exit(1) to net_client_parse() and remove error checking from
the callers.

Suggested-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: remove the @errp argument of net_client_inits()</title>
<updated>2022-10-28T05:28:52+00:00</updated>
<author>
<name>Laurent Vivier</name>
</author>
<published>2022-10-21T09:09:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=d63ef17bfcba1126df6bfcb7bca64c96ac4a8d99'/>
<id>urn:sha1:d63ef17bfcba1126df6bfcb7bca64c96ac4a8d99</id>
<content type='text'>
The only caller passes &amp;error_fatal, so use this directly in the function.

It's what we do for -blockdev, -device, and -object.

Suggested-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost_net: add NetClientState-&gt;load() callback</title>
<updated>2022-09-02T02:22:39+00:00</updated>
<author>
<name>Eugenio Pérez</name>
</author>
<published>2022-08-23T18:30:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=539573c317dc0b8d50a128db60550f2f2898d2fc'/>
<id>urn:sha1:539573c317dc0b8d50a128db60550f2f2898d2fc</id>
<content type='text'>
It allows per-net client operations right after device's successful
start. In particular, to load the device status.

Vhost-vdpa net will use it to add the CVQ buffers to restore the device
status.

Signed-off-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost_net: Add NetClientInfo stop callback</title>
<updated>2022-09-02T02:22:39+00:00</updated>
<author>
<name>Eugenio Pérez</name>
</author>
<published>2022-08-23T18:30:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c5e5269d8a955a0f924218911c2f4a0b34e87a21'/>
<id>urn:sha1:c5e5269d8a955a0f924218911c2f4a0b34e87a21</id>
<content type='text'>
Used by the backend to perform actions after the device is stopped.

In particular, vdpa net use it to unmap CVQ buffers to the device,
cleaning the actions performed in prepare().

Signed-off-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost_net: Add NetClientInfo start callback</title>
<updated>2022-09-02T02:22:39+00:00</updated>
<author>
<name>Eugenio Pérez</name>
</author>
<published>2022-08-23T18:30:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=eb92b75380fc0f2368e22be45d1e2d1e2cd2f79c'/>
<id>urn:sha1:eb92b75380fc0f2368e22be45d1e2d1e2cd2f79c</id>
<content type='text'>
This is used by the backend to perform actions before the device is
started.

In particular, vdpa net use it to map CVQ buffers to the device, so it
can send control commands using them.

Signed-off-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
</feed>
