diff --git a/virttest/utils_test/libvirt.py b/virttest/utils_test/libvirt.py index 235cebc5d12..ffab4d5a53b 100644 --- a/virttest/utils_test/libvirt.py +++ b/virttest/utils_test/libvirt.py @@ -2876,8 +2876,9 @@ def create_scsi_disk(scsi_option, scsi_size="2048"): # Unload it first if it's already loaded. if linux_modules.module_is_loaded("scsi_debug"): linux_modules.unload_module("scsi_debug") - linux_modules.load_module("scsi_debug dev_size_mb=%s %s" % - (scsi_size, scsi_option)) + utils_misc.wait_for(lambda: linux_modules.load_module("scsi_debug dev_size_mb=%s %s" % + (scsi_size, scsi_option)), + timeout=10, ignore_errors=True) # Get the scsi device name result = process.run("lsscsi|grep scsi_debug|awk '{print $6}'", shell=True)