[Kimchi-devel] [PATCH 0/3] Add usb xhci controller for hotplug on Power

Daniel Henrique Barboza dhbarboza82 at gmail.com
Thu Jul 9 14:33:53 UTC 2015


I've reviewed +1 in all the patches of this set, but before pushing it 
to master
I would like to ask you to add a new unit test to verify that this code 
behaves
as you expect it to.

You didn't break any existing unit test in pkvm and there is a good 
chance that
this code is being tested somehow in any of those, but I strongly 
encourage to
make an explicit unit test to the exact behavior you're adding/changing.

You can do something like this in test_model.py:

def _host_is_PKVM():
     distro, _, _ = platform.linux_distribution()
     return distro is 'IBM_PowerKVM'

@unittest.skipUnless(_host_is_PKVM())
def test_pci_hotplug_requires_xhci_usb_controller():
     # check the xhci or any other required host/device condition

     # if condition is True: hotplug a pci device should happen with
     # no errors. You can see how other tests do the hotplug and replicate
     # it here

     # elif condition is False: the code should thrown the InvalidOperation
     # exception with the code "KCHVMHDEV0006E"


Thanks,


Daniel


On 07/08/2015 02:42 PM, Jose Ricardo Ziviani wrote:
> Power system requires an USB XHCI controller in order to allow PCI
> hotplug. This patch adds such controller by default when creating a new
> VM and inform the users if a VM currently doesn't have the controller.
>
> Jose Ricardo Ziviani (3):
>    Add a new error code for pci hotplug
>    Check for usb xhci controller in Power platform
>    Define the USB xhci controller in the template for Power Systems
>
>   src/kimchi/i18n.py             |  1 +
>   src/kimchi/model/vmhostdevs.py | 28 +++++++++++++++++++++++++++-
>   src/kimchi/vmtemplate.py       | 17 +++++++++++++++++
>   3 files changed, 45 insertions(+), 1 deletion(-)
>




More information about the Kimchi-devel mailing list