diff mbox

[v3,1/3] loader: rename in_ram/has_mr

Message ID 1394388381-22813-1-git-send-email-mst@redhat.com
State New
Headers show

Commit Message

Michael S. Tsirkin March 9, 2014, 6:06 p.m. UTC
we put copy of ROMs in MR for migration.
but the name rom_in_ram makes one think we
load it in guest RAM.
Rename has_mr to make intent clearer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/loader.h | 2 +-
 hw/core/loader.c    | 6 +++---
 hw/i386/pc_piix.c   | 2 +-
 hw/i386/pc_q35.c    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

Comments

Jeff E. Nelson March 9, 2014, 9:22 p.m. UTC | #1
On 03/09/2014 02:06 PM, Michael S. Tsirkin wrote:
> we put copy of ROMs in MR for migration.
> but the name rom_in_ram makes one think we
> load it in guest RAM.
> Rename has_mr to make intent clearer.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>   include/hw/loader.h | 2 +-
>   hw/core/loader.c    | 6 +++---
>   hw/i386/pc_piix.c   | 2 +-
>   hw/i386/pc_q35.c    | 2 +-
>   4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index aaf08c3..3dc5b94 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -49,7 +49,7 @@ void pstrcpy_targphys(const char *name,
>                         hwaddr dest, int buf_size,
>                         const char *source);
>
> -extern bool rom_file_in_ram;
> +extern bool rom_file_has_mr;

Thank you! It is much easier to understand what is going on.

I don't think I am qualified to offer an official acknowledgment, but 
this looks good to me.

-Jeff

>
>   int rom_add_file(const char *file, const char *fw_dir,
>                    hwaddr addr, int32_t bootindex);
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index b323c0c..13e98d8 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -54,7 +54,7 @@
>
>   #include <zlib.h>
>
> -bool rom_file_in_ram = true;
> +bool rom_file_has_mr = true;
>
>   static int roms_loaded;
>
> @@ -694,7 +694,7 @@ int rom_add_file(const char *file, const char *fw_dir,
>                    basename);
>           snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>               data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>           } else {
>               data = rom->data;
> @@ -738,7 +738,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
>
>           snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>               data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>           } else {
>               data = rom->data;
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index ae1699d..fb2d636 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -272,7 +272,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>   {
>       pc_compat_1_7(args);
>       has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>       has_acpi_build = false;
>   }
>
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index a7f6260..eb55ae4 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -250,7 +250,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>   {
>       pc_compat_1_7(args);
>       has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>       has_acpi_build = false;
>   }
>
>
Paolo Bonzini March 10, 2014, 8:58 a.m. UTC | #2
Il 09/03/2014 19:06, Michael S. Tsirkin ha scritto:
> we put copy of ROMs in MR for migration.
> but the name rom_in_ram makes one think we
> load it in guest RAM.
> Rename has_mr to make intent clearer.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/hw/loader.h | 2 +-
>  hw/core/loader.c    | 6 +++---
>  hw/i386/pc_piix.c   | 2 +-
>  hw/i386/pc_q35.c    | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index aaf08c3..3dc5b94 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -49,7 +49,7 @@ void pstrcpy_targphys(const char *name,
>                        hwaddr dest, int buf_size,
>                        const char *source);
>
> -extern bool rom_file_in_ram;
> +extern bool rom_file_has_mr;
>
>  int rom_add_file(const char *file, const char *fw_dir,
>                   hwaddr addr, int32_t bootindex);
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index b323c0c..13e98d8 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -54,7 +54,7 @@
>
>  #include <zlib.h>
>
> -bool rom_file_in_ram = true;
> +bool rom_file_has_mr = true;
>
>  static int roms_loaded;
>
> @@ -694,7 +694,7 @@ int rom_add_file(const char *file, const char *fw_dir,
>                   basename);
>          snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>              data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>          } else {
>              data = rom->data;
> @@ -738,7 +738,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
>
>          snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>              data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>          } else {
>              data = rom->data;
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index ae1699d..fb2d636 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -272,7 +272,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>  {
>      pc_compat_1_7(args);
>      has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>      has_acpi_build = false;
>  }
>
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index a7f6260..eb55ae4 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -250,7 +250,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>  {
>      pc_compat_1_7(args);
>      has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>      has_acpi_build = false;
>  }
>
>

Series looks good, but please squash patch 3 into patch 2.

Paolo
Michael S. Tsirkin March 11, 2014, 11:28 a.m. UTC | #3
On Mon, Mar 10, 2014 at 09:58:54AM +0100, Paolo Bonzini wrote:
> Il 09/03/2014 19:06, Michael S. Tsirkin ha scritto:
> >we put copy of ROMs in MR for migration.
> >but the name rom_in_ram makes one think we
> >load it in guest RAM.
> >Rename has_mr to make intent clearer.
> >
> >Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >---
> > include/hw/loader.h | 2 +-
> > hw/core/loader.c    | 6 +++---
> > hw/i386/pc_piix.c   | 2 +-
> > hw/i386/pc_q35.c    | 2 +-
> > 4 files changed, 6 insertions(+), 6 deletions(-)
> >
> >diff --git a/include/hw/loader.h b/include/hw/loader.h
> >index aaf08c3..3dc5b94 100644
> >--- a/include/hw/loader.h
> >+++ b/include/hw/loader.h
> >@@ -49,7 +49,7 @@ void pstrcpy_targphys(const char *name,
> >                       hwaddr dest, int buf_size,
> >                       const char *source);
> >
> >-extern bool rom_file_in_ram;
> >+extern bool rom_file_has_mr;
> >
> > int rom_add_file(const char *file, const char *fw_dir,
> >                  hwaddr addr, int32_t bootindex);
> >diff --git a/hw/core/loader.c b/hw/core/loader.c
> >index b323c0c..13e98d8 100644
> >--- a/hw/core/loader.c
> >+++ b/hw/core/loader.c
> >@@ -54,7 +54,7 @@
> >
> > #include <zlib.h>
> >
> >-bool rom_file_in_ram = true;
> >+bool rom_file_has_mr = true;
> >
> > static int roms_loaded;
> >
> >@@ -694,7 +694,7 @@ int rom_add_file(const char *file, const char *fw_dir,
> >                  basename);
> >         snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
> >
> >-        if (rom_file_in_ram) {
> >+        if (rom_file_has_mr) {
> >             data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
> >         } else {
> >             data = rom->data;
> >@@ -738,7 +738,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
> >
> >         snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
> >
> >-        if (rom_file_in_ram) {
> >+        if (rom_file_has_mr) {
> >             data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
> >         } else {
> >             data = rom->data;
> >diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> >index ae1699d..fb2d636 100644
> >--- a/hw/i386/pc_piix.c
> >+++ b/hw/i386/pc_piix.c
> >@@ -272,7 +272,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
> > {
> >     pc_compat_1_7(args);
> >     has_pci_info = false;
> >-    rom_file_in_ram = false;
> >+    rom_file_has_mr = false;
> >     has_acpi_build = false;
> > }
> >
> >diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> >index a7f6260..eb55ae4 100644
> >--- a/hw/i386/pc_q35.c
> >+++ b/hw/i386/pc_q35.c
> >@@ -250,7 +250,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
> > {
> >     pc_compat_1_7(args);
> >     has_pci_info = false;
> >-    rom_file_in_ram = false;
> >+    rom_file_has_mr = false;
> >     has_acpi_build = false;
> > }
> >
> >
> 
> Series looks good, but please squash patch 3 into patch 2.
> 
> Paolo

done. Already merged so won't repost here.
Marcel Apfelbaum March 11, 2014, 11:57 a.m. UTC | #4
On Sun, 2014-03-09 at 20:06 +0200, Michael S. Tsirkin wrote:
> we put copy of ROMs in MR for migration.
> but the name rom_in_ram makes one think we
> load it in guest RAM.
> Rename has_mr to make intent clearer.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/hw/loader.h | 2 +-
>  hw/core/loader.c    | 6 +++---
>  hw/i386/pc_piix.c   | 2 +-
>  hw/i386/pc_q35.c    | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)

Hi, Series
Reviewed-by: Marcel Apfelbaum <marcel.a@redhat.com>

Thanks,
Marcel

> 
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index aaf08c3..3dc5b94 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -49,7 +49,7 @@ void pstrcpy_targphys(const char *name,
>                        hwaddr dest, int buf_size,
>                        const char *source);
>  
> -extern bool rom_file_in_ram;
> +extern bool rom_file_has_mr;
>  
>  int rom_add_file(const char *file, const char *fw_dir,
>                   hwaddr addr, int32_t bootindex);
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index b323c0c..13e98d8 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -54,7 +54,7 @@
>  
>  #include <zlib.h>
>  
> -bool rom_file_in_ram = true;
> +bool rom_file_has_mr = true;
>  
>  static int roms_loaded;
>  
> @@ -694,7 +694,7 @@ int rom_add_file(const char *file, const char *fw_dir,
>                   basename);
>          snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>  
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>              data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>          } else {
>              data = rom->data;
> @@ -738,7 +738,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
>  
>          snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
>  
> -        if (rom_file_in_ram) {
> +        if (rom_file_has_mr) {
>              data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
>          } else {
>              data = rom->data;
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index ae1699d..fb2d636 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -272,7 +272,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>  {
>      pc_compat_1_7(args);
>      has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>      has_acpi_build = false;
>  }
>  
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index a7f6260..eb55ae4 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -250,7 +250,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
>  {
>      pc_compat_1_7(args);
>      has_pci_info = false;
> -    rom_file_in_ram = false;
> +    rom_file_has_mr = false;
>      has_acpi_build = false;
>  }
>
diff mbox

Patch

diff --git a/include/hw/loader.h b/include/hw/loader.h
index aaf08c3..3dc5b94 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -49,7 +49,7 @@  void pstrcpy_targphys(const char *name,
                       hwaddr dest, int buf_size,
                       const char *source);
 
-extern bool rom_file_in_ram;
+extern bool rom_file_has_mr;
 
 int rom_add_file(const char *file, const char *fw_dir,
                  hwaddr addr, int32_t bootindex);
diff --git a/hw/core/loader.c b/hw/core/loader.c
index b323c0c..13e98d8 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -54,7 +54,7 @@ 
 
 #include <zlib.h>
 
-bool rom_file_in_ram = true;
+bool rom_file_has_mr = true;
 
 static int roms_loaded;
 
@@ -694,7 +694,7 @@  int rom_add_file(const char *file, const char *fw_dir,
                  basename);
         snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
 
-        if (rom_file_in_ram) {
+        if (rom_file_has_mr) {
             data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
         } else {
             data = rom->data;
@@ -738,7 +738,7 @@  void *rom_add_blob(const char *name, const void *blob, size_t len,
 
         snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
 
-        if (rom_file_in_ram) {
+        if (rom_file_has_mr) {
             data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
         } else {
             data = rom->data;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ae1699d..fb2d636 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -272,7 +272,7 @@  static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     pc_compat_1_7(args);
     has_pci_info = false;
-    rom_file_in_ram = false;
+    rom_file_has_mr = false;
     has_acpi_build = false;
 }
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index a7f6260..eb55ae4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -250,7 +250,7 @@  static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     pc_compat_1_7(args);
     has_pci_info = false;
-    rom_file_in_ram = false;
+    rom_file_has_mr = false;
     has_acpi_build = false;
 }