コード例 #1
0
def qemuAttach(conn, pid_value, flags):
    """This API is QEMU specific, so it will only work with hypervisor
    connections to the QEMU driver.
    
    This API will attach to an externally launched QEMU process
    identified by @pid. There are several requirements to successfully
    attach to an external QEMU process:
    
      - It must have been started with a monitor socket using the UNIX
        domain socket protocol.
      - No device hotplug/unplug, or other configuration changes can
        have been made via the monitor since it started.
      - The '-name' and '-uuid' arguments should have been set (not
        mandatory, but strongly recommended)
    
    To date, the only platforms we know of where pid_t is larger than
    unsigned int (64-bit Windows) also lack UNIX sockets, so the choice
    of @pid_value as an unsigned int should not present any difficulties.
    
    If successful, then the guest will appear in the list of running
    domains for this connection, and other APIs should operate
    normally (provided the above requirements were honored). """
    ret = libvirtmod_qemu.virDomainQemuAttach(conn._o, pid_value, flags)
    if ret is None: raise libvirt.libvirtError('virDomainQemuAttach() failed')
    __tmp = libvirt.virDomain(conn, _obj=ret)
    return __tmp
コード例 #2
0
def qemuAgentCommand(domain, cmd, timeout, flags):
    """Send a Guest Agent command to domain """
    ret = libvirtmod_qemu.virDomainQemuAgentCommand(domain._o, cmd, timeout,
                                                    flags)
    if ret is None:
        raise libvirt.libvirtError('virDomainQemuAgentCommand() failed')
    return ret
コード例 #3
0
def lxcEnterCGroup(domain, flags):
    """This API is LXC specific, so it will only work with hypervisor
    connections to the LXC driver.
    
    Attaches the process to the control cgroups associated
    with the container @domain. """
    ret = libvirtmod_lxc.virDomainLxcEnterCGroup(domain._o, flags)
    if ret is None: raise libvirt.libvirtError('virDomainLxcEnterCGroup() failed')
    return ret
コード例 #4
0
def lxcOpenNamespace(domain, flags):
    """This API is LXC specific, so it will only work with hypervisor
    connections to the LXC driver.
    
    Open the namespaces associated with the container @domain
    and return a list of file descriptors associated with the
    container.
    
    The returned file descriptors are intended to be used with
    the setns() system call. """
    ret = libvirtmod_lxc.virDomainLxcOpenNamespace(domain._o, flags)
    if ret is None: raise libvirt.libvirtError('virDomainLxcOpenNamespace() failed')
    return ret
コード例 #5
0
def qemuMonitorCommand(domain, cmd, flags):
    """Send an arbitrary monitor command through qemu monitor of domain """
    ret = libvirtmod_qemu.virDomainQemuMonitorCommand(domain._o, cmd, flags)
    if ret is None:
        raise libvirt.libvirtError('virDomainQemuMonitorCommand() failed')
    return ret