[Qemu-devel] [RFC PATCH 0/1] qom-get access to kernel-irqchip property

Wainer dos Santos Moschetta posted 1 patch 6 years, 10 months ago
Test asan passed
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181224115235.16881-1-wainersm@redhat.com
hw/core/machine.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
[Qemu-devel] [RFC PATCH 0/1] qom-get access to kernel-irqchip property
Posted by Wainer dos Santos Moschetta 6 years, 10 months ago
On preparing to test Peter Xu's "q35: change defaults for kernel irqchip and
IR" patch [1] I realized that kernel-irqchip property of the Machine
Class object cannot be read via qom-get api.

Actually there isn't such as kernel_irqchip property, rather it is
a compound of kernel_irqchip_allowed, kernel_irqchip_required, and
kernel_irqchip_split. Maybe that is the reason why a getter for
kernel-irqchip was not implemented. Thus, as I don't have all the context,
I prefer to submit this a RFC implementation.

It was tested using the following code that I don't think is worth to
merge with this series, although I would like to keep it here as a
reference:

from avocado_qemu import Test

class MachineKernelIrqChip(Test):
    """
    :avocado: enable
    """
    def get_kernel_irqchip(self):
        return self.vm.command('qom-get', path='/machine',
                                          property='kernel-irqchip')
    def test_default(self):
        self.vm.add_args('-M', 'q35,accel=kvm')
        self.vm.launch()
        self.assertEqual(self.get_kernel_irqchip(), 'off')

    def test_off(self):
        self.vm.add_args('-M', 'q35,accel=kvm,kernel-irqchip=off')
        self.vm.launch()
        self.assertEqual(self.get_kernel_irqchip(), 'off')

    def test_on(self):
        self.vm.add_args('-M', 'q35,accel=kvm,kernel-irqchip=on')
        self.vm.launch()
        self.assertEqual(self.get_kernel_irqchip(), 'on')

    def test_split(self):
        self.vm.add_args('-M', 'q35,accel=kvm,kernel-irqchip=split')
        self.vm.launch()
        self.assertEqual(self.get_kernel_irqchip(), 'split')

References:
[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg582840.html

Wainer dos Santos Moschetta (1):
  hw/core: add qom getter for kernel-irqchip property

 hw/core/machine.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

-- 
2.19.2