[PATCH v2 2/5] pc-bios/s390-ccw: Allow up to 31 entries for pxelinux.cfg

Thomas Huth posted 5 patches 4 months, 1 week ago
Maintainers: Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Jared Rossi <jrossi@linux.ibm.com>, Zhuoying Cai <zycai@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>
[PATCH v2 2/5] pc-bios/s390-ccw: Allow up to 31 entries for pxelinux.cfg
Posted by Thomas Huth 4 months, 1 week ago
From: Thomas Huth <thuth@redhat.com>

We're going to support a menu for the pxelinux.cfg code, and to be able
to reuse some functionality from menu.c, we should align the maximum
amount of possible entries with the MAX_BOOT_ENTRIES constant that is
used there. Thus replace MAX_PXELINUX_ENTRIES with MAX_BOOT_ENTRIES.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 pc-bios/s390-ccw/netmain.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
index c0aafca22d2..6f64323cd84 100644
--- a/pc-bios/s390-ccw/netmain.c
+++ b/pc-bios/s390-ccw/netmain.c
@@ -353,17 +353,15 @@ static int net_select_and_load_kernel(filename_ip_t *fn_ip,
     return load_kernel_with_initrd(fn_ip, &entries[selected]);
 }
 
-#define MAX_PXELINUX_ENTRIES 16
-
 static int net_try_pxelinux_cfg(filename_ip_t *fn_ip)
 {
-    struct pl_cfg_entry entries[MAX_PXELINUX_ENTRIES];
+    struct pl_cfg_entry entries[MAX_BOOT_ENTRIES];
     int num_ent, def_ent = 0;
 
     num_ent = pxelinux_load_parse_cfg(fn_ip, mac, get_uuid(),
                                       DEFAULT_TFTP_RETRIES,
                                       cfgbuf, sizeof(cfgbuf),
-                                      entries, MAX_PXELINUX_ENTRIES, &def_ent);
+                                      entries, MAX_BOOT_ENTRIES, &def_ent);
 
     return net_select_and_load_kernel(fn_ip, num_ent, def_ent, entries);
 }
@@ -446,11 +444,11 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip)
          * a magic comment string.
          */
         if (!strncasecmp("# pxelinux", cfgbuf, 10)) {
-            struct pl_cfg_entry entries[MAX_PXELINUX_ENTRIES];
+            struct pl_cfg_entry entries[MAX_BOOT_ENTRIES];
             int num_ent, def_ent = 0;
 
             num_ent = pxelinux_parse_cfg(cfgbuf, sizeof(cfgbuf), entries,
-                                         MAX_PXELINUX_ENTRIES, &def_ent);
+                                         MAX_BOOT_ENTRIES, &def_ent);
             return net_select_and_load_kernel(fn_ip, num_ent, def_ent,
                                               entries);
         }
-- 
2.50.0
Re: [PATCH v2 2/5] pc-bios/s390-ccw: Allow up to 31 entries for pxelinux.cfg
Posted by Jared Rossi 4 months, 1 week ago
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>

On 7/9/25 4:34 AM, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> We're going to support a menu for the pxelinux.cfg code, and to be able
> to reuse some functionality from menu.c, we should align the maximum
> amount of possible entries with the MAX_BOOT_ENTRIES constant that is
> used there. Thus replace MAX_PXELINUX_ENTRIES with MAX_BOOT_ENTRIES.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   pc-bios/s390-ccw/netmain.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
> index c0aafca22d2..6f64323cd84 100644
> --- a/pc-bios/s390-ccw/netmain.c
> +++ b/pc-bios/s390-ccw/netmain.c
> @@ -353,17 +353,15 @@ static int net_select_and_load_kernel(filename_ip_t *fn_ip,
>       return load_kernel_with_initrd(fn_ip, &entries[selected]);
>   }
>   
> -#define MAX_PXELINUX_ENTRIES 16
> -
>   static int net_try_pxelinux_cfg(filename_ip_t *fn_ip)
>   {
> -    struct pl_cfg_entry entries[MAX_PXELINUX_ENTRIES];
> +    struct pl_cfg_entry entries[MAX_BOOT_ENTRIES];
>       int num_ent, def_ent = 0;
>   
>       num_ent = pxelinux_load_parse_cfg(fn_ip, mac, get_uuid(),
>                                         DEFAULT_TFTP_RETRIES,
>                                         cfgbuf, sizeof(cfgbuf),
> -                                      entries, MAX_PXELINUX_ENTRIES, &def_ent);
> +                                      entries, MAX_BOOT_ENTRIES, &def_ent);
>   
>       return net_select_and_load_kernel(fn_ip, num_ent, def_ent, entries);
>   }
> @@ -446,11 +444,11 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip)
>            * a magic comment string.
>            */
>           if (!strncasecmp("# pxelinux", cfgbuf, 10)) {
> -            struct pl_cfg_entry entries[MAX_PXELINUX_ENTRIES];
> +            struct pl_cfg_entry entries[MAX_BOOT_ENTRIES];
>               int num_ent, def_ent = 0;
>   
>               num_ent = pxelinux_parse_cfg(cfgbuf, sizeof(cfgbuf), entries,
> -                                         MAX_PXELINUX_ENTRIES, &def_ent);
> +                                         MAX_BOOT_ENTRIES, &def_ent);
>               return net_select_and_load_kernel(fn_ip, num_ent, def_ent,
>                                                 entries);
>           }