tp-qemu icon indicating copy to clipboard operation
tp-qemu copied to clipboard

win_driver_utils: Add interface to enable/disable driver for windows

Open menli820 opened this issue 2 years ago • 2 comments

Add interface to enable/disable driver for windows.

ID:2149494 Signed-off-by: Menghuan Li [email protected]

menli820 avatar Nov 30 '22 13:11 menli820

related log: [stdlog] 2022-11-30 07:55:46,460 aexpect.client DEBUG| Sending command: wmic path win32_pnpsigneddriver where (DeviceName like 'Red Hat VirtIO SCSI controller') get DeviceID /format:list [stdlog] 2022-11-30 07:55:47,977 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:55:48,084 avocado.virttest.virt_vm DEBUG| Attempting to log into 'avocado-vt-vm1' (timeout 240s) [stdlog] 2022-11-30 07:55:48,084 avocado.virttest.virt_vm DEBUG| Found/Verified IP 10.73.75.187 for VM avocado-vt-vm1 NIC 0 [stdlog] 2022-11-30 07:55:48,850 aexpect.client DEBUG| Sending command: wmic logicaldisk where (VolumeName='WIN_UTILS') get DeviceID [stdlog] 2022-11-30 07:55:49,046 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:55:49,153 aexpect.client DEBUG| Sending command: wmic logicaldisk where (VolumeName='WIN_UTILS') get DeviceID [stdlog] 2022-11-30 07:55:49,343 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:55:49,449 aexpect.client DEBUG| Sending command: D:\devcon\amd64\devcon.exe disable "@PCI\VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01\4&24F6AFB5&0&000B" [stdlog] 2022-11-30 07:55:50,785 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:56:00,902 avocado.virttest.virt_vm DEBUG| Attempting to log into 'avocado-vt-vm1' (timeout 240s) [stdlog] 2022-11-30 07:56:00,903 avocado.virttest.virt_vm DEBUG| Found/Verified IP 10.73.75.187 for VM avocado-vt-vm1 NIC 0 [stdlog] 2022-11-30 07:56:01,683 aexpect.client DEBUG| Sending command: wmic logicaldisk where (VolumeName='WIN_UTILS') get DeviceID [stdlog] 2022-11-30 07:56:01,882 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:56:01,989 aexpect.client DEBUG| Sending command: wmic logicaldisk where (VolumeName='WIN_UTILS') get DeviceID [stdlog] 2022-11-30 07:56:02,184 aexpect.client DEBUG| Sending command: echo %errorlevel% [stdlog] 2022-11-30 07:56:02,291 aexpect.client DEBUG| Sending command: D:\devcon\amd64\devcon.exe enable "@PCI\VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01\4&24F6AFB5&0&000B" [stdlog] 2022-11-30 07:56:02,636 aexpect.client DEBUG| Sending command: echo %errorlevel%

menli820 avatar Nov 30 '22 13:11 menli820

@peixiu @leidwang @vivianQizhu please help to review it when you free, thanks

menli820 avatar Dec 01 '22 02:12 menli820

python ConfigTest.py --testcase=iozone_windows --guestname=Win2022 --platform=x86_64 --clone=yes --driveformat=virtio_blk --machines=q35

(1/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED
 (1/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: PASS (718.06 s)
 (2/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.aio_native.q35: STARTED
 (2/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.aio_native.q35: PASS (211.72 s)
 (3/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.aio_threads.q35: STARTED
 (3/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.aio_threads.q35: PASS (199.26 s)
 (4/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.long_time_stress.q35: STARTED
 (4/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.long_time_stress.q35: PASS (366.05 s)
 (5/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.with_gpt_disk.q35: STARTED
 (5/5) Host_RHEL.m9.u2.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.iozone_windows.with_gpt_disk.q35: PASS (199.83 s)
RESULTS    : PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /root/avocado/job-results/job-2022-12-26T02.57-87dbb7f/results.html

menli820 avatar Dec 26 '22 09:12 menli820

@vivianQizhu Please help to check whether this method is acceptable when you free , thanks

menli820 avatar Jan 12 '23 06:01 menli820

@peixiu @xiagao @6-dehan @leidwang Please help test it and check if your cfg need to be updated if we merge this patch. And if so please help add comment here or open PR directly. Basically it move the memory leak check method from uninstall/install to disable/enable. I suppose if you have device_name and device_hwid defined then it would be okay. @menli820 Please correct me if I was wrong.

vivianQizhu avatar Jan 13 '23 01:01 vivianQizhu

@vivianQizhu we need to define "driver_disable_cmd and driver_enable_cmd " cmd in the cfg, so we still need to update the cases that merged before.

I can modify them together in this patch in case there is time gap that causes some expected errors when running test loops.

menli820 avatar Jan 13 '23 01:01 menli820

@xiagao @leidwang please help to review the balloon, virtiofs, pvpanic part. For other features , have separate patch (not merged) or not start yet.

menli820 avatar Jan 13 '23 06:01 menli820

Virtiofs and balloon related config are all included. The results are also good. LGTM (1/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED (1/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: PASS (1426.63 s) (2/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_in_use.with_shutdown.during_bg_test.q35: STARTED (2/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_in_use.with_shutdown.during_bg_test.q35: PASS (696.60 s) (3/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_service.small_polling_interval.q35: STARTED (3/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_service.small_polling_interval.q35: PASS (1399.08 s) (4/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data.with_cache.auto.q35: STARTED (4/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data.with_cache.auto.q35: ERROR: Login timeout expired (output: 'exceeded 202 s timeout, last failure: Could not verify DHCP lease: 9a:96:2e:f6:36:a3 --> 10.73.74.142') (589.72 s) --other issue (5/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data_hugepage.with_numa.basic_test.with_cache.none.q35: STARTED (5/5) Host_RHEL.m8.u8.product_rhel.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data_hugepage.with_numa.basic_test.with_cache.none.q35: PASS (393.05 s)

xiagao avatar Jan 28 '23 08:01 xiagao

Hi @menli820 It is not necessary to define driver_enable_cmd and driver_disable_cmd in all the cfg files, we could construct them inside the .py script.

vivianQizhu avatar Jan 29 '23 07:01 vivianQizhu

@vivianQizhu please help to check it again when you free, thanks

menli820 avatar Jan 30 '23 05:01 menli820

@vivianQizhu Thanks,feel free to check it again.

menli820 avatar Jan 31 '23 09:01 menli820

@xiagao @leidwang Please help review the latest version, thanks!

vivianQizhu avatar Feb 01 '23 05:02 vivianQizhu

Added @peixiu for the scsi part, thanks

menli820 avatar Feb 01 '23 05:02 menli820

Test two cases related with virtiofs and balloon, both of them passed. (1/2) Host_RHEL.m9.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data.with_cache.auto.q35: STARTED (1/2) Host_RHEL.m9.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.virtio_fs_share_data.with_cache.auto.q35: PASS (241.84 s) (2/2) Host_RHEL.m9.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_check.balloon_evict_and_enlarge.balloon_base.q35: STARTED (2/2) Host_RHEL.m9.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.balloon_check.balloon_evict_and_enlarge.balloon_base.q35: PASS (686.91 s)

LGTM.

xiagao avatar Feb 01 '23 07:02 xiagao

Looks good to me, thanks a lot @menli820 ~

python ConfigTest.py --testcase=block_hotplug_scsi_hba,block_resize_unplug,fio_windows --guestname=Win2022 --platform=x86_64 --clone=no --driveformat=virtio_scsi --machines=q35

(1/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.enlarge_disk.send_qmp.reboot_vm.q35: STARTED (1/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.enlarge_disk.send_qmp.reboot_vm.q35: PASS (369.53 s) (2/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.enlarge_disk.send_shell.reboot_vm.q35: STARTED (2/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.enlarge_disk.send_shell.reboot_vm.q35: PASS (342.39 s) (3/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.shrink_disk.send_qmp.reboot_vm.q35: STARTED (3/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.shrink_disk.send_qmp.reboot_vm.q35: PASS (281.64 s) (4/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.shrink_disk.send_shell.reboot_vm.q35: STARTED (4/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_resize_unplug.shrink_disk.send_shell.reboot_vm.q35: PASS (306.58 s) (5/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.fio_windows.aio_native.q35: STARTED (5/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.fio_windows.aio_native.q35: PASS (542.47 s) (6/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.fio_windows.aio_threads.q35: STARTED (6/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.fio_windows.aio_threads.q35: PASS (508.01 s) (7/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_hotplug_scsi_hba.with_hotplug_on.q35: STARTED (7/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_hotplug_scsi_hba.with_hotplug_on.q35: PASS (241.55 s) (8/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_hotplug_scsi_hba.with_hotplug_off.q35: STARTED (8/8) Host_RHEL.m9.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.block_hotplug_scsi_hba.with_hotplug_off.q35: PASS (273.24 s)

peixiu avatar Feb 01 '23 08:02 peixiu

Thanks all. Let's have it.

vivianQizhu avatar Feb 01 '23 08:02 vivianQizhu