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

B #4164: Use xmllint to test disk target device #4168

Merged
merged 1 commit into from
Feb 19, 2020
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
5 changes: 3 additions & 2 deletions src/vmm_mad/remotes/kvm/detach_disk
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ DETACH_PARAMS="--domain $DOMAIN --target $TARGET"
exec_and_log "virsh --connect $LIBVIRT_URI detach-disk $DETACH_PARAMS" \
"Could not detach $TARGET from $DOMAIN"

virsh --connect $LIBVIRT_URI dumpxml $DOMAIN | grep $TARGET > /dev/null 2>&1
virsh --connect $LIBVIRT_URI dumpxml $DOMAIN | \
xmllint -xpath "//disk/target[@dev='$TARGET']" - >/dev/null 2>&1

if [ $? -eq 0 ] ; then
if [ $? -ne 0 ] ; then
error_message "Could not detach $TARGET from $DOMAIN"
exit -1
fi
Expand Down