hw/core/null-machine: Do not initialize unused chardev backends
PATCH 1/1 hw/core/null-machine: Do not initialize unused chardev backends
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits 998bbd74b9d..aa40fc9c964 and ac33f8fad14).
As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the 'no_defaults' bits in its MachineClass.
--- hw/core/null-machine.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/core/null-machine.c +5 -0
@@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc) mc->max_cpus =1 ; mc->default_ram_size =0 ; mc->default_ram_id ="ram" ; + mc->no_serial =1 ; + mc->no_parallel =1 ; + mc->no_floppy =1 ; + mc->no_cdrom =1 ; + mc->no_sdcard =1 ; }DEFINE_MACHINE ("none" , machine_none_machine_init)
Signature · 1 line
2.21.3
Quoted 21 lines · Philippe Mathieu-Daudé
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits
998bbd74b9d..aa40fc9c964andac33f8fad14).As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the '
no_defaults' bits in its MachineClass.Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/core/null-machine.c | 5 +++++ 1 file changed, 5 insertions(+)hw/core/null-machine.c +0
-0@@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc) mc->max_cpus =1 ;
hw/core/null-machine.c static void machine_none_machine_init(MachineClass *mc) · line 60
Quoted 10 lines
hw/core/null-machine.c +5
-0mc->default_ram_size =0 ; mc->default_ram_id ="ram" ; + mc->no_serial =1 ; + mc->no_parallel =1 ; + mc->no_floppy =1 ; + mc->no_cdrom =1 ; + mc->no_sdcard =1 ; }DEFINE_MACHINE ("none" , machine_none_machine_init)
Laurent Vivier
AppliedLe 24/06/2020 à 13:01, Thomas Huth a écrit :
Quoted 26 lines · Philippe Mathieu-Daudé
Quoted 25 lines
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits
998bbd74b9d..aa40fc9c964andac33f8fad14).As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the '
no_defaults' bits in its MachineClass.Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/core/null-machine.c| 5 +++++1 file changed, 5 insertions(+)hw/core/null-machine.c +2
-0@@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc) mc->max_cpus = 1; mc->default_ram_size = 0; mc->default_ram_id = "ram"; + mc->no_serial = 1; + mc->no_parallel = 1;
Quoted 10 lines
hw/core/null-machine.c static void machine_none_machine_init(MachineClass *mc) · line 60
Quoted 6 lines
hw/core/null-machine.c +3
-0+ mc->no_floppy = 1; + mc->no_cdrom = 1; + mc->no_sdcard = 1; } DEFINE_MACHINE("none", machine_none_machine_init)Reviewed-by Thomas Huth <[email protected]>
Applied to my trivial-patches-for-5.1 branch.
Thanks,
Laurent
Le 06/07/2020 à 18:24, Laurent Vivier a écrit :
Quoted 38 lines
Le 24/06/2020 à 13:01, Thomas Huth a écrit :
Quoted 26 lines · Philippe Mathieu-Daudé
Quoted 25 lines
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits
998bbd74b9d..aa40fc9c964andac33f8fad14).As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the '
no_defaults' bits in its MachineClass.Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/core/null-machine.c| 5 +++++1 file changed, 5 insertions(+)hw/core/null-machine.c +2
-0@@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc) mc->max_cpus = 1; mc->default_ram_size = 0; mc->default_ram_id = "ram"; + mc->no_serial = 1; + mc->no_parallel = 1;Quoted 10 lines
hw/core/null-machine.c static void machine_none_machine_init(MachineClass *mc) · line 60
Quoted 6 lines
hw/core/null-machine.c +3
-0+ mc->no_floppy = 1; + mc->no_cdrom = 1; + mc->no_sdcard = 1; } DEFINE_MACHINE("none", machine_none_machine_init)Reviewed-by Thomas Huth <[email protected]>
Quoted 1 line
Applied to my trivial-patches-for-5.1 branch.
Removed as it is in Paolo's PR.
Thanks,
Laurent
Quoted 8 lines · Philippe Mathieu-Daudé
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits
998bbd74b9d..aa40fc9c964andac33f8fad14).As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the '
no_defaults' bits in its MachineClass.
Quoted 5 lines
Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/core/null-machine.c | 5 +++++ 1 file changed, 5 insertions(+)
r~
Paolo Bonzini
AppliedQuoted 21 lines · Philippe Mathieu-Daudé
The MachineClass uses an inverted logic (inherited from the PC machines [*]) to create the chardev backends for the default devices (see commits
998bbd74b9d..aa40fc9c964andac33f8fad14).As the none-machine doesn't have any hardware device, it is pointless to initialize chardev backends. Fix by setting the '
no_defaults' bits in its MachineClass.Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/core/null-machine.c | 5 +++++ 1 file changed, 5 insertions(+)hw/core/null-machine.c +0
-0@@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc) mc->max_cpus =1 ;
hw/core/null-machine.c static void machine_none_machine_init(MachineClass *mc) · line 60
Quoted 10 lines
hw/core/null-machine.c +5
-0mc->default_ram_size =0 ; mc->default_ram_id ="ram" ; + mc->no_serial =1 ; + mc->no_parallel =1 ; + mc->no_floppy =1 ; + mc->no_cdrom =1 ; + mc->no_sdcard =1 ; }DEFINE_MACHINE ("none" , machine_none_machine_init)
Queued, thanks.
Paolo