[PATCH 4/6] tools/misc: xenwatchdogd: add parse_secs()

2024-03-27 Thread leigh
From: Leigh Brown Create a new parse_secs() function to parse the timeout and sleep parameters. This ensures that non-numeric parameters are not accidentally treated as numbers. --- tools/misc/xenwatchdogd.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff

[PATCH 2/6] tools/misc: rework xenwatchdogd signal handling

2024-03-27 Thread leigh
From: Leigh Brown Rework xenwatchdogd signal handling to do the minimum in the signal handler. This is a very minor enhancement. --- tools/misc/xenwatchdogd.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc

[PATCH 3/6] tools/misc: xenwatchdogd: make functions static

2024-03-27 Thread leigh
From: Leigh Brown Make all functions except main() static in xenwatchdogd.c. --- tools/misc/xenwatchdogd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc/xenwatchdogd.c index d4da0ad0b6..224753e824 100644 --- a/tools/misc

[PATCH 6/6] docs/man: Add xenwatchdog manual page

2024-03-27 Thread leigh
From: Leigh Brown Add a manual page for xenwatchdogd. --- docs/man/xenwatchdogd.8.pod | 54 + 1 file changed, 54 insertions(+) create mode 100644 docs/man/xenwatchdogd.8.pod diff --git a/docs/man/xenwatchdogd.8.pod b/docs/man/xenwatchdogd.8.pod new file

[PATCH 0/6] xenwatchdogd enhancements

2024-03-27 Thread leigh
From: Leigh Brown Following up on Cyril's email. I had been independently looking at this, mainly because xenwatchdogd is simple enough for me to understand. The primary intention of this patch series is to replace the pathologically bad behaviour of rebooting the domain if you run "xe

[PATCH 1/6] tools/misc: xenwatchdogd: use EXIT_* constants

2024-03-27 Thread leigh
From: Leigh Brown Use EXIT_SUCCESS/EXIT_FAILURE constants instead of magic numbers. --- tools/misc/xenwatchdogd.c | 40 +++ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc/xenwatchdogd.c index 254117b554

[PATCH 5/6] tools/misc: xenwatchdogd enhancements

2024-03-27 Thread leigh
From: Leigh Brown Add enhanced parameter parsing and validation, making use of getopt_long(). Adds usage() function, ability to run in the foreground, and the ability to disarm the watchdog timer when exiting. Now checks the number of parameters are correct, that timeout is at least two seconds

[PATCH v2 1/6] tools/misc: xenwatchdogd: use EXIT_* constants

2024-03-29 Thread leigh
From: Leigh Brown Use EXIT_SUCCESS/EXIT_FAILURE constants instead of magic numbers. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 40 +++ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc

[PATCH v2 6/6] docs/man: Add xenwatchdog manual page

2024-03-29 Thread leigh
From: Leigh Brown Add a manual page for xenwatchdogd. Signed-off-by: Leigh Brown --- docs/man/xenwatchdogd.8.pod | 54 + 1 file changed, 54 insertions(+) create mode 100644 docs/man/xenwatchdogd.8.pod diff --git a/docs/man/xenwatchdogd.8.pod b/docs/man

[PATCH v2 3/6] tools/misc: xenwatchdogd: add static qualifier

2024-03-29 Thread leigh
From: Leigh Brown Make all functions except main() static in xenwatchdogd.c. Also make the remaining global variable static. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools

[PATCH v2 4/6] tools/misc: xenwatchdogd: add parse_secs()

2024-03-29 Thread leigh
From: Leigh Brown Create a new parse_secs() function to parse the timeout and sleep parameters. This ensures that non-numeric parameters are not accidentally treated as numbers. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 23 +++ 1 file changed, 15

[PATCH v2 0/6] xenwatchdogd bugfixes and enhancements

2024-03-29 Thread leigh
From: Leigh Brown The primary intention of this patch series is to replace the pathologically bad behaviour of rebooting the domain if you run "xenwatchdogd -h". To that end, I have implemented comprehensive argument validation. This validation ensures you can't pass arguments

[PATCH v2 5/6] tools/misc: xenwatchdogd enhancements

2024-03-29 Thread leigh
From: Leigh Brown Add enhanced parameter parsing and validation, making use of getopt_long(). Adds usage() function, ability to run in the foreground, and the ability to disarm the watchdog timer when exiting. Now checks the number of parameters are correct, that timeout is at least two seconds

[PATCH v2 2/6] tools/misc: rework xenwatchdogd signal handling

2024-03-29 Thread leigh
From: Leigh Brown Rework xenwatchdogd signal handling to do the minimum in the signal handler. This is a very minor enhancement. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/misc

[PATCH v3 0/4] xenwatchdogd bugfixes and enhancements

2024-04-11 Thread leigh
From: Leigh Brown The primary intention of this patch series is to replace the pathologically bad behaviour of rebooting the domain if you run "xenwatchdogd -h". To that end, I have implemented comprehensive argument validation. This validation ensures you can't pass arguments

[PATCH v3 4/4] docs/man: Add xenwatchdog manual page

2024-04-11 Thread leigh
From: Leigh Brown Add a manual page for xenwatchdogd. Signed-off-by: Leigh Brown --- docs/man/xenwatchdogd.8.pod | 55 + 1 file changed, 55 insertions(+) create mode 100644 docs/man/xenwatchdogd.8.pod diff --git a/docs/man/xenwatchdogd.8.pod b/docs/man

[PATCH v3 1/4] tools/misc: xenwatchdogd: add parse_secs()

2024-04-11 Thread leigh
From: Leigh Brown Create a new parse_secs() function to parse the timeout and sleep parameters. This ensures that non-numeric parameters are not accidentally treated as numbers. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 23 +++ 1 file changed, 15

[PATCH v3 2/4] tools/misc: xenwatchdogd enhancements

2024-04-11 Thread leigh
From: Leigh Brown Add usage() function, the ability to run in the foreground, and the ability to disarm the watchdog timer when exiting. Add enhanced parameter parsing and validation, making use of getopt_long(). Check the number of parameters are correct, the timeout is at least two seconds

[PATCH v3 3/4] tools/misc: Add xenwatchdogd.c copyright notice

2024-04-11 Thread leigh
From: Leigh Brown Add copyright notice and description of the program. Signed-off-by: Leigh Brown --- tools/misc/xenwatchdogd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc/xenwatchdogd.c index a16d1efc13..2884ca6ca9 100644 --- a/tools

[RFC PATCH 5/5] tools/examples: Examples Linux bridge VLAN config

2024-05-03 Thread Leigh Brown
Add a new directory linux-bridge-vlan showing how to configure systemd-networkd to support a bridge VLAN configuration. Signed-off-by: Leigh Brown --- tools/examples/linux-bridge-vlan/README | 52 +++ tools/examples/linux-bridge-vlan/br0.netdev | 7 +++ tools/examples

[RFC PATCH 2/5] tools/xl: add vid keyword vif option

2024-05-03 Thread Leigh Brown
Update parse_nic_config() to support a new `vid' keyword. This keyword specifies the numeric VLAN ID to assign to the VIF when attaching it to the bridge port, on operating systems that support the capability (e.g. Linux). Signed-off-by: Leigh Brown --- tools/xl/xl_parse.c | 2 ++ 1

[RFC PATCH 3/5] tools/hotplug/Linux: Add bridge VLAN support

2024-05-03 Thread Leigh Brown
Update add_to_bridge shell function to read the vid parameter from xenstore and set the bridge LAN for the VID to the given value. This only works when using the iproute2 bridge command, so a warning is issued if using the legacy brctl command and a vid is set. Signed-off-by: Leigh Brown

[RFC PATCH 4/5] docs/man: document VIF vid keyword

2024-05-03 Thread Leigh Brown
Document the new `vid' keyword in xl-network-configuration(5). Signed-off-by: Leigh Brown --- docs/man/xl-network-configuration.5.pod.in | 6 ++ 1 file changed, 6 insertions(+) diff --git a/docs/man/xl-network-configuration.5.pod.in b/docs/man/xl-network-configuration.5.pod.in

[RFC PATCH 0/5] Add bridge VLAN support

2024-05-03 Thread Leigh Brown
this capability, but if they do please point me in the direction of some documentation and/or examples. NB: I'm not very familiar with Xen code base so may have missed something important, although I have tested it and it is working well for me. Cheers, Leigh. le...@solinno.co.

[RFC PATCH 1/5] tools/libs/light: Add vid field to libxl_device_nic

2024-05-03 Thread Leigh Brown
VLAN filtering on bridge ports. The Xen hotplug scripts need to be updated to read this information from then xenstore and perform the required configuration. Signed-off-by: Leigh Brown --- tools/libs/light/libxl_nic.c | 20 tools/libs/light/libxl_types.idl | 1 + 2 files ch

[RFC PATCH v2 3/5] tools/hotplug/Linux: Add bridge VLAN support

2024-05-08 Thread Leigh Brown
e untagged. A complex example would be: vlan=1p/10-15/20-25u This capability only works when using the iproute2 bridge command, so a warning is issued if the vlan parameter is set and the bridge command is not available, as it will be ignored. Signed-off-by: Leigh Brown --- tools/hotplug/Lin

[RFC PATCH v2 5/5] tools/examples: Example Linux bridge VLAN config

2024-05-08 Thread Leigh Brown
Add a new directory linux-bridge-vlan with examples files showing how to configure systemd-networkd to support a bridge VLAN configuration. Signed-off-by: Leigh Brown --- tools/examples/linux-bridge-vlan/README | 68 +++ tools/examples/linux-bridge-vlan/br0.netdev | 7

[RFC PATCH v2 1/5] tools/libs/light: Add vlan field to libxl_device_nic

2024-05-08 Thread Leigh Brown
rform VLAN filtering on bridge ports. The Xen hotplug scripts need to be updated to read this information from the xenstore and perform the required configuration. Signed-off-by: Leigh Brown --- tools/libs/light/libxl_nic.c | 10 ++ tools/libs/light/libxl_types.idl | 1 + 2 files ch

[RFC PATCH v2 0/5] Add bridge VLAN support

2024-05-08 Thread Leigh Brown
I'm not very familiar with Xen code base so may have missed something important, although I have tested it and it is working well for me. Cheers, Leigh. Leigh Brown (5): tools/libs/light: Add vlan field to libxl_device_nic tools/xl: add vlan keyword to vif option tools/hotplug/Linux: Add

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

2024-05-08 Thread Leigh Brown
n 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 --- tools/xl/xl_parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index ed983200c3..7546fe7e7a 100644 --- a/too

[RFC PATCH v2 4/5] docs/man: document VIF vlan keyword

2024-05-08 Thread Leigh Brown
Document the new `vlan' keyword in xl-network-configuration(5). Signed-off-by: Leigh Brown --- docs/man/xl-network-configuration.5.pod.in | 38 ++ 1 file changed, 38 insertions(+) diff --git a/docs/man/xl-network-configuration.5.pod.in b/docs/man/xl-network-configurat

Re: [RFC PATCH v2 0/5] Add bridge VLAN support

2024-05-09 Thread Leigh Brown
Hi Andrew, On 2024-05-09 16:53, Andrew Cooper wrote: On 08/05/2024 10:38 pm, Leigh Brown wrote: Hello all, I realised over the weekend that there is a valid use case for providing a VIF to a domain that has access to multiple VLANs, e.g. a router. Yes, you can create a VIF per VLAN, but if

Re: [PATCH for-4.19] libxl: fix population of the online vCPU bitmap for PVH

2024-05-10 Thread Leigh Brown
et as enabled, which contradicts the data in xenstore if vCPUs is different than maximum vCPUs. Fix by copying the internal libxl bitmap that's populated based on the vCPUs parameter. Reported-by: Arthur Borsboom Link: https://gitlab.com/libvirt/libvirt/-/issues/399 Reported-by: Leigh Br

[PATCH] tools/xentop: fix cpu% sort order

2024-05-14 Thread Leigh Brown
Although using integer comparison to compare doubles kind of works, it's annoying to see domains slightly out of order when sorting by cpu%. Add a compare_dbl() function and update compare_cpu_pct() to call it. Signed-off-by: Leigh Brown --- tools/xentop/xentop.c | 13 - 1

Re: [PATCH for-4.19] tools/xentop: fix cpu% sort order

2024-05-14 Thread Leigh Brown
Hello, On 2024-05-14 13:07, Andrew Cooper wrote: On 14/05/2024 9:13 am, Leigh Brown wrote: Although using integer comparison to compare doubles kind of works, it's annoying to see domains slightly out of order when sorting by cpu%. Add a compare_dbl() function and update compare_cpu_pct

Re: [PATCH for-4.19] tools/xentop: fix cpu% sort order

2024-05-14 Thread Leigh Brown
On 2024-05-14 13:07, Andrew Cooper wrote: On 14/05/2024 9:13 am, Leigh Brown wrote: Although using integer comparison to compare doubles kind of works, it's annoying to see domains slightly out of order when sorting by cpu%. Add a compare_dbl() function and update compare_cpu_pct() to ca

Re: [RFC PATCH v2 3/5] tools/hotplug/Linux: Add bridge VLAN support

2024-05-15 Thread Leigh Brown
Hi Jason, On 2024-05-15 01:57, Jason Andryuk wrote: On Wed, May 8, 2024 at 6:55 PM Leigh Brown wrote: Update add_to_bridge shell function to read the vlan parameter from xenstore and set the bridge VLAN configuration for the VID. Add additional helper functions to parse the vlan

Re: [RFC PATCH v2 4/5] docs/man: document VIF vlan keyword

2024-05-15 Thread Leigh Brown
Hi Jason, On 2024-05-15 01:57, Jason Andryuk wrote: On Wed, May 8, 2024 at 5:39 PM Leigh Brown wrote: Document the new `vlan' keyword in xl-network-configuration(5). Signed-off-by: Leigh Brown Reviewed-by: Jason Andryuk One nit below --- docs/man/xl-network-configuration.5.p

Re: [RFC PATCH v2 5/5] tools/examples: Example Linux bridge VLAN config

2024-05-15 Thread Leigh Brown
Hi Jason, On 2024-05-15 01:58, Jason Andryuk wrote: On Wed, May 8, 2024 at 6:08 PM Leigh Brown wrote:> Add a new directory linux-bridge-vlan with examples files showing how to configure systemd-networkd to support a bridge VLAN configuration. Signed-off-by: Leigh Brown --- tools/examp

[PATCH v3 3/4] tools/hotplug/Linux: Add bridge VLAN support

2024-05-16 Thread Leigh Brown
e untagged. A complex example would be: vlan=1p/10-15/20-25u This capability requires the iproute2 bridge command to be installed. An error will be generated if the vlan parameter is set and the bridge command is not available. Signed-off-by: Leigh Brown --- tools/hotplug/Lin

[PATCH v3 1/4] tools/libs/light: Add vlan field to libxl_device_nic

2024-05-16 Thread Leigh Brown
rform VLAN filtering on bridge ports. The Xen hotplug scripts need to be updated to read this information from the xenstore and perform the required configuration. Signed-off-by: Leigh Brown Reviewed-by: Jason Andryuk --- tools/libs/light/libxl_nic.c | 10 ++ tools/libs/

[PATCH v3 0/4] Add bridge VLAN support

2024-05-16 Thread Leigh Brown
idge VLAN in the Linux hotplug scripts. I don't believe NetBSD or FreeBSD support this capability, but if they do please point me in the direction of some documentation and/or examples. NB: I'm not very familiar with Xen code base so may have missed something important, although I

[PATCH v3 2/4] tools/xl: add vlan keyword to vif option

2024-05-16 Thread Leigh Brown
n the VIF when adding it to the bridge port. This will be done by the vif-bridge script and functions. Document the new `vlan' keyword in xl-network-configuration(5). Signed-off-by: Leigh Brown Reviewed-by: Jason Andryuk --- docs/man/xl-network-configuration.5.p

[PATCH v3 4/4] docs/misc: Example Linux bridge VLAN config

2024-05-16 Thread Leigh Brown
Add a new directory linux-bridge-vlan with example files showing how to configure systemd-networkd to support a bridge VLAN configuration. Signed-off-by: Leigh Brown --- docs/misc/linux-bridge-vlan/README | 68 ++ docs/misc/linux-bridge-vlan/br0.netdev | 7

Re: [PATCH v3 3/4] tools/hotplug/Linux: Add bridge VLAN support

2024-05-17 Thread Leigh Brown
Hi Jason, On 2024-05-17 03:19, Jason Andryuk wrote: On Thu, May 16, 2024 at 6:56 AM Leigh Brown wrote: Update add_to_bridge shell function to read the vlan parameter from xenstore and set the bridge VLAN configuration for the VID. Add additional helper functions to parse the vlan

[PATCH v4 1/2] tools/hotplug/Linux: Add bridge VLAN support

2024-05-17 Thread Leigh Brown
e untagged. A complex example would be: vlan=1p/10-15/20-25u This capability requires the iproute2 bridge command to be installed. An error will be generated if the vlan parameter is set and the bridge command is not available. Signed-off-by: Leigh Brown --- tools/hotplug/Lin

[PATCH v4 2/2] tools/examples: Example Linux bridge VLAN config

2024-05-17 Thread Leigh Brown
Add a new directory linux-bridge-vlan with example files showing how to configure systemd-networkd to support a bridge VLAN configuration. Signed-off-by: Leigh Brown --- docs/misc/linux-bridge-vlan/README | 68 ++ docs/misc/linux-bridge-vlan/br0.netdev | 7

[PATCH v4 0/2] Finalise bridge VLAN support

2024-05-17 Thread Leigh Brown
iterating through terms. Regards, Leigh. --- Leigh Brown (2): tools/hotplug/Linux: Add bridge VLAN support tools/examples: Example Linux bridge VLAN config docs/misc/linux-bridge-vlan/README | 68 + docs/misc/linux-bridge-vlan/br0.netdev | 7 ++ docs/misc/linux

xl list -l aborts with double free error with vlan patches

2024-05-20 Thread Leigh Brown
#16 0x55561b55 in main (argc=2, argv=0x7fffecd8) at xl.c:451 Regards, Leigh.

Re: xl list -l aborts with double free error with vlan patches

2024-05-20 Thread Leigh Brown
Hi, On 2024-05-20 15:33, Leigh Brown wrote: Hello, When running xl list -l with my VLAN patches applied, a double free error is raised. I'm unable to determine why. broken: 0cc01c603f4287233715a526b056bc20e0e97412 (HEAD) tools/xl: add vlan keyword to vif option

[PATCH] tools/libs/light: Fix nic->vlan memory allocation

2024-05-20 Thread Leigh Brown
ools/libs/light: Add vlan field to libxl_device_nic") Signed-off-by: Leigh Brown --- tools/libs/light/libxl_nic.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/libs/light/libxl_nic.c b/tools/libs/light/libxl_nic.c index d861e3726d..300a96a8b1 100644 --

Re: [PATCH v2 2/6] tools/misc: rework xenwatchdogd signal handling

2024-04-11 Thread Leigh Brown
modify the variable.  This goes wrong in subtle and fun ways when using LTO. I'll fix on commit. For the record, I've taken 1-3 which are ready.  You'll need to rework 4 and later per Anthony's feedback. ~Andrew Thanks, I will get those done this evening, hopefully. Regards, Leigh.