[PATCH 16/37] qemuBuildHostNetProps: Refactor construction of tapfd/vhostfd arguments

Ján Tomko jtomko at redhat.com
Fri May 13 12:17:34 UTC 2022


On a Tuesday in 2022, Peter Krempa wrote:
>Pre-construct the array the same way for the case when there's only one
>FD and when there are multiple. We just change the argument name
>depending on the count.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_command.c | 66 +++++++++++++++++++----------------------
> 1 file changed, 31 insertions(+), 35 deletions(-)
>
>diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>index 19afad22a1..c412bc50e0 100644
>--- a/src/qemu/qemu_command.c
>+++ b/src/qemu/qemu_command.c
>@@ -4215,54 +4215,50 @@ qemuBuildHostNetProps(virDomainNetDef *net,
>     case VIR_DOMAIN_NET_TYPE_BRIDGE:
>     case VIR_DOMAIN_NET_TYPE_NETWORK:
>     case VIR_DOMAIN_NET_TYPE_DIRECT:
>-    case VIR_DOMAIN_NET_TYPE_ETHERNET:
>-        if (virJSONValueObjectAdd(&netprops, "s:type", "tap", NULL) < 0)
>-            return NULL;
>+    case VIR_DOMAIN_NET_TYPE_ETHERNET: {
>+        g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
>+        /* for one tapfd/vhostfd 'fd=' shall be used, for more than use 'fds=' */

s/more than/more/


Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220513/cc2395c8/attachment.sig>


More information about the libvir-list mailing list