mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libxl: define libxl_vnc_info to hold all info about the vnc info
Reduces duplication in libxl_vfb and libxl_device_model. Updated bindings but the python ones in particular are unlikely to be useful until a user presents itself and fixes them up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
This commit is contained in:
1 parent
a59e9ff002
commit
6b320d280f
6 files changed
+91
-86
No files matched your search
@@ -4,7 +4,7 @@ import sys,os
|
||||
|
||||
import libxltypes
|
||||
|
||||
(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING) = range(4)
|
||||
(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(5)
|
||||
|
||||
def py_type(ty):
|
||||
if ty == libxltypes.bool:
|
||||
@@ -16,6 +16,8 @@ def py_type(ty):
|
||||
return TYPE_INT
|
||||
else:
|
||||
return TYPE_UINT
|
||||
if isinstance(ty, libxltypes.Aggregate):
|
||||
return TYPE_AGGREGATE
|
||||
if ty == libxltypes.string:
|
||||
return TYPE_STRING
|
||||
return None
|
||||
@@ -66,6 +68,9 @@ def py_attrib_get(ty, f):
|
||||
l.append(' return genwrap__ull_get(self->obj.%s);'%f.name)
|
||||
elif t == TYPE_STRING:
|
||||
l.append(' return genwrap__string_get(&self->obj.%s);'%f.name)
|
||||
elif t == TYPE_AGGREGATE:
|
||||
l.append(' PyErr_SetString(PyExc_NotImplementedError, "Getting %s");'%ty.typename)
|
||||
l.append(' return NULL;')
|
||||
else:
|
||||
tn = f.type.typename
|
||||
l.append(' return attrib__%s_get((%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
|
||||
@@ -92,6 +97,9 @@ def py_attrib_set(ty, f):
|
||||
l.append(' return ret;')
|
||||
elif t == TYPE_STRING:
|
||||
l.append(' return genwrap__string_set(v, &self->obj.%s);'%f.name)
|
||||
elif t == TYPE_AGGREGATE:
|
||||
l.append(' PyErr_SetString(PyExc_NotImplementedError, "Setting %s");'%ty.typename)
|
||||
l.append(' return -1;')
|
||||
else:
|
||||
tn = f.type.typename
|
||||
l.append(' return attrib__%s_set(v, (%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
|
||||
|
||||