diff mbox series

[RFC,v2,2/5] tools/xl: add vlan keyword to vif option

Message ID 20240508213824.55824-3-leigh@solinno.co.uk (mailing list archive)
State Superseded
Headers show
Series Add bridge VLAN support | expand

Commit Message

Leigh Brown May 8, 2024, 9:38 p.m. UTC
Update parse_nic_config() to support a new `vlan' keyword. This
keyword specifies the VLAN configuration to assign to the VIF when
attaching it to the bridge port, on operating systems that support
the capability (e.g. Linux). The vlan keyword will allow one or
more VLANs to be configured on the VIF when adding it to the bridge
port. This will be done by the vif-bridge script and functions.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
---
 tools/xl/xl_parse.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jason Andryuk May 12, 2024, 3:45 p.m. UTC | #1
On Wed, May 8, 2024 at 6:13 PM Leigh Brown <leigh@solinno.co.uk> wrote:
>
> Update parse_nic_config() to support a new `vlan' keyword. This
> keyword specifies the VLAN configuration to assign to the VIF when
> attaching it to the bridge port, on operating systems that support
> the capability (e.g. Linux). The vlan keyword will allow one or
> more VLANs to be configured on the VIF when adding it to the bridge
> port. This will be done by the vif-bridge script and functions.
>
> Signed-off-by: Leigh Brown <leigh@solinno.co.uk>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
diff mbox series

Patch

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index ed983200c3..7546fe7e7a 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -565,6 +565,8 @@  int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
         nic->devid = parse_ulong(oparg);
     } else if (MATCH_OPTION("mtu", token, oparg)) {
         nic->mtu = parse_ulong(oparg);
+    } else if (MATCH_OPTION("vlan", token, oparg)) {
+        replace_string(&nic->vlan, oparg);
     } else if (!strcmp("trusted", token)) {
         libxl_defbool_set(&nic->trusted, true);
     } else if (!strcmp("untrusted", token)) {