tp-libvirt
tp-libvirt copied to clipboard
virsh_attach_device: make sure device is ready before attaching a new device
/dev/vdX in guest may be inconsistent with disk->target@dev in XML, if the old device is not ready in guest before attaching a new device to the guest.
Before:
# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio virsh.attach_device.block.multi_virtio_file.with_alias.normal_test.hot_attach_hot_vm_current.name_ref.file_positional.domain_positional --vt-connect-uri qemu:///system
JOB ID : 98178aac2a79dc233e2ed45374cda6fc85a989a8
JOB LOG : /var/lib/avocado/job-results/job-2022-10-12T14.22-98178aa/job.log
(1/1) type_specific.io-github-autotest-libvirt.virsh.attach_device.block.multi_virtio_file.with_alias.normal_test.hot_attach_hot_vm_current.name_ref.file_positional.domain_positional: FAIL: Positive pre-boot functionality test failed (285.12 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/lib/avocado/job-results/job-2022-10-12T14.22-98178aa/results.html
JOB TIME : 286.19 s
After:
# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio virsh.attach_device.block.multi_virtio_file.with_alias.normal_test.hot_attach_hot_vm_current.name_ref.file_positional.domain_positional --vt-connect-uri qemu:///system
JOB ID : a17c92bbbe012f399746c7d97a6a5caf70119d66
JOB LOG : /var/lib/avocado/job-results/job-2022-10-17T03.12-a17c92b/job.log
(1/1) type_specific.io-github-autotest-libvirt.virsh.attach_device.block.multi_virtio_file.with_alias.normal_test.hot_attach_hot_vm_current.name_ref.file_positional.domain_positional: PASS (214.01 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/lib/avocado/job-results/job-2022-10-17T03.12-a17c92b/results.html
JOB TIME : 215.10 s
Signed-off-by: Hu Shuai [email protected]
@Yingshun PTAL.
/hold, this patch will cause some other cases to fail, checking now.
Just wait a while before attaching a new device to make sure that /dev/vdX in guest be consistent with disk->target@dev in XML.