qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Romero <gustavo.romero@linaro.org>
To: qemu-devel@nongnu.org, eric.auger@redhat.com
Cc: qemu-arm@nongnu.org, thuth@redhat.com, alex.bennee@linaro.org
Subject: Re: [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug
Date: Tue, 27 May 2025 23:13:42 -0300	[thread overview]
Message-ID: <67a82638-b4b7-43e3-8108-42f1a18a0162@linaro.org> (raw)
In-Reply-To: <20250527150229.1617074-3-gustavo.romero@linaro.org>



On 5/27/25 12:02, Gustavo Romero wrote:
> Currently, test_aarch64_hotplug_pci only tests PCI hotplug using the
> native PCI hotplug mechanism. Now that aarch64 supports PCI hotplug via
> the ACPI mechanism it's time to support it in the test as well.
> 
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
>   tests/functional/test_aarch64_hotplug_pci.py | 24 +++++++++++++++++++-
>   1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
> index bb2c121503..862bb6746b 100755
> --- a/tests/functional/test_aarch64_hotplug_pci.py
> +++ b/tests/functional/test_aarch64_hotplug_pci.py
> @@ -27,11 +27,26 @@ class HotplugPCI(LinuxKernelTest):
>            'current/images/netboot/debian-installer/arm64/initrd.gz'),
>           '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
>   
> -    def test_hotplug_pci(self):
> +    def run_vm_and_test_hotplug_pci(self, use_acpi_pci_hotplug=False):
> +        """
> +        Run an aarch64 VM and test the PCI hotplug mechanism by plugging and
> +        unplugging a PCI network adapter to the VM. Proper plug and unplug of
> +        the adapter is verified by checking if the network device is correctly
> +        added and removed in Linux.
> +
> +        Parameters
> +        ----------
> +        use_acpi_pci_hotplug : bool
> +            If true the ACPI PCI hotplug mechanim is used, otherwise the
> +            Native PCIe Hotplug mechanism is used.
> +        """
> +
> +        acpi_pci_hotplug = "on" if use_acpi_pci_hotplug else "off"
>   
>           self.set_machine('virt')
>           self.vm.add_args('-m', '512M')
>           self.vm.add_args('-cpu', 'cortex-a57')
> +        self.vm.add_args('-machine', f"acpi-pcihp={acpi_pci_hotplug}")
>           self.vm.add_args('-append',
>                            'console=ttyAMA0,115200 init=/bin/sh')
>           self.vm.add_args('-device',
> @@ -70,5 +85,12 @@ def test_hotplug_pci(self):
>                                             'ls -l /sys/class/net | wc -l',
>                                             '2')
>   
> +    def test_native_pci_hotplug(self):
> +        self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=False)
> +
> +    def test_acpi_pci_hotplug(self):
> +        self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=True)
> +
> +
>   if __name__ == '__main__':
>       LinuxKernelTest.main()

Re-posted here as a single patch:

https://lists.nongnu.org/archive/html/qemu-devel/2025-05/msg06332.html

I missed the Based-on: 20250527074224.1197793-1-eric.auger@redhat.com tag :-/


Cheers,
Gustavo


      reply	other threads:[~2025-05-28  2:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 15:02 [PATCH 0/2] Add functional test for ACPI PCI hotplug Gustavo Romero
2025-05-27 15:02 ` [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA Gustavo Romero
2025-05-27 15:11   ` Thomas Huth
2025-05-28  2:09     ` Gustavo Romero
2025-05-27 15:02 ` [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Gustavo Romero
2025-05-28  2:13   ` Gustavo Romero [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67a82638-b4b7-43e3-8108-42f1a18a0162@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=eric.auger@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).