[PATCH] stubdom/grub: Update init_netfront() call for mini-os

Costin Lupu posted 1 patch 3 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200827191257.30100-1-costin.lupu@cs.pub.ro
Maintainers: Samuel Thibault <samuel.thibault@ens-lyon.org>
There is a newer version of this series
stubdom/grub/mini-os.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] stubdom/grub: Update init_netfront() call for mini-os
Posted by Costin Lupu 3 years, 8 months ago
This patch updates the call of init_netfront() function according to its
recently updated declaration which can also include parameters for gateway
and netmask addresses. While we are here, the patch also removes passing
the ip parameter because (a) it is not used anywhere and (b) it wastes
memory since it would reference a dynamically allocated string.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
---
 stubdom/grub/mini-os.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
index 4fc052a255..b33dbf02fb 100644
--- a/stubdom/grub/mini-os.c
+++ b/stubdom/grub/mini-os.c
@@ -291,8 +291,6 @@ struct netfront_dev *net_dev;
 int
 minios_probe (struct nic *nic)
 {
-    char *ip;
-
     if (net_dev)
         return 1;
 
@@ -300,7 +298,7 @@ minios_probe (struct nic *nic)
     grub_memset ((char *) arptable, 0,
                  MAX_ARP * sizeof (struct arptable_t));
 
-    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
+    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, NULL, NULL, NULL);
     if (!net_dev)
         return 0;
 
-- 
2.20.1


Re: [PATCH] stubdom/grub: Update init_netfront() call for mini-os
Posted by Samuel Thibault 3 years, 8 months ago
Costin Lupu, le jeu. 27 août 2020 22:12:57 +0300, a ecrit:
> This patch updates the call of init_netfront() function according to its
> recently updated declaration which can also include parameters for gateway
> and netmask addresses. While we are here, the patch also removes passing
> the ip parameter because (a) it is not used anywhere and (b) it wastes
> memory since it would reference a dynamically allocated string.
> 
> Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/grub/mini-os.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
> index 4fc052a255..b33dbf02fb 100644
> --- a/stubdom/grub/mini-os.c
> +++ b/stubdom/grub/mini-os.c
> @@ -291,8 +291,6 @@ struct netfront_dev *net_dev;
>  int
>  minios_probe (struct nic *nic)
>  {
> -    char *ip;
> -
>      if (net_dev)
>          return 1;
>  
> @@ -300,7 +298,7 @@ minios_probe (struct nic *nic)
>      grub_memset ((char *) arptable, 0,
>                   MAX_ARP * sizeof (struct arptable_t));
>  
> -    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
> +    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, NULL, NULL, NULL);
>      if (!net_dev)
>          return 0;
>  
> -- 
> 2.20.1
> 

Re: [PATCH] stubdom/grub: Update init_netfront() call for mini-os
Posted by Costin Lupu 3 years, 8 months ago
Hi Samuel,

Sorry for spamming. I resent the patch because I wasn't subscribed to
xen-devel when I sent the first one and I know there might be some
issues with the patches arriving on the list for authors who aren't
subscribed.

Cheers,
Costin

On 8/27/20 10:16 PM, Samuel Thibault wrote:
> Costin Lupu, le jeu. 27 août 2020 22:12:57 +0300, a ecrit:
>> This patch updates the call of init_netfront() function according to its
>> recently updated declaration which can also include parameters for gateway
>> and netmask addresses. While we are here, the patch also removes passing
>> the ip parameter because (a) it is not used anywhere and (b) it wastes
>> memory since it would reference a dynamically allocated string.
>>
>> Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
> 
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
>> ---
>>  stubdom/grub/mini-os.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
>> index 4fc052a255..b33dbf02fb 100644
>> --- a/stubdom/grub/mini-os.c
>> +++ b/stubdom/grub/mini-os.c
>> @@ -291,8 +291,6 @@ struct netfront_dev *net_dev;
>>  int
>>  minios_probe (struct nic *nic)
>>  {
>> -    char *ip;
>> -
>>      if (net_dev)
>>          return 1;
>>  
>> @@ -300,7 +298,7 @@ minios_probe (struct nic *nic)
>>      grub_memset ((char *) arptable, 0,
>>                   MAX_ARP * sizeof (struct arptable_t));
>>  
>> -    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
>> +    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, NULL, NULL, NULL);
>>      if (!net_dev)
>>          return 0;
>>  
>> -- 
>> 2.20.1
>>

Re: [PATCH] stubdom/grub: Update init_netfront() call for mini-os
Posted by Jan Beulich 3 years, 8 months ago
On 27.08.2020 21:12, Costin Lupu wrote:
> This patch updates the call of init_netfront() function according to its
> recently updated declaration which can also include parameters for gateway
> and netmask addresses. While we are here, the patch also removes passing
> the ip parameter because (a) it is not used anywhere and (b) it wastes
> memory since it would reference a dynamically allocated string.

Reported-by: Jan Beulich <jbeulich@suse.com>

> Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
> ---
>  stubdom/grub/mini-os.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
> index 4fc052a255..b33dbf02fb 100644
> --- a/stubdom/grub/mini-os.c
> +++ b/stubdom/grub/mini-os.c
> @@ -291,8 +291,6 @@ struct netfront_dev *net_dev;
>  int
>  minios_probe (struct nic *nic)
>  {
> -    char *ip;
> -
>      if (net_dev)
>          return 1;
>  
> @@ -300,7 +298,7 @@ minios_probe (struct nic *nic)
>      grub_memset ((char *) arptable, 0,
>                   MAX_ARP * sizeof (struct arptable_t));
>  
> -    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
> +    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, NULL, NULL, NULL);
>      if (!net_dev)
>          return 0;
>  
>