
    Qhg                     p    S SK r S SKrS SKJrJ	r	J
r
JrJr  S\R                  S\R                  S\S\S\S	\S
\
\\4   S\4S jrS\R                  S\SS4S jrSS\R                  S\R                  S\S\	\R                  \R                  \\\\\R$                  /S4   S\R$                  S\S\4S jjr/ S 4S\R                  S\S\\   S\S\\\   44
S jjrS rS rS rSrSrSrSrSrS rSrS rSr g! \ a6  r S SKr  SrCGN! \ a  rS\" \5      ;   a  \e SrC SrCGN"SrCff = fSrCff = f)     NzNo module named)AnyCallableDictListIOconndomeventsecondsmicrosdetailscbDatareturnc           	      T    US   nUS   nU" U [         R                  " XS9X#XEU5        g)zBDispatches events to python user qemu monitor event callbacks
    cbopaque_objr   )libvirt	virDomain)	r   r	   r
   r   r   r   r   r   r   s	            ./usr/lib/python3/dist-packages/libvirt_qemu.py!_dispatchQemuMonitorEventCallbackr      s6     
BHFtWt.QWX    
callbackIDc                      [         R                  " U R                  U5      nUS:X  a  [        R                  " S5      eU R
                  U	 g! [         a     gf = f)zmRemoves a qemu monitor event callback. De-registering for a callback
will disable delivery of this event typez3virConnectDomainQemuMonitorEventDeregister() failedN)libvirtmod_qemu*virConnectDomainQemuMonitorEventDeregister_or   libvirtErrorqemuMonitorEventCallbackIDAttributeError)r   r   rets      r   qemuMonitorEventDeregisterr$   '   sW    HHR\]"9&&'\]]++J7 s   A
A 
AAr   r   flagsc                 <   [        U S5      (       d  0 U l        X0US.nUc$  [        R                  " U R                  SX&U5      nO-[        R                  " U R                  UR                  X&U5      nUS:X  a  [
        R                  " S5      eX@R                  U'   U$ )ziAdds a qemu monitor event callback. Registering for a monitor
callback will enable delivery of the eventsr!   )r   r   r   Nr   z1virConnectDomainQemuMonitorEventRegister() failed)hasattrr!   r   (virConnectDomainQemuMonitorEventRegisterr   r   r    )r   r	   r
   r   r   r%   r   r#   s           r   qemuMonitorEventRegisterr)   3   s     4566*,'7F
{FFtwwPTV[ejkFFtwwPSPVPVX]glm
by""#VWW+1##C(Jr   domaincmdfilesc                 |    [         R                  " U R                  XU5      nUc  [        R                  " S5      eU$ )a>  This API is QEMU specific, so it will only work with hypervisor
 connections to the QEMU driver with local connections using the unix
 socket.

 Send an arbitrary monitor command @cmd with file descriptors @files to
 domain through the QEMU monitor and optionally return a list of files
 in the returned tuple. There are several requirements to safely
 and successfully use this API:

- A @cmd that queries state without making any modifications is safe
- A @cmd that alters state that is also tracked by libvirt is unsafe,
  and may cause libvirtd to crash
- A @cmd that alters state not tracked by the current version of
  libvirt is possible as a means to test new qemu features before
  they have support in libvirt, but no guarantees are made to safety

 If VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP is set, the command is considered to
 be a human monitor command and libvirt will automatically convert it into
 QMP if needed.  In that case the @result will also be converted back from
 QMP.

 Returns a tuple consisting of the string output from @cmd and a list of
 files respectively.z-virDomainQemuMonitorCommandWithFiles() failed)r   $virDomainQemuMonitorCommandWithFilesr   r   r    )r*   r+   r,   r%   r#   s        r   qemuMonitorCommandWithFilesr/   B   s9    0 
>
>vyy#V[
\C
{""#RSSJr   c                 |    [         R                  " U R                  XU5      nUc  [        R                  " S5      eU$ )z%Send a Guest Agent command to domain z"virDomainQemuAgentCommand() failed)r   virDomainQemuAgentCommandr   r   r    )r*   r+   timeoutr%   r#   s        r   qemuAgentCommandr3   h   s6    

3
3FIIsU
SC
{""#GHHJr   c                     [         R                  " U R                  X5      nUc  [        R                  " S5      e[        R
                  " XS9nU$ )a  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). zvirDomainQemuAttach() failedr   )r   virDomainQemuAttachr   r   r    r   )r   	pid_valuer%   r#   __tmps        r   
qemuAttachr8   o   sF    , 
-
-dggy
HC
{""#ABBd-ELr   c                 z    [         R                  " U R                  X5      nUc  [        R                  " S5      eU$ )zASend an arbitrary monitor command through qemu monitor of domain z$virDomainQemuMonitorCommand() failed)r   virDomainQemuMonitorCommandr   r   r    )r*   r+   r%   r#   s       r   qemuMonitorCommandr;      s4    

5
5fii
LC
{""#IJJJr         r   <   )r   )!r   ImportErrorlib_ecygvirtmod_qemucyg_estrr   typingr   r   r   r   r   
virConnectr   intr   r$   _Tr)   r/   r3   r8   r;   4VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX5VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE#VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK!VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN%VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT$VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT&VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN'VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT#VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP r   r   <module>rS      sZ   
 1 0G,>,> WEVEV _b mp z}   IL   VZ  [^  `c  [c  Vd   il 	W%7%7 	S 	T 	7#5#5 G<M<M VY _gipi{i{  ~E  ~O  ~O  QT  VY  [^  `c  el  eo  eo  ip  rv  iv  `w   AH  AK  AK   TW   `c  Y[ij (9(9  DQTI cf psuyz|u}o~ L8 89 489 5 ') #$& !(* %'( $)+ & +, '&' #c  11 E
*K +*s5   C9 9D5 D

D-D(D0(D--D00D5