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

Conversation

atodorov-storpool
Copy link
Contributor

Signed-off-by: Anton Todorov a.todorov@storpool.com

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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 the libxml2 on which several libvirt 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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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>
@rsmontero rsmontero merged commit 4b17b1f into OpenNebula:master Feb 19, 2020
rsmontero pushed a commit that referenced this pull request Feb 19, 2020
Signed-off-by: Anton Todorov <a.todorov@storpool.com>
(cherry picked from commit 4b17b1f)
atodorov-storpool added a commit to storpool/one that referenced this pull request Feb 20, 2020
…#4168)

Signed-off-by: Anton Todorov <a.todorov@storpool.com>
(cherry picked from commit 4b17b1f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants