-
Notifications
You must be signed in to change notification settings - Fork 498
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
Conversation
src/vmm_mad/remotes/kvm/detach_disk
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will adds xmllint
to dependencies, wouldn't be better to use /var/tmp/one/datastore/xpath.rb
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following reasons:
xmllint
is part of thelibxml2
on which severallibvirt
sub-packages depends- the exit code of
xpath.rb
could not be used. I hate adding unnecessary piping/processing just to get an exit status.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and augeas
;-)
So it is already available due to required dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, so I also prefer using xmllint
. One small thing, there seems to be missing -
(hyphen sign) as a last xmllint parameter to even process the stdin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. stupid typo :)
how do you prefer - to push second commit or edit and force-push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter, you can force-push or add another commit, which will be squashed when merging.
Signed-off-by: Anton Todorov <a.todorov@storpool.com>
741c35d
to
2ff6fe8
Compare
Signed-off-by: Anton Todorov a.todorov@storpool.com