Skip to contentSkip to conversation

Revert "hw/sparc64/niagara: Use blk_name() instead of open-coding it"

PATCH In review Markus Armbruster 3 participants 5 messages May 15, 2023 – Jun 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "hw/sparc64/niagara: Use blk_name() instead of open-coding it"

This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107.

This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the inconvenience!

---
 hw/sparc64/niagara.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/sparc64/niagara.c +4 -2
index 6725cc61fd..ab3c4ec346 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "block/block_int-common.h"
 #include "qemu/units.h"
 #include "cpu.h"
 #include "hw/boards.h"
@@ -143,9 +144,10 @@ static void niagara_init(MachineState *machine)
             memory_region_add_subregion(get_system_memory(),
                                         NIAGARA_VDISK_BASE, &s->vdisk_ram);
             dinfo->is_default = 1;
-            rom_add_file_fixed(blk_name(blk), NIAGARA_VDISK_BASE, -1);
+            rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, -1);
         } else {
-            error_report("could not load ram disk '%s'", blk_name(blk));
+            error_report("could not load ram disk '%s'",
+                         blk_bs(blk)->filename);
             exit(1);
         }
     }
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Markus Armbruster

This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107.

This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the inconvenience!

Ah so was this a case of replacing something that shouldn't have been replaced in the first place, or does it require a follow-up patch?

Quoted 22 lines
---
  hw/sparc64/niagara.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
hw/sparc64/niagara.c +1 -0
index 6725cc61fd..ab3c4ec346 100644
@@ -23,6 +23,7 @@
   */
 
  #include "qemu/osdep.h"
+#include "block/block_int-common.h"
  #include "qemu/units.h"
  #include "cpu.h"
  #include "hw/boards.h"
@@ -143,9 +144,10 @@ static void niagara_init(MachineState *machine)
              memory_region_add_subregion(get_system_memory(),
                                          NIAGARA_VDISK_BASE, &s->vdisk_ram);

hw/sparc64/niagara.c static void niagara_init(MachineState *machine) · line 153

Quoted 10 lines
hw/sparc64/niagara.c +3 -2
              dinfo->is_default = 1;
-            rom_add_file_fixed(blk_name(blk), NIAGARA_VDISK_BASE, -1);
+            rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, -1);
          } else {
-            error_report("could not load ram disk '%s'", blk_name(blk));
+            error_report("could not load ram disk '%s'",
+                         blk_bs(blk)->filename);
              exit(1);
          }
      }

Regardless of the above:

ATB,

Mark.

#2 lore raw
Quoted 8 lines · Mark Cave-Ayland
Quoted 4 lines · Markus Armbruster

This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107. This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the inconvenience!

Ah so was this a case of replacing something that shouldn't have been replaced in the first place, or does it require a follow-up patch?

I was looking at inclusions of block/block_int*.h outside the block subsystem, and went "Oh, I can get rid of this one!" Nope, brain malfunction.

Reducing such inclusions is always nice, but the code this patch restores isn't broken, and no follow-up fix is required.

Quoted 3 lines
Quoted 3 lines

[...]

Quoted 3 lines

Regardless of the above:

Thanks!

#3 lore raw
Quoted 9 lines · Markus Armbruster
Quoted 7 lines · Mark Cave-Ayland
Quoted 4 lines · Markus Armbruster

This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107. This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the inconvenience!

Quoted 5 lines
Quoted 1 line

Ah so was this a case of replacing something that shouldn't have been replaced in the first place, or does it require a follow-up patch?

I was looking at inclusions of block/block_int*.h outside the block subsystem, and went "Oh, I can get rid of this one!" Nope, brain malfunction.

x2, sorry :/

Quoted 16 lines

Reducing such inclusions is always nice, but the code this patch restores isn't broken, and no follow-up fix is required.

Quoted 3 lines
Quoted 3 lines

[...]

Quoted 3 lines

Regardless of the above:

Thanks!

#4 lore raw
In reply to Markus Armbruster
Quoted 28 lines · Markus Armbruster

This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107.

This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the inconvenience!

---
  hw/sparc64/niagara.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
hw/sparc64/niagara.c +1 -0
index 6725cc61fd..ab3c4ec346 100644
@@ -23,6 +23,7 @@
   */
 
  #include "qemu/osdep.h"
+#include "block/block_int-common.h"
  #include "qemu/units.h"
  #include "cpu.h"
  #include "hw/boards.h"
@@ -143,9 +144,10 @@ static void niagara_init(MachineState *machine)
              memory_region_add_subregion(get_system_memory(),
                                          NIAGARA_VDISK_BASE, &s->vdisk_ram);

hw/sparc64/niagara.c static void niagara_init(MachineState *machine) · line 153

Quoted 10 lines
hw/sparc64/niagara.c +3 -2
              dinfo->is_default = 1;
-            rom_add_file_fixed(blk_name(blk), NIAGARA_VDISK_BASE, -1);
+            rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, -1);
          } else {
-            error_report("could not load ram disk '%s'", blk_name(blk));
+            error_report("could not load ram disk '%s'",
+                         blk_bs(blk)->filename);
              exit(1);
          }
      }

Thanks - I've queued this to my qemu-sparc branch.

ATB,

Mark.