99
1010def run (test , params , env ):
1111 """
12- Hotplug/unplug GPU device
12+ Hotplug GPU device
13+ Note: Hotunplug is not supported for nvidia GPUs
1314 """
1415 vm_name = params .get ("main_vm" , "avocado-vt-vm1" )
1516 vm = env .get_vm (vm_name )
@@ -33,24 +34,9 @@ def run(test, params, env):
3334 gpu_test .install_latest_driver (vm_session )
3435 gpu_test .nvidia_smi_check (vm_session )
3536
36- test .log .info ("TEST_STEP: Unplug a gpu device from vm" )
37- vm_hostdev = vm_xml .VMXML .new_from_dumpxml (vm .name )\
38- .devices .by_device_tag ("hostdev" )[0 ]
39- virsh .detach_device (vm .name , vm_hostdev .xml ,
40- wait_for_event = True , event_timeout = 30 ,
41- ** virsh_args )
42- gpu_test .check_gpu_dev (vm , True )
43-
44- test .log .info ("TEST_STEP: Hotplug back the gpu device" )
45- virsh .attach_device (vm .name , gpu_dev .xml , ** virsh_args )
46- gpu_test .check_gpu_dev (vm )
47- gpu_test .nvidia_smi_check (vm_session )
48-
4937 test .log .info ("TEST_STEP: Check gpu device exclusivity" )
5038 res = virsh .attach_device (vm .name , gpu_dev .xml , debug = True )
5139 libvirt .check_result (res , "in use" )
52- gpu_test .check_gpu_dev (vm )
53- gpu_test .nvidia_smi_check (vm_session )
5440 vm_session .close ()
5541 finally :
5642 gpu_test .teardown_default ()
0 commit comments