# -*- python -*- # # Builtin libxl types # namespace("libxl_") libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False) libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE) libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE) libxl_cpumap = Builtin("cpumap", dispose_fn="libxl_cpumap_dispose", passby=PASS_BY_REFERENCE) libxl_cpuarray = Builtin("cpuarray", dispose_fn="libxl_cpuarray_dispose", passby=PASS_BY_REFERENCE) libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE) libxl_string_list = Builtin("string_list", dispose_fn="libxl_string_list_dispose", passby=PASS_BY_REFERENCE) libxl_key_value_list = Builtin("key_value_list", dispose_fn="libxl_key_value_list_dispose", passby=PASS_BY_REFERENCE) libxl_file_reference = Builtin("file_reference", dispose_fn="libxl_file_reference_dispose", passby=PASS_BY_REFERENCE) libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE) # # Constants / Enumerations # libxl_domain_type = Enumeration("domain_type", [ (1, "HVM"), (2, "PV"), ]) libxl_device_model_version = Enumeration("device_model_version", [ (1, "QEMU_XEN_TRADITIONAL", "Historical qemu-xen device model (qemu-dm)"), (2, "QEMU_XEN", "Upstream based qemu-xen device model"), ]) libxl_console_type = Enumeration("console_type", [ (1, "SERIAL"), (2, "PV"), ]) libxl_console_backend = Enumeration("console_backend", [ (1, "XENCONSOLED"), (2, "IOEMU"), ]) libxl_disk_format = Enumeration("disk_format", [ (0, "UNKNOWN"), (1, "QCOW"), (2, "QCOW2"), (3, "VHD"), (4, "RAW"), (5, "EMPTY"), ]) libxl_disk_backend = Enumeration("disk_backend", [ (0, "UNKNOWN"), (1, "PHY"), (2, "TAP"), (3, "QDISK"), ]) libxl_nic_type = Enumeration("nic_type", [ (1, "IOEMU"), (2, "VIF"), ]) libxl_action_on_shutdown = Enumeration("action_on_shutdown", [ (1, "DESTROY"), (2, "RESTART"), (3, "RESTART_RENAME"), (4, "PRESERVE"), (5, "COREDUMP_DESTROY"), (6, "COREDUMP_RESTART"), ]) libxl_event_type = Enumeration("event_type", [ (1, "DOMAIN_DEATH"), (2, "DISK_EJECT"), ]) libxl_button = Enumeration("button", [ (1, "POWER"), (2, "SLEEP"), ]) libxl_tsc_mode = Enumeration("tsc_mode", [ (0, "default"), (1, "always_emulate"), (2, "native"), (3, "native_paravirt"), ]) # # Complex libxl types # libxl_dominfo = Struct("dominfo",[ ("uuid", libxl_uuid), ("domid", libxl_domid), ("ssidref", uint32), ("running", bool), ("blocked", bool), ("paused", bool), ("shutdown", bool), ("dying", bool), ("shutdown_reason", uint8, False, """Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying). Otherwise set to a value guaranteed not to clash with any valid SHUTDOWN_* constant."""), ("current_memkb", uint64), ("shared_memkb", uint64), ("max_memkb", uint64), ("cpu_time", uint64), ("vcpu_max_id", uint32), ("vcpu_online", uint32), ("cpupool", uint32), ], dispose_fn=None) libxl_cpupoolinfo = Struct("cpupoolinfo", [ ("poolid", uint32), ("sched_id", uint32), ("n_dom", uint32), ("cpumap", libxl_cpumap) ]) libxl_vminfo = Struct("vminfo", [ ("uuid", libxl_uuid), ("domid", libxl_domid), ], dispose_fn=None) libxl_version_info = Struct("version_info", [ ("xen_version_major", integer), ("xen_version_minor", integer), ("xen_version_extra", string), ("compiler", string), ("compile_by", string), ("compile_domain", string), ("compile_date", string), ("capabilities", string), ("changeset", string), ("virt_start", uint64), ("pagesize", integer), ("commandline", string), ]) libxl_domain_create_info = Struct("domain_create_info",[ ("type", libxl_domain_type), ("hap", bool), ("oos", bool), ("ssidref", uint32), ("name", string), ("uuid", libxl_uuid), ("xsdata", libxl_key_value_list), ("platformdata", libxl_key_value_list), ("poolid", uint32), ("poolname", string), ]) libxl_domain_build_info = Struct("domain_build_info",[ ("max_vcpus", integer), ("cur_vcpus", integer), ("tsc_mode", libxl_tsc_mode), ("max_memkb", uint32), ("target_memkb", uint32), ("video_memkb", uint32), ("shadow_memkb", uint32), ("disable_migrate", bool), ("cpuid", libxl_cpuid_policy_list), ("type", libxl_domain_type), ("u", KeyedUnion(None, libxl_domain_type, "type", [("hvm", Struct(None, [("firmware", string), ("pae", bool), ("apic", bool), ("acpi", bool), ("acpi_s3", bool), ("acpi_s4", bool), ("nx", bool), ("viridian", bool), ("timeoffset", string), ("hpet", bool), ("vpt_align", bool), ("timer_mode", integer), ("nested_hvm", bool), ("no_incr_generationid", bool), ])), ("pv", Struct(None, [("kernel", libxl_file_reference), ("slack_memkb", uint32), ("bootloader", string), ("bootloader_args", libxl_string_list), ("cmdline", string), ("ramdisk", libxl_file_reference), ("features", string, True), ("e820_host", bool, False, "Use host's E820 for PCI passthrough."), ])), ])), ], comment = """Instances of libxl_file_reference contained in this struct which have been mapped (with libxl_file_reference_map) will be unmapped by libxl_domain_build/restore. If either of these are never called then the user is responsible for calling libxl_file_reference_unmap.""") libxl_device_model_info = Struct("device_model_info",[ ("domid", libxl_domid), ("uuid", libxl_uuid, False, "this is use only with stubdom, and must be different from the domain uuid"), ("dom_name", string), ("device_model_version", libxl_device_model_version), ("device_model_stubdomain", bool), ("device_model", string, False, "if you set this you must set device_model_version too"), ("saved_state", string), ("type", libxl_domain_type), ("target_ram", uint32), ("videoram", integer, False, "size of the videoram in MB"), ("stdvga", bool, False, "stdvga enabled or disabled"), ("vnc", bool, False, "vnc enabled or disabled"), ("vnclisten", string, False, "address:port that should be listened on for the VNC server if vnc is set"), ("vncpasswd", string, False, "the VNC password"), ("vncdisplay", integer, False, "set VNC display number"), ("vncunused", bool, False, "try to find an unused port for the VNC server"), ("keymap", string, False, "set keyboard layout, default is en-us keyboard"), ("sdl", bool, False, "sdl enabled or disabled"), ("opengl", bool, False, "opengl enabled or disabled (if enabled requires sdl enabled)"), ("spice", bool, False, "spice enabled or disabled"), ("spiceport", integer, False, "the port that should be listened on for the spice server"), ("spicetls_port", integer, False, """the tls port that should be listened on for the spice server, at least one of the port or tls port must be given"""), ("spicehost", string, False, """the interface that should be listened on if given otherwise any interface"""), ("spicedisable_ticketing", bool, False, "enable client connection with no password"), ("spicepasswd", string, False, """set ticket password witch must be used by a client for connection. The password never expires"""), ("spiceagent_mouse", bool, False, "Whether spice agent is used for client mouse mode(default is on)"), ("nographic", bool, False, "no graphics, use serial port"), ("gfx_passthru", bool, False, "graphics passthrough enabled or disabled"), ("serial", string, False, "serial port re-direct to pty deivce"), ("boot", string, False, "boot order, for example dca"), ("usb", bool, False, "usb support enabled or disabled"), ("usbdevice", string, False, "enable usb mouse: tablet for absolute mouse, mouse for PS/2 protocol relative mouse"), ("soundhw", string, False, "enable sound hardware"), ("acpi", bool, False, "acpi enabled or disabled"), ("vcpus", integer, False, "max number of vcpus"), ("vcpu_avail", integer, False, "vcpus actually available"), ("xen_platform_pci", bool, False, "enable/disable the xen platform pci device"), ("extra", libxl_string_list, False, "extra parameters pass directly to qemu, NULL terminated"), ("extra_pv", libxl_string_list, False, "extra parameters pass directly to qemu for PV guest, NULL terminated"), ("extra_hvm", libxl_string_list, False, "extra parameters pass directly to qemu for HVM guest, NULL terminated"), ], comment= """Device Model information. Network is missing""") libxl_device_vfb = Struct("device_vfb", [ ("backend_domid", libxl_domid), ("devid", integer), ("vnc", bool, False, "vnc enabled or disabled"), ("vnclisten", string, False, "address:port that should be listened on for the VNC server if vnc is set"), ("vncpasswd", string, False, "the VNC password"), ("vncdisplay", integer, False, "set VNC display number"), ("vncunused", bool, False, "try to find an unused port for the VNC server"), ("keymap", string, False, "set keyboard layout, default is en-us keyboard"), ("sdl", bool, False, "sdl enabled or disabled"), ("opengl", bool, False, "opengl enabled or disabled (if enabled requires sdl enabled)"), ("display", string), ("xauthority", string), ]) libxl_device_vkb = Struct("device_vkb", [ ("backend_domid", libxl_domid), ("devid", integer), ]) libxl_device_console = Struct("device_console", [ ("backend_domid", libxl_domid), ("devid", integer), ("consback", libxl_console_backend), ("output", string), ]) libxl_device_disk = Struct("device_disk", [ ("backend_domid", libxl_domid), ("pdev_path", string), ("vdev", string), ("backend", libxl_disk_backend), ("format", libxl_disk_format), ("script", string), ("removable", integer), ("readwrite", integer), ("is_cdrom", integer), ]) libxl_device_nic = Struct("device_nic", [ ("backend_domid", libxl_domid), ("devid", integer), ("mtu", integer), ("model", string), ("mac", libxl_mac), ("ip", string), ("bridge", string), ("ifname", string), ("script", string), ("nictype", libxl_nic_type), ]) libxl_device_pci = Struct("device_pci", [ ("func", uint8), ("dev", uint8), ("bus", uint8), ("domain", integer), ("vdevfn", uint32), ("vfunc_mask", uint32), ("msitranslate", bool), ("power_mgmt", bool), ]) libxl_diskinfo = Struct("diskinfo", [ ("backend", string), ("backend_id", uint32), ("frontend", string), ("frontend_id", uint32), ("devid", integer), ("state", integer), ("evtch", integer), ("rref", integer), ]) libxl_nicinfo = Struct("nicinfo", [ ("backend", string), ("backend_id", uint32), ("frontend", string), ("frontend_id", uint32), ("devid", integer), ("state", integer), ("evtch", integer), ("rref_tx", integer), ("rref_rx", integer), ]) libxl_vcpuinfo = Struct("vcpuinfo", [ ("vcpuid", uint32, False, "vcpu's id"), ("cpu", uint32, False, "current mapping"), ("online", bool, False, "currently online (not hotplugged)?"), ("blocked", bool, False, "blocked waiting for an event?"), ("running", bool, False, "currently scheduled on its CPU?"), ("vcpu_time", uint64, False, "total vcpu time ran (ns)"), ("cpumap", libxl_cpumap, False, "current cpu's affinities"), ]) libxl_physinfo = Struct("physinfo", [ ("threads_per_core", uint32), ("cores_per_socket", uint32), ("max_cpu_id", uint32), ("nr_cpus", uint32), ("cpu_khz", uint32), ("total_pages", uint64), ("free_pages", uint64), ("scrub_pages", uint64), ("nr_nodes", uint32), ("hw_cap", libxl_hwcap), ("phys_cap", uint32), ], dispose_fn=None, dir=DIR_OUT) libxl_topologyinfo = Struct("topologyinfo", [ ("coremap", libxl_cpuarray, False, "cpu to core map"), ("socketmap", libxl_cpuarray, False, "cpu to socket map"), ("nodemap", libxl_cpuarray, False, "cpu to node map"), ]) libxl_sched_credit = Struct("sched_credit", [ ("weight", integer), ("cap", integer), ], dispose_fn=None) libxl_sched_credit2 = Struct("sched_credit2", [ ("weight", integer), ], dispose_fn=None) libxl_sched_sedf = Struct("sched_sedf", [ ("period", integer), ("slice", integer), ("latency", integer), ("extratime", integer), ("weight", integer), ], dispose_fn=None)