namespace("libxl__")
hidden(True)

libxl_domid = Builtin("domid", namespace="libxl_", json_gen_fn = "yajl_gen_integer",
		      json_parse_fn = "libxl__uint32_parse_json", json_parse_type = "JSON_INTEGER",
		      autogenerate_json = False, copy_fn = None)

libxl__qmp_message_type = Enumeration("qmp_message_type", [
    (1, "QMP"),
    (2, "return"),
    (3, "error"),
    (4, "event"),
    (5, "invalid"),
    ])

libxl__device_kind = Enumeration("device_kind", [
    (0, "NONE"),
    (1, "VIF"),
    (2, "VBD"),
    (3, "QDISK"),
    (4, "PCI"),
    (5, "VFB"),
    (6, "VKBD"),
    (7, "CONSOLE"),
    (8, "VTPM"),
    (9, "VUSB"),
    (10, "QUSB"),
    ])

libxl__console_backend = Enumeration("console_backend", [
    (1, "XENCONSOLED"),
    (2, "IOEMU"),
    ])

libxl__device_console = Struct("device_console", [
    ("backend_domid", libxl_domid),
    ("devid", integer),
    ("consback", libxl__console_backend),
    ("output", string),
    # A regular console has no name.
    # A console with a name is called a 'channel', see docs/misc/channels.txt
    ("name", string),
    ("connection", string),
    ("path", string),
    ])

libxl__device_action = Enumeration("device_action", [
    (1, "ADD"),
    (2, "REMOVE"),
    ])
