Created
March 14, 2019 19:58
-
-
Save SegFaultAX/9a21d5bd69d804d7acab1906b044795e to your computer and use it in GitHub Desktop.
vmGuestLib [Python] [ctypes]
This file contains hidden or 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