]> git.ipfire.org Git - thirdparty/libvirt.git/commit
securityselinuxlabeltest: Prefer virGetLastErrorMessage() over virGetLastError
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Aug 2016 07:20:31 +0000 (09:20 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Aug 2016 13:32:20 +0000 (15:32 +0200)
commit1758ee4a94f8d92daaa71aabd2f05c14f98c987e
tree4ad039ac7ee4adb5ba958b7819ff7b3777682b31
parent84b476e2bd20305d88840443c91ce2f5c01dd123
securityselinuxlabeltest: Prefer virGetLastErrorMessage() over virGetLastError

At the beginning of the test, some preparation work is done. For
instance new virSecurityManager is created. If this fails for
whatever reason, we try to fetch the latest error and print the
error message contained in it. However, if there's a bug in our
code and no error is reported, this approach will lead to crash,
while with virGetLastErrorMessage() it won't.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/securityselinuxlabeltest.c