Created
March 14, 2019 19:58
Star
You must be signed in to star a gist
vmGuestLib [Python] [ctypes]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import CDLL, c_void_p, byref | |
from ctypes.util import find_library | |
# The following code fails on ubuntu 18.04, but succeeds on 14.04 | |
lib = CDLL(find_library('guestlib')) | |
handle = c_void_p() | |
ret = lib.VMGuestLib_OpenHandle(byref(handle)) | |
if ret != 0: | |
raise RuntimeError("failed to get handle") | |
ret = lib.VMGuestLib_UpdateInfo(handle.value) | |
if ret != 0: | |
raise RuntimeError("unable to update guest information") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment