qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/1] qom-get access to kernel-irqchip property
@ 2018-12-24 11:52 Wainer dos Santos Moschetta
  2018-12-24 11:52 ` [Qemu-devel] [RFC PATCH 1/1] hw/core: add qom getter for " Wainer dos Santos Moschetta
  0 siblings, 1 reply; 4+ messages in thread
From: Wainer dos Santos Moschetta @ 2018-12-24 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: ehabkost, marcel.apfelbaum, peterx

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-27 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-24 11:52 [Qemu-devel] [RFC PATCH 0/1] qom-get access to kernel-irqchip property Wainer dos Santos Moschetta
2018-12-24 11:52 ` [Qemu-devel] [RFC PATCH 1/1] hw/core: add qom getter for " Wainer dos Santos Moschetta
2018-12-25  5:20   ` Peter Xu
2018-12-27 20:33     ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).