Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backingchain/snapshot_blockpull: fix disk disovery #5429

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
from virttest import virt_vm
from virttest import virsh

from virttest import utils_disk


from virttest.utils_test import libvirt

from virttest.utils_libvirt import libvirt_disk
Expand Down Expand Up @@ -335,12 +332,9 @@ def start_middletotop_blkpull_on_vm():
# Initialize one NbdExport object
nbd = None

# Start VM and get all partitions in VM.
# Start VM
if vm.is_dead():
vm.start()
session = vm.wait_for_login()
old_parts = utils_disk.get_parts_list(session)
session.close()
vm.destroy(gracefully=False)

# Back up xml file.
Expand All @@ -359,7 +353,11 @@ def start_middletotop_blkpull_on_vm():
setup_nbd_env(params)
try:
vm.start()
vm.wait_for_login().close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd better to wait for vm login for other non-additional_disk scenarios, I mean keep this line for others. what do you think?

Copy link
Contributor Author

@smitterl smitterl Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yingshun Updated (s. following lines)

JOB ID     : b7a6f92be4e4aabd7060fa4faf68248b7420fbd9
JOB LOG    : /var/lib/avocado/job-results/job-2024-02-21T10.09-b7a6f92/job.log
 (1/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.auth_backend_test.native_path.middle_to_top_to_base: PASS (63.55 s)
 (2/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.block_backend_test.native_path.middle_to_top: PASS (38.42 s)
 (3/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.file_backend_test.native_path.async: PASS (35.63 s)
 (4/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.file_backend_test.native_path.bandwidth: PASS (30.31 s)
 (5/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.file_backend_test.native_path.timeout: PASS (29.71 s)
 (6/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.file_backend_test.native_path.middle_to_top: PASS (29.41 s)
 (7/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.file_backend_test.reuse_external.keep_relative: PASS (30.21 s)
 (8/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.nbd_backend_test.native_path.base_to_top: PASS (31.17 s)
 (9/9) type_specific.io-github-autotest-libvirt.virtual_disks.snapshot_blockpull.positive_test.nbd_backend_test.native_path.middle_to_top: PASS (30.77 s)
RESULTS    : PASS 9 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2024-02-21T10.09-b7a6f92/results.html
JOB TIME   : 319.78 s

session = vm.wait_for_login()
disk_name = device_target
if additional_disk:
disk_name, _ = libvirt_disk.get_non_root_disk_name(session)
session.close()
except virt_vm.VMStartError as details:
# VM cannot be started
if status_error:
Expand All @@ -368,7 +366,7 @@ def start_middletotop_blkpull_on_vm():
test.fail("VM should start but failed: %s" % str(details))

if fill_in_vm:
libvirt_disk.fill_null_in_vm(vm, device_target)
libvirt_disk.fill_null_in_vm(vm, disk_name)

if backend_path in ['native_path']:
external_snapshot_disks = libvirt_disk.make_external_disk_snapshots(vm, device_target, "blockpull_snapshot", snapshot_take)
Expand Down
Loading