[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS |
Date: |
Mon, 7 Sep 2020 05:39:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
You forgot to Cc the maintainers, doing it for you:
./scripts/get_maintainer.pl -f hw/core/null-machine.c
Eduardo Habkost <ehabkost@redhat.com> (supporter:Machine core)
Marcel Apfelbaum <marcel.apfelbaum@gmail.com> (supporter:Machine core)
On 9/3/20 2:58 AM, Huacai Chen wrote:
> Hi, Philippe,
>
> On Wed, Sep 2, 2020 at 9:55 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> Hi Huacai,
>>
>> On 8/24/20 10:11 AM, Huacai Chen wrote:
>>> MIPS has two types of KVM: TE & VZ, and TE is the default type. Now,
>>> libvirt uses a null-machine to detect the kvm capability. In the MIPS
>>> case, it will return "KVM not supported" on a VZ platform by default.
>>> So, add the kvm_type() hook to the null-machine.
>>>
>>> This seems not a very good solution, but I cannot do it better now.
>>>
>>> Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
>>> Signed-off-by: Huacai Chen <chenhc@lemote.com>
>>> Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>>> ---
>>> hw/core/meson.build | 2 +-
>>> hw/core/null-machine.c | 6 ++++++
>>> 2 files changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/hw/core/meson.build b/hw/core/meson.build
>>> index fc91f98..b6591b9 100644
>>> --- a/hw/core/meson.build
>>> +++ b/hw/core/meson.build
>>> @@ -35,7 +35,6 @@ softmmu_ss.add(files(
>>> 'machine-hmp-cmds.c',
>>> 'machine.c',
>>> 'nmi.c',
>>> - 'null-machine.c',
>>> 'qdev-fw.c',
>>> 'qdev-properties-system.c',
>>> 'sysbus.c',
>>> @@ -45,5 +44,6 @@ softmmu_ss.add(files(
>>>
>>> specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files(
>>> 'machine-qmp-cmds.c',
>>> + 'null-machine.c',
>>> 'numa.c',
>>> ))
>>> diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
>>> index 7e69352..4b4ab76 100644
>>> --- a/hw/core/null-machine.c
>>> +++ b/hw/core/null-machine.c
>>> @@ -17,6 +17,9 @@
>>> #include "sysemu/sysemu.h"
>>> #include "exec/address-spaces.h"
>>> #include "hw/core/cpu.h"
>>> +#ifdef TARGET_MIPS
>>> +#include "kvm_mips.h"
>>> +#endif
>>>
>>> static void machine_none_init(MachineState *mch)
>>> {
>>> @@ -55,6 +58,9 @@ static void machine_none_machine_init(MachineClass *mc)
>>> mc->no_floppy = 1;
>>> mc->no_cdrom = 1;
>>> mc->no_sdcard = 1;
>>> +#ifdef TARGET_MIPS
>>> + mc->kvm_type = mips_kvm_type;
>>> +#endif
>>
>> I'm a bit confused here, you are taking the same path from your v4...
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg712550.html
>>
>> Did you rebase the correct version?
> The old patch has split to two parts, the first part is used by MIPS
> machine and already merged. This is the second part used by the
> null-machine (and libvirt use null-machine to detect kvm
> capabilities).
>
> Huacai
>>
>>> }
>>>
>>> DEFINE_MACHINE("none", machine_none_machine_init)
>>>
>