+
    h c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^RI
Ht ^RIHt ^RIHt ^RIHtHtHtHtHtHt ^RIHt ^RIHtHt ^RIHt ^R	IHt ^R
I H!t!H"t" ^RI#H$t$ ^RI%H&t& ]PN                  ! R4      t( ! R R4      t)Rs*R t+R t,. t- ! R R] P\                  4      t/RR lt0R t1RR lt2RR lt3R t4RR lt5RR lt6R t7R t8R t9R t:R t;R  t<RR! lt=R" t>RR# lt?R$ t@R% tAR& tBR' tCRR( ltDR) tER* tFR+ tGR, tHR- tIR. tJRR/ ltKRR0 ltLR1 tMRR2 ltNRR3 ltOR4 tPR5 tQRR6 ltRR7 tSR8 tTRR9 ltUR: tVR; tWR< tXR= tY ! R> R?4      tZ]Z! 4       t[ ! R@ RA4      t\ ! RB RC4      t]RD t^RE t_ ! RF RG]`4      ta ! RH RI]aRJ7      tb ! RK RL]b4      tcRM td ! RN RO]b4      te ! RP RQ]b4      tf ! RR RS]b4      tgRT thRU ti ! RV RW]b4      tjRX tk ! RY RZ]b4      tl ! R[ R\4      tmR] tn ! R^ R_]b4      toR` tp ! Ra Rb]b4      tqRc tr ! Rd Re4      ts ! Rf Rg]b4      ttRh tuRi tv ! Rj Rk4      twRl tx ! Rm Rn]b4      ty ! Ro Rp]b4      tz ! Rq Rr]b4      t{ ! Rs Rt]b4      t| ! Ru Rv]b4      t} ! Rw Rx]b4      t~ ! Ry Rz]b4      t ! R{ R|]b4      t ! R} R~]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      tRR ltRR ltRR ltR tR tR t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      t ! R R]b4      tR tR tR t ! R R]b4      t ! R R]b4      tRR ltR tR tR tR# )    N)xmlutil)BuildConfig)VirtinstConnection)DeviceDeviceController
DeviceDiskDeviceGraphicsDeviceHostdevDeviceInterface)Guest)logreset_logging)
NodeDevice)OSDB)StoragePoolStorageVolume)UnattendedData)CloudInitDatavirt-viewerc                   s2   a  ] tR t^1t o R tR tR tRtV tR# )_GlobalStatec                s0    R V n         RV n        / V n        R# )FN)quiet
all_checks_validation_checksself   &'/usr/share/virt-manager/virtinst/cli.py__init__Z_GlobalState.__init__2   s    
"$    c                s"    W P                   V&   R # N)r   )r   	checknameval   &&&r   set_validation_checkZ!_GlobalState.set_validation_check8   s    -0	*r   c                sn    V P                   e   V P                   # V P                  P                  VR4      # )NT)r   r   get)r   r      &&r   get_validation_checkZ!_GlobalState.get_validation_check;   s1    ??&??" &&**9d;;r   )r   r   r   N)	__name__
__module____qualname____firstlineno__r   r"   r%   __static_attributes____classdictcell____classdict__   @r   r   r   1   s     %1< <r   r   c                  s    \         # r   )_globalstate r   r   get_global_stater1   F   s    r   c                  s    \        4       sR # r   )r   r/   r0   r   r   _reset_global_stater2   J   s	    >Lr   c                   s.   a  ] tR t^Wt o RtRtR tRtV tR# )VirtHelpFormatterz
Subclass the default help formatter to allow printing newline characters
in --help output. The way we do this is a huge hack :(

Inspiration: http://groups.google.com/group/comp.lang.python/browse_thread/thread/6df6e6b541a15bc2/09f28e26af0699b1
Nc                s   a aa VVV 3R  lp\        S4      ^ 8w  d   \        S4      ^8w  d   V! 4       #  S^ ,          pRV9   d   VP                  4       # V! 4       #   \         d    T! 4       u # i ; i)c                  sL   < \         P                  P                  ! S.S O5/ SB # r   )argparseRawDescriptionHelpFormatter_split_lines)argskwargsr      r   return_defaultZ6VirtHelpFormatter._split_lines.<locals>.return_defaultc   s%    77DDT[D[TZ[[r   
)lenZ
splitlines	Exception)r   r7   r8   r:   texts   fjl  r   r6   ZVirtHelpFormatter._split_linesb   sm    	\ v;!D	Q!##	$7Dt|((!## 	$!##	$s   A A A0/A0r0   )	r&   r'   r(   r)   __doc__Zoldwrapr6   r*   r+   r,   r.   r   r3   r3   W   s      G$ $r   r3   c                 s    \        R 4      pV'       d   \        R4      R,           V,           p\        P                  ! W\        VR7      pVP	                  RR\
        P                  R7       V# )z1See man page for examples and full option syntax.z?Use '--option=?' or '--option help' to see available suboptionsr;   )usagedescriptionZformatter_classepilogz	--versionversion)actionrC   )_r4   ZArgumentParserr3   add_argumentr   rC   )r@   rA   Zintrospection_epilogrB   parsers   &&&  r   setupParserrH   r   sg    BCFOPSWWZ`` 	 $$>OX^F I{?R?RSMr   c                  s\    \        4        ^ RIp V P                  V P                  RR7       R# )r    Nz%(message)s)levelformat)r   loggingZbasicConfigDEBUG)rK   s    r   earlyLoggingrM      s!    OgmmMBr   c                 sV  a \        4        V\        4       n        \        P                  ! 4       p\
        P                  P                  W@R ,           4      p\        P                  ! 4       '       d   RpRp V'       d{   \
        P                  ! V\
        P                  4      '       gP   \
        P                  P                  V4      '       d   \        RV,          4      h \
        P                  ! VR4       V'       dc   \
        P                  P                  V4      '       d>   \
        P                  ! V\
        P                  4      '       g   \        RV,          4      hRpR	T ,           R
,           pRp	^ RIp
^ RIp
\+        4        \"        P,                  ! T
P.                  4       T'       dU   T
P0                  P3                  TRR^4      pTP5                  T
P7                  Y4      4       \"        P8                  ! T4       T
P;                  \<        P>                  4      pS'       d=   TP-                  T
P.                  4       TP5                  T
P7                  Y4      4       MwT'       g	   T'       gf   \        4       P                  '       d   T
P@                  pMT
PB                  pTP-                  T4       TP5                  T
P7                  T	4      4       MRpT'       d   \"        P8                  ! T4       T3R lpT\<        n"        \"        PF                  ! R\H        PJ                  RP                  \<        PL                  4      4       R#   \         d   p\        RT: RT: 24      RhRp?ii ; i  \          d%   p\"        P$                  ! RT4       Rp Rp?ELARp?ii ; i)z.logNzNo write access to directory %si  zCould not create directory : zNo write access to logfile %szError setting up logfile: %sz%a, %d %b %Y %H:%M:%Sz[%(asctime)s z? %(process)d] %(levelname)s (%(module)s:%(lineno)d) %(message)sz%(levelname)-8s %(message)sZaec           
      s   < \         P                  ! R RP                  \        P                  ! WV4      4      4       S'       g   \
        P                  ! WV4       R# R# )zUncaught exception:
%s N)r   debugjoin	tracebackZformat_exceptionsysZ__excepthook__)typr    Ztbdebug_stdouts   &&&r   exception_logZ#setupLogging.<locals>.exception_log   sD    		+RWWY5O5OPSZ\5]-^_ s, r   z)Version %s launched with command line: %s i   )'r2   r1   r   r   Zget_app_cache_dirospathrQ   r   in_testsuiteaccessZW_OKZexistsRuntimeErrorZmakedirsZIOErrorr=   r   warningrK   Zlogging.handlersr   ZsetLevelrL   ZhandlersZRotatingFileHandlerZsetFormatterZ	FormatterZ
addHandlerZStreamHandlerrS   stderrZERRORZWARNINGZ
excepthookrP   r   rC   Zargv)ZappnamerU   Zdo_quietZcli_appZvi_dirZlogfileeZ
dateFormatZ
fileFormatZstreamErrorFormatrK   ZfileHandlerZstreamHandlerrI   rV   s   &f&&           r   setupLoggingr`      s   '113Fggll6V#34G"))FBGG44ww~~f%%"#Dv#MNN`FE* rww~~g..ryy"''7R7R>HII
 )J'! %< 	<  6OLL&&::7D+WXY  !2!2:!JK{#))#**5Mw}}-""7#4#4Z#LM	###MMEOOEu%""7#4#45F#GH}%- #CN II9;;N;NPSPXPXY\YaYaPbcq  `"&RS#TU[__`
  2A6s`   6M9 >*M9 )$M9 M9 !M 8M9  $M9 %*M9 M9 M6M11M66M9 9N(N##N(c                 s    V'       d   V# \         P                  ! R T ;'       g    R4       \        V 4      pVP                  \        R4       \         P                  ! RVP
                  4       V# )zRequesting libvirt URI %sdefaultNzReceived libvirt URI %s)r   rP   r   Zopen_openauth_cburi)rc   connr$   r   getConnectionre      sQ    II)C,<,<9>c"DIIlD!II'2Kr   c                 sJ   V  F  pVw  r4rVpV\         P                  \         P                  39   pV'       g   \        P                  ! R V4       Ru # \        P
                  ! RV4       VR,          pV'       d   ^ RIp	V	P                  V4      p
M\        V4      p
WR&   K  	  ^ # )zNo prompt for auth credtype=%szopenauth_cb prompt=%srN   N)libvirtZVIR_CRED_PASSPHRASEZVIR_CRED_NOECHOPROMPTr   errorrP   getpassinput)ZcredsZ_cbdataZcredZcredtypepromptZ
_challengeZ
_defresultZ_resultZnoechori   Zress   &&         r   rb   rb      s    <@9*'g997;X;XYYII6AI		)62$//&)C-C R% & r   c                s6   \         P                  ! RP                  \        P                  ! 4       4      4       \         P
                  ! V 4       \        P                  ! 4       ^ ,          e   \         P                  ! RRR7       V'       d   \        4        R# R# )z.
Convenience function when failing in cli app
rO   NTexc_info)	r   rP   rQ   rR   Zformat_stackrh   rS   rm   
_fail_exit)msgZdo_exitr$   r   failrp     sY     IIbggi,,./0IIcN
||~a$		"t$ r   c                 s    V'       d   \         P                  ! V 4       V'       g#   \        4       P                  '       d	   V'       g   \	        V 4       R # R # r   )r   rP   r1   r   print)ro   Zdo_forceZdo_logr!   r   print_stdoutrr     s0    		#')///vc
 8>r   c                 sh    \         P                  ! V 4       \        V \        P                  R 7       R# ))fileN)r   rP   rq   rS   r^   )ro   r   r   print_stderrrt     s    IIcN	#CJJr   c                  s2    \         P                  ! ^4       R#    N)rS   exitr0   r   r   rn   rn     s    HHQKr   c                 sR    R V P                   P                  : RV P                  : 2# )zvirsh --connect z start )rd   rc   name)guestr   r   virsh_start_cmdrz     s    ,1JJNNEJJGGr   c                 s~    \        V 4      p\        \        R 4      V,          4       \        P                  ! ^4       R# )zDomain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  %s
otherwise, please restart your installation.N)rz   rt   rE   rS   rw   )ry   Zvirshcmd   & r   install_failr|   "  s8    u%H	;	
 	 HHQKr   c                 sF    V '       d   \         P                  ! R 4       R# R# )z%--prompt mode is no longer supported.N)r   r]   )rk   r   r   
set_promptr}   1  s    ;< r   c                 s    \         P                  ! W4      pVP                  '       g   R # \        R4      RVRVP                  RVP                  /,          p\
        P                  ! V4       R # )Nz%(path)s may not be accessible by the hypervisor. You will need to grant the '%(user)s' user search permissions for the following directories: %(dirs)srY   userZdirs)r   check_path_searchZfixlistrE   r~   r   r]   )rd   rY   Z
searchdataro      &&  r   r   r   7  s`    --d9J
	. 
vz
8J8JK	LC
 KKr   c                s    \        4       P                  V4      pV'       d#   \        V \        R4      V,          ,           4       \        P
                  ! RW4       V'       d   \        P                  ! V 4       R# R# )z=
Handle printing a message with an associated --check option
z4 (Use --check %s=off or --check all=off to override)z(Skipping --check %s error condition '%s'N)r1   r%   rp   rE   r   rP   r]   )ro   r   warn_on_skipZdo_check   &&& r   _optional_failr   C  sV      !66yAHSALMPYYZ[II8)IC r   c                s     \         P                  ! W4       R#   \         d!   p\        \	        T4      R4        Rp?R# Rp?ii ; i)z
There's legitimate use cases for creating/cloning VMs with duplicate
MACs, so we do the collision check here but allow it to be skipped
with --check
N
mac_in_use)r	   Zcheck_mac_in_user=   r   str)rd   macaddrr_      && r   validate_macr   P  s9    -((7 -s1v|,,-s    AA  Ac                 s   a aa S P                  4       oV VV3R  lpV V3R lpV 3R lpV! 4        V! 4        V! 4        \        S P                  S4       R# )c                 s   < S'       g   R# \         P                  ! S P                  S4      '       g   R# \        \	        R4      S,          R4       R# )zB
Prompt if disk file already exists and preserve mode is not used
Nz*This will overwrite the existing path '%s'path_exists)r   Zpath_definitely_existsrd   r   rE   )devrY   warn_overwriter9   r   check_path_existsZ(validate_disk.<locals>.check_path_exists`  s:     004@@qEFM}]r   c                 s   < SP                  4       p V '       g   R# \        R4      RSRV /,          p\        VR4       R# )z)
Check if disk is inuse by another guest
Nz:Disk %(path)s is already in use by other guests %(names)s.rY   namespath_in_use)Zis_conflict_diskrE   r   )r   ro   r   rY   s     r   check_inuse_conflictZ+validate_disk.<locals>.check_inuse_conflictj  sE     $$&LMDUQ
 
 	sM*r   c                 sp   < SP                  4       w  rV '       g   V'       d   \        VRRR7       R# R# R# )z3
Check if specified size exceeds available storage
	disk_sizeF)r   N)Zis_size_conflictr   )ZisfatalZerrmsgr   s     r   check_size_conflictZ*validate_disk.<locals>.check_size_conflictx  s-     ..066;UC "wr   N)get_source_pathr   rd   )r   r   r   r   r   rY   s   ff   @r   validate_diskr   ]  sD     D^+D chh%r   c                 s^   \         P                  ! R RP                  V4      4       RP                  V Uu. uF  p\        P                  ! V4      NK  	  up4      p\        V RV/,          4       \        P                  ! 4       '       d   R.p\        P                  ! 4       pV'       d   V#  \        P                  ! V^ ,          V4       \        P                  ! ^4       R# u upi   \         d   p\        RT: RT: 24        Rp?L@Rp?ii ; i  \        P                  ! ^4       i ; i)zRunning: %srW   Zcommandz	/bin/testzError launching rN   N)r   rP   rQ   shlexZquoterr   r   rZ   rX   ZforkZexecvpr=   rq   Z_exit)messager7   ZaZargstrZchildr_      &&    r   _run_consoler     s    IImSXXd^,XXt4t!u{{1~t45FIv../}GGIE
		$q'4  	! 5  4$2334 	s/   C$.C) )D4DD DD D,c                 s    R RV P                   P                  RV P                  .p\        R4      pV P	                  4       '       g   V P                  4       '       d   VP                  R4       \        W!4      # )r   	--connectz--waitz.Running graphical console command: %(command)sz--attach)rd   rc   rx   rE   Zhas_glZhas_listen_noneappendr   ry   r7   r      &  r   _gfx_consoler     s[    ;

%**MD@AG ||~~..00J&&r   c                 sx    R RV P                   P                  RV P                  .p\        R4      p\	        W!4      # )Zvirshr   consolez)Running text console command: %(command)s)rd   rc   rx   rE   r   r   r   r   _txt_consoler     s4    [%**..)UZZHD;<G&&r   c                  s    ^ RI p \        4       P                  ;'       g    \        P                  ! 4       pV P
                  P                  VR7      # )r    N)r   )Zvirtinst.progressr1   r   r   rZ   ZprogressZ
make_meter)Zvirtinstr   s     r   	get_meterr     s>    $$>>(<(<(>E''e'44r   c                 s    \         P                  pV'       d   V\         P                  ,          pV P                  V4      # r   )rg   ZVIR_DOMAIN_XML_SECUREZVIR_DOMAIN_XML_INACTIVEZXMLDesc)domaininactiveZflagsr   r   get_xmldescr     s/    ))E000>>%  r   c           
      s    \        V4       R pRp\        \        P                  ! W14      4      p Rp V P                  V4      pXP!                  4       ^ ,          pRp\#        T \%        T4      R	7      p	T\        P&                  8w  d   T	p\#        T \%        TR R
7      R	7      p	YYT3#   \         d    Rp Li ; i  \         dZ    \        P                  ! RR R7       T'       d   T P                  \        T4      4      p LT'       d   T P                  T4      p Lh i ; i  \        P                   d4   p\        \        R4      RTR\        T4      /,          4        Rp?ELRp?ii ; i)TFz7[a-fA-F0-9]{8}[-]([a-fA-F0-9]{4}[-]){3}[a-fA-F0-9]{12}$NzError looking up domain by namerl   z-Could not find domain '%(domain)s': %(error)sr   rh   Zparsexml)r   )int
ValueErrorboolrematchZlookupByNamer=   r   rP   Z
lookupByIDZlookupByUUIDStringrg   ZlibvirtErrorrp   rE   r   infor
   r   ZVIR_DOMAIN_SHUTOFF)
rd   ZdomstrZisintZuuidreZisuuidr   r_   stateZactive_xmlobjZinactive_xmlobj
   &&        r   get_domain_and_guestr     sL   F GF"((6*+F

	&&v.F& KKM!EMD;v+>?O***'{6D/QR]33G    	II7$GV5008	  
=>&Q	
 	

s]   B' D! B: 'B76B7:*D%D?D! D	DD! DD! !E)6(E$$E)c                 sH    \        R 4      RV RV/,          p\        V4       R# )z7Cannot use %(option1)s and %(option2)s at the same timeoption1option2N)rE   rp   )r   r   ro   r   r   fail_conflictingr     s-     E
F77J C 	Ir   c                  sX    \         \        \        \        \        \
        \        .,           # r   )VIRT_PARSERSParserCheckParserLocationParserUnattendedParserInstallParserCloudInitParserOSInfor0   r   r   _get_completer_parsersr     s&      r   c                 s   . p\        4        Fl  pVR ,          P                  VP                  8X  g   K'  \        VP                  R R7       F)  pVP                  VP                  4       R,           4       K+  	  Kn  	  V P                  R4      pV FK  pVP                  R4      pV^ 8  g   K  VRV^,            V9   g   K0  VP                  VRV^,            4       KM  	  V# )rD   c                 s"    V P                  4       # r   )nonregex_cliname)Zpr   r   Z<lambda>Z'_virtparser_completer.<locals>.<lambda>  s    qGYGYG[r   key=,N)
r   destcli_arg_namesorted	_virtargsr   r   splitZfindZremove)prefixr8   Zsub_optionsparserclassvirtargZentered_optionsZoptionZposs   &,      r   _virtparser_completerr     s    K-/(  K$<$<<!+"7"7=[\""7#;#;#=#CD ] 0 ll3'O!kk#7via(K7via01 " r   c                sh    VR8X  d   R# VP                  R^4      R,          pV P                  V4      # )a;  
:param suboption: The virtarg.cliname we are checking for a match
:param current_input: The user typed string we are checking against.
    So if the user types '--disk path=foo,dev<TAB>',
    current_input=='path=foo,dev'

For debugging here, 'export _ARC_DEBUG=1'. Now exceptions/printing
will be shown on stderr
rO   Tr   rf   )rsplit
startswith)Z	suboptionZcurrent_inputZcurrent_optionr   r   _completer_validatorr     s9      #))#q1"5N//r   c                 s   R \         P                  9  d   R# ^ RIp^ RIp\	        4        Uu. uF  q3P                  4       NK  	  ppV P                   F*  pVP                   F  pWd9   g   K  \        Vn	         K(  	  K,  	  R\        /p\        P                  ! 4       '       d7   ^ RIp ! R RVP                  4      p	V	! 4       VR&   \        P                   VR&   \         P"                  p
\        P                  ! 4       '       d   R pTp
VP$                  P&                  P)                  \         RV
4      ;_uu_ 4         VP*                  ! V 3/ VB   RRR4       R# u upi   \,         d@    \        P                  ! 4       '       d#   TR,          P/                  4       p\1        T4       h i ; i  + '       g   i     R# ; i)	Z_ARGCOMPLETENZ	validatorc                   s2   a a ] tR tRt oV 3R ltRtVtV ;t# )autocomplete.<locals>.MyStreami8  c                st   < \        V4      \        J d   VP                  R 4      p\        SV `  ! V.VO5/ VB # )zutf-8)typeZbytesZdecodesuperwrite)r   ro   r7   r8   	__class__s   &&*,r   r   Z$autocomplete.<locals>.MyStream.write<  s6    9%**W-Cw}S:4:6::r   r0   )r&   r'   r(   r)   r   r*   r+   __classcell__r   r-      @@r   MyStreamr   8  s     ; ;r   r   Zoutput_streamZexit_methodc                  s"    \         P                  # r   )rS   r^   )r7   r8   s   *,r   fake_fdopen_cbZ$autocomplete.<locals>.fake_fdopen_cbI  s    ::r   fdopen)rX   environargcompleteZunittest.mockr   cli_flag_nameZ_actionsZoption_stringsr   Z	completerr   r   rZ   ioZStringIOrS   rw   r   ZmockZpatchZobjectautocompleteZ
SystemExitZgetvaluerq   )rG   r   ZunittestZpclassZparsernamesrD   optr8   r   r   Zfake_fdopenr   Zoutputs   &            r   r   r   %  sg   RZZ'8N8PQ8Pf'')8PKQ//((C!#8  ) " /0F	;r{{ 	; #+* #} ))K	 %				#	#B+	>	>	$$V6v6 
?	>E RJ  	##%%099;f		 
?	>	>s)   E<F.>E!!%F+$F++F..F?	c                 s    VR 8X  d!   V P                  RRR\        R4      R7       R# V P                  RR\        R4      R7       R# )zvirt-xmlz-cr   ZURIz&Connect to hypervisor with libvirt URI)ZmetavarhelpN)rF   rE   )rG   Zinvokerr$   r   add_connect_optionr   ]  sN    *+u15]3^ 	 	
 	Q/W-X 	 	
r   c           	      s   V'       dG   V P                  R RR\        P                  R7       V P                  RRR\        P                  R7       V'       d=   V P                  RR\        R4      R7       V P                  R	R
RR\        R4      R7       V'       d   V P                  RR\        R4      R7       V'       d   V P                  RR\        R4      R7       V'       df   RRRRR\        R4      /pV'       d   RVR&   RVR&   MRVR&   V P                   ! R./ VB  V'       d#   V P                  RR\        P                  R7       V'       d   V P                  R RR!\        R"4      R#7       V'       d   V P                  R$R%\        R&4      R7       V P                  R'R(R\        R)4      R7       V P                  R*R+R\        R,4      R7       R-# )/z--prompt
store_trueFrD   ra   r   z--forcez--autoconsolera   zlConfigure guest console auto connect. Example:
--autoconsole text
--autoconsole graphical
--autoconsole none)ra   r   z--noautoconsoleautoconsoleZstore_constnonez7Don't automatically try to connect to the guest console)r   rD   constr   z
--norebootz*Don't boot guest after completing install.rD   r   z	--replacezCDon't check name collision, overwrite any guest with the same name.r   Zxmlonlyr   z<Print the generated domain XML rather than create the guest.?nargsallr   rD   z--print-stepZxmlstep)r   r   z	--dry-runZdryzKRun through install process, but do not create devices or define the guest.rD   r   r   z--checkr   zUEnable or disable validation checks. Example:
--check path_in_use=off
--check all=offz-qz--quietzSuppress non-error outputz-dz--debugzPrint debugging informationN)z--print-xml)rF   r4   SUPPRESSrE   )	grprk   replaceZprintxmlZ	printstepZnorebootZdryrunZnoautoconsoleZprint_kwargss	   &&&&&&&& r   add_misc_optionsr   h  s    L%hN_N_`<XM^M^_% 	 		
 	 LM 	 	
 A6b4c 	 	
 XY 	 	
 IuATU
 $'L!$)L!%1L"7,7 ^)(BSBST`a	 	 	
 " 	 	
 T9\B]@^_T9\B_@`ar   c                 h    \         P                  4        V P                  R R\        R4      R7       R# )z
--metadatar   zConfigure guest metadata. Ex:
--metadata name=foo,title="My pretty title",uuid=...
--metadata description="My nice long description"r   N)ParserMetadataregisterrF   rE   r   r   r   add_metadata_optionr     s5    @
  r   c                 s    \         P                  4        V P                  R R\        R4      R7       V'       d+   V P                  RR\        R\
        P                  R7       R# R# )	z--memoryr   zeConfigure guest memory allocation. Ex:
--memory 1024 (in MiB)
--memory memory=1024,currentMemory=512
r   z-rz--ramZ	oldmemory)r   r   r   N)ParserMemoryr   rF   rE   r   r4   r   )r   
backcompatr$   r   add_memory_optionr     s]    7
   wS{IZIZ[ r   c                 s   \         P                  4        \        P                  4        V P                  R R\	        R4      R7       RpV'       d   RpV P                  RR\	        R4      V,           R7       V'       dF   V P                  RR	\
        P                  R7       V P                  R
\
        P                  R7       R# R# )z--vcpusr   zNumber of vCPUs to configure for your guest. Ex:
--vcpus 5
--vcpus 5,maxvcpus=10,cpuset=1-4,6,8
--vcpus sockets=2,cores=4,threads=2r   z--cpu host-modelz--cpu host-model,clearxml=yesz--cpuzICPU model and features. Ex:
--cpu coreduo,+x2apic
--cpu host-passthrough
z--check-cpur   z--cpusetr   N)	ParserCPUr   
ParserVCPUrF   rE   r4   r   )r   r   editexampleZextramsgr   r   vcpu_cli_optionsr     s    2
  	 "H2]^
   |(BSBST(*;*;< r   c                 r   )z
--graphicsr   zoConfigure guest display settings. Ex:
--graphics spice
--graphics vnc,port=5901,listen=0.0.0.0
--graphics none
r   N)ParserGraphicsr   rF   rE   devgr   r   add_gfx_optionr     s4     
  	r   c                 sj    \         P                  4        V P                  R RR\        R4      R7       R# )z-wz	--networkr   zConfigure a guest network interface. Ex:
--network bridge=mybr0
--network network=my_libvirt_virtual_net
--network network=mynet,model=virtio,mac=00:11...
--network none
--network helpr   N)ParserNetworkr   rF   rE   r   r   r   add_net_optionr     s7    
	  r   c                 s	   \         P                  4        V P                  R R\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \
        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R	4      R7       \        P                  4        V P                  R
R\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       V P                  RRR\        P                  R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        RRR\        R4      /pV'       d   RVR&   V P                  ! R9/ VB  V'       d$   V P                  RRR\        P                  R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \         P                  4        V P                  R R\        R!4      R7       \"        P                  4        V P                  R"R\        R#4      R7       \$        P                  4        V P                  R$R\        R%4      R7       \&        P                  4        V P                  R&R\        R'4      R7       \(        P                  4        V P                  R(R\        R)4      R7       \*        P                  4        V P                  R*R\        R+4      R7       \,        P                  4        V P                  R,R\        R-4      R7       \.        P                  4        V P                  R.R\        R/4      R7       \0        P                  4        V P                  R0R\        R14      R7       \2        P                  4        V P                  R2R\        R34      R7       \4        P                  4        V P                  R4R\        R54      R7       \6        P                  4        V P                  R6R\        R74      R7       R8# ):z--controllerr   zxConfigure a guest controller device. Ex:
--controller type=usb,model=qemu-xhci
--controller type=scsi,model=virtio-scsi
r   z--inputzKConfigure a guest input device. Ex:
--input tablet
--input keyboard,bus=usbz--serialzConfigure a guest serial devicez
--parallelz!Configure a guest parallel devicez	--channelz'Configure a guest communication channelz	--consolez>Configure a text console connection between the guest and hostz	--hostdevzGConfigure physical USB/PCI/etc host devices to be shared with the guestz--host-devicehostdevr   z--filesystemz{Pass host directory to the guest. Ex: 
--filesystem /my/source/dir,/dir/in/guest
--filesystem template_name,/,type=templaterD   r   z&Configure guest sound device emulationr   r   z	--soundhwsoundz--audioz.Configure host audio backend for sound devicesz
--watchdogz!Configure a guest watchdog devicez--videozConfigure guest video hardware.z--smartcardzDConfigure a guest smartcard device. Ex:
--smartcard mode=passthroughz
--redirdevzYConfigure a guest redirection device. Ex:
--redirdev usb,type=tcp,server=192.168.1.1:4000z--memballoonzBConfigure a guest memballoon device. Ex:
--memballoon model=virtioz--tpmz0Configure a guest TPM device. Ex:
--tpm /dev/tpmz--rngz4Configure a guest RNG device. Ex:
--rng /dev/urandomz--panicz3Configure a guest panic device. Ex:
--panic defaultz--shmemz?Configure a guest shared memory device. Ex:
--shmem name=shmem0z--memdevzCConfigure a guest memory device. Ex:
--memdev dimm,target.size=1024z--vsockzMConfigure guest vsock sockets. Ex:
--vsock cid.auto=yes
--vsock cid.address=7z--iommuzDConfigure an IOMMU device. Ex:
--iommu model=intel,driver.aw_bits=48z--pstorezxConfigure a nvram storage device.
It's for guest kernel to record oops/panic logs. Ex:
--pstore backend=acpi-erst,size=8N)z--sound)ParserControllerr   rF   rE   ParserInputParserSerialParserParallelParserChannelParserConsoleParserHostdevr4   r   ParserFilesystemParserSoundParserAudioParserWatchdogParserVideoParserSmartcardParserRedirParserMemballoon	ParserTPM	ParserRNGParserPanicParserShMemParserMemdevParserVsockParserIommuParserPstore)r   Zsound_back_compatZsound_kwargsr   r   add_device_optionsr    s   9
   ^_  
 j:[8\]l8!<_:`aH1-V+W   OP  
 XY   	ohYXM^M^_9
    	(:;L  #W0<0+hW8K\K\](+[)\   l8!<_:`aiq9Z7[\VW  
 >
   TU  
 q)\']   q)`'a   EF  
 QR  
 UV  
 `a  
 VW  
 0
  r   c                 s*   \         P                  4        V P                  R R\        R4      R7       \        P                  4        V P                  RRR\        R4      R7       \
        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  R	R\        R
4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \        P                  4        V P                  RR\        R4      R7       \         P                  4        V P                  RR\        R4      R7       \"        P                  4        V P                  RR\        R 4      R7       \$        P                  4        V P                  R!R"R\        R#4      R7       R$# )%z--iothreadsr   z7Set domain <iothreads> and <iothreadids> configuration.r   z
--seclabelz
--securityz"Set domain seclabel configuration.z	--keywrapzFSet guest to perform the S390 cryptographic key management operations.z	--cputunez+Tune CPU parameters for the domain process.z
--numatunez(Tune NUMA policy for the domain process.z	--memtunez*Tune memory policy for the domain process.z--blkiotunez)Tune blkio policy for the domain process.z--memorybackingzRSet memory backing policy for the domain process. Ex:
--memorybacking hugepages=onz
--featureszQSet domain <features> XML. Ex:
--features acpi=off
--features apic=on,apic.eoi=onz--clockzKSet domain <clock> XML. Ex:
--clock offset=localtime,rtc_tickpolicy=catchupz--pmz&Configure VM power management featuresz--eventsz(Configure VM lifecycle management policyz
--resourcez,Configure VM resource partitioning (cgroups)z	--sysinfoznConfigure SMBIOS System Information. Ex:
--sysinfo host
--sysinfo bios.vendor=MyVendor,bios.version=1.2.3,...
z--qemu-commandlinez}Pass arguments directly to the QEMU emulator. Ex:
--qemu-commandline='-display gtk,gl=on'
--qemu-commandline env=DISPLAY=:0.1z--launchSecurityz--launchsecurityzSConfigure VM launch security (e.g. SEV memory encryption). Ex:
--launchSecurity sevN)ParserIOThreadsr   rF   rE   ParserSeclabelParserKeyWrapParserCputuneParserNumatuneParserMemtuneParserBlkiotuneParserMemoryBackingParserFeaturesParserClockParserPMParserEventsParserResourceParserSysinfoParserQemuCLIParserLaunchSecurity)Zgengr   r   add_guest_xml_optionsr'    s   HI   l8!<`:a   WX   H1-Z+[   XA.X,Y   H1-Y+Z   hQ/Z-[     "a
   -
   ]^   fXA6^4_`8!,V*W   XA.\,]   F
   2
   !!##
	  r   c                 s    \         P                  4        V P                  R R\        R4      R7       \        P                  4        V P                  RR\        R4      R7       R# )z--bootr   zbConfigure guest boot settings. Ex:
--boot hd,cdrom,menu=on
--boot init=/sbin/init (for containers)r   z--idmapz]Enable user namespace for LXC container. Ex:
--idmap uid.start=0,uid.target=1000,uid.count=10N)
ParserBootr   rF   rE   ParserIdmap)Zinsgr   r   add_boot_optionsr*    sh    6
   ?
  r   c                 s    \         P                  4        R pV'       d
   VR,          pV P                  RR\        R4      V,           R7       R# )rO   z
--disk cache=  (unset cache)z--diskr   zSpecify storage with various options. Ex.
--disk size=10 (new 10GiB image in default location)
--disk /my/existing/disk,cache=none
--disk device=cdrom,bus=scsi
--disk=?r   N)
ParserDiskr   rF   rE   )Zstogr   Zeditmsgr   r   add_disk_optionr,  /  sQ    G33
   r   c                 s    V P                  \        R 4      4      pV'       d   \        R4      pM\        R4      pVR,          pV\        R4      ,          pVP                  RRVR7       V# )z
OS optionsz$The OS being installed in the guest.zThe OS installed in the guest.r;   zThis is used for deciding optimal defaults like VirtIO.
Example values: fedora29, rhel7.0, win10, ...
Use '--osinfo list' to see a full list.z--osinfoz--os-variantr   )Zadd_argument_grouprE   rF   )rG   ZvirtinstallZosgro   r   r   add_osinfo_optionr-  B  sj    

#
#AlO
4C67014KC1	2 C Zc:Jr   c                 sj    \         P                  4        V P                  R R. \        R4      R7       R# )z--xmlr   zPerform raw XML XPath options on the final XML. Example:
--xml ./cpu/@mode=host-passthrough
--xml ./devices/disk[2]/serial=new-serial
--xml xpath.delete=./clockr   N)	ParserXMLr   rF   rE   r   r   r   add_xml_optionr/  T  s7    )
	  
r   c                 sj    . ROp. ROpT ;'       g    RP                  4       p W9   d   R# W9   d   R# R# )yrO   TFN)r0  yes1Ztrueton)ZnZno0ZfalsefZoff)lower)ZsZtvaluesZfvaluesr   r   _raw_on_off_convertr8  i  s1    2G3G	
bA|	
r   c                 sn    Vf   R # \        V4      pVe   V# \        \        R4      RV /,          4       R # )Nz%(key)s must be 'yes' or 'no'r   )r8  rp   rE   )r   r    r$   r   _on_off_convertr9  u  s5    
{
c
"C

*	+ucl	:;r   c                   s<   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	_SuboptCheckerClassi  zF
Used by the test suite to ensure we actually test all cli suboptions
c                sB    \        4       V n        \        4       V n        R # r   )Zset_all_seenr   r   r   r   Z_SuboptCheckerClass.__init__  s    E	U
r   c                <    V P                   P                  V4       R # r   )r;  addr   rx   r$   r   add_allZ_SuboptCheckerClass.add_all  s    		dr   c                r=  r   )r<  r>  r?  r$   r   add_seenZ_SuboptCheckerClass.add_seen  s    

tr   c                s<    V P                   V P                  ,
          # r   r;  r<  r   r   r   
get_unseenZ_SuboptCheckerClass.get_unseen  s    yy4::%%r   rB  N)r&   r'   r(   r)   r?   r   r@  rA  rC  r*   r+   r,   r.   r   r:  r:    s#     & &r   r:  c                   sF   a  ] tR tRt o RtR
R ltR tR tR tR t	R	t
V tR# )_VirtCLIArgumentStatici  a  
Helper class to hold all of the static data we need for knowing
how to parse a cli subargument, like --disk path=, or --network mac=.

@cliname: The command line option name, 'path' for path=FOO
@propname: The virtinst API attribute name the cliargument maps to.
@cb: Rather than set a virtinst object property directly, use
    this callback instead. It should have the signature:
    cb(parser, inst, val, virtarg)

@ignore_default: If the value passed on the cli is 'default', don't
    do anything.
@can_comma: If True, this option is expected to have embedded commas.
    After the parser sees this option, it will iterate over the
    option string until it finds another known argument name:
    everything prior to that argument name is considered part of
    the value of this option, '=' included. Should be used sparingly.
@is_onoff: The value expected on the cli is on/off or yes/no, convert
    it to true/false.
@lookup_cb: If specified, use this function for performing match
    lookups.
@find_inst_cb: If specified, this can be used to return a different
    'inst' to check and set attributes against. For example,
    DeviceDisk has multiple seclabel children, this provides a hook
    to lookup the specified child object.
Nc
                s   Wn         W n        W@n        WPn        W`n        Wpn        Wn        Wn        W0n        . V n	        V P                  '       g)   V P                  '       g   \        P                  ! R 4      hV P                  '       g9   V P                  R8X  d(   \        P                  ! RV P                   ,          4      hV P                  R8X  d   RV n        \        P                  V P                  V P                   4      4       R# )z!propname or cb must be specified.a  cliname=%s propname is None but lookup_cb is not specified. Even if a 'cb' is passed, 'propname' is still used for device lookup for virt-xml --edit.

If cb is just a converter function for a single propname, then set both propname and cb. If this cliname is truly not backed by a single propname, set lookup_cb=None or better yet implement a lookup_cb. This message is here to ensure propname isn't omitted without understanding the distinction.Nrf   )clinamepropnamecb	can_commaignore_defaultis_onoff	lookup_cbfind_inst_cb_parent_cliname_aliasesr   DevError_SuboptCheckerr@  _testsuite_argcheck_name)
r   rE  rF  parent_clinamerG  rH  rI  rJ  rK  rL  s
   &&&&&&&&&&r   r   Z_VirtCLIArgumentStatic.__init__  s      ", "(-}}}TWWW""#FGG}}}2!5""# &*\\2
 
 >>R!DNt<<T\\JKr   c                s`    V P                   '       g
   R V,          # RV P                   : RV: 2# )zsharedoption %s--rW   )rM  )r   rE  r$   r   rQ  Z/_VirtCLIArgumentStatic._testsuite_argcheck_name  s/    ###$w.. $ 00'::r   c                s    Wn         V P                    F'  p\        P                  V P                  V4      4       K)  	  R # r   )rN  rP  r@  rQ  )r   aliasesZaliasr   r   set_aliasesZ"_VirtCLIArgumentStatic.set_aliases  s.    ]]E""4#@#@#GH #r   c                s:    V P                   P                  R R4      # )z[0-9]*rO   )rE  r   r   r   r   r   Z'_VirtCLIArgumentStatic.nonregex_cliname  s    ||##Hb11r   c                sJ   V P                   .\        P                  ! V P                  4      ,            Fl  pRV9   d0   \        P
                  ! RVP                  RR4      ,          V4      pMW!8H  pV'       g   KG  \        P                  V P                  V4      4        R# 	  R# )z
Return True if the passed user string matches this
VirtCLIArgument. So for an option like --foo bar=X, this
checks if we are the parser for 'bar'
Z[z^%s$.z\.TF)
rE  r   listifyrN  r   r   r   rP  rA  rQ  )r   ZuserstrrE  retr   r   
match_nameZ!_VirtCLIArgumentStatic.match_name  s     ~(FFFGg~hhvU(CCWM(s''(E(Eg(NO G r   )
rN  rM  rH  rG  rE  rL  rI  rJ  rK  rF  )NNFFrf   N)r&   r'   r(   r)   r?   r   rQ  rU  r   rY  r*   r+   r,   r.   r   rD  rD    s+     6)LV;
I
2 r   rD  c                   s6   a  ] tR tRt o RtR tR tR tRtV t	R# )_VirtCLIArgumenti  zu
A class that combines the static parsing data _VirtCLIArgumentStatic
with actual values passed on the command line.
c                s    Vf   \        RV,          4      hVR8X  d   RpVP                  '       d   \        W#4      pW0n        W n        Wn        VP                  V n        VP                  V n        R# )zS
Instantiate a VirtCLIArgument with the actual key=val pair
from the command line.
NzOption '%s' had no value set.rO   )r\   rJ  r9  r    r   _virtargrF  rE  )r   r   r   r       &&&&r   r   Z_VirtCLIArgument.__init__   sg    
 ; >DEE"9C!#+C  ((r   c                s   V P                   R8X  d   V P                  P                  '       d   R# V P                  P                  '       d*   V P                  P                  WV P                   V RR7      p V P                  '       d!   \
        P                  ! W P                  4       T P                  P                  '       d*   T P                  P                  YT P                   T 4       R# \
        P                  ! Y P                  T P                   4       R#   \         d-    RT: RT P                  : 2p\
        P                  ! T4      Rhi ; i)z
Process the cli param against the pass inst.

So if we are VirtCLIArgument for --disk device=, and the user
specified --disk device=foo, we were instantiated with
key=device val=foo, so set inst.device = foo
ra   NTcan_editzobj=z does not have member=)r    r[  rI  rL  rF  r   get_prop_pathZAttributeErrorrO  rG  set_prop_path)r   rG   instro   r   r   parse_paramZ_VirtCLIArgument.parse_param  s     88y T]]%A%A%A==%%%==--fDHHdUY-ZD	2}}}%%dMM:
 ==MMV488T:!!$txx@  	26:DMMJC""3'T1	2s   6D  D 7Ec           	     s   V P                   '       gQ   V P                  P                  '       g5   \        \	        R4      R\        VRR4      RV P                  /,          4      hV P                  P                  '       d4   V P                  P                  WV P                  V RR7      pV'       g   R# V P                  P                  '       d(   V P                  P                  WV P                  V 4      # \        P                  ! W P                   4      pVP                  VP                  VP                  4       R7      p\        P                  ! W@P                   V P                  4       \        P                  ! W@P                   4      pW58H  # )	a  
See if the passed value matches our Argument, like via virt-xml

So if this Argument is for --disk device=, and the user
specified virt-xml --edit device=floppy --disk ..., we were
instantiated with key=device val=floppy, so return
'inst.device == floppy'
zRDon't know how to match device type '%(device_type)s' property '%(property_name)s'Zdevice_typeDEVICE_TYPErO   Zproperty_nameFr]  r   )rF  r[  rK  r\   rE   getattrr   rL  r    r   r_  r   rd   Zget_xmlr`  )r   rG   ra  ZxmlvalZsetterZclivals   &&&   r   lookup_paramZ_VirtCLIArgument.lookup_param3  s(    }}}T]]%<%<%<3 !'$r"BOUYU]U]^	_  ==%%%==--fDHHdUZ-[D=="""==**64HH
 &&t]];		DLLNCfmmTXX>&&v}}=r   )r[  rE  r   rF  r    N)
r&   r'   r(   r)   r?   r   rb  re  r*   r+   r,   r.   r   rZ  rZ    s     
'2A4!  ! r   rZ  c                s    \         P                   ! T ;'       g    RRR7      pRVn        RVn        RVn        . p\	        V4       F5  pRV9   d   VP                  R^4      w  rEMTpRpVP                  WE34       K7  	  V# )z
Parse the command string into an ordered list of tuples. So
a string like --disk path=foo,size=5,path=bar will end up like

[("path", "foo"), ("size", "5"), ("path", "bar")]
rO   T)Zposixr   r   N)r   Z
commentersZ
whitespaceZwhitespace_splitlistr   r   )optstrZargsplitterrX  r   rE  r    s   &     r   parse_optstr_tuplesrh  W  s     ++fll$7KK K#'K 
CK #:99S!,LGSGC

G>" ! Jr   c                s  aa
a \         P                  ! 4       p\        V 4      oV3R lo
V
V3R lp\        S4       F,  w  pw  rgVf	   V'       g    MVP	                  ^ 4      V3SV&   K.  	  S'       d]   SP	                  ^ 4      w  rgS
! V4      pV'       g   WsV&   K1  VP
                  '       d   V! Wg.4      p	V	^ ,          pV	^,          pWsV&   Kd  V# )z
Parse the passed argument string into an OrderedDict WRT
the passed list of VirtCLIArguments and their special handling.

So for --disk path=foo,size=5, optstr is 'path=foo,size=5', and
we return {"path": "foo", "size": "5"}
c                 sP   < S F  pVP                  V 4      '       g   K  Vu # 	  R # r   )rY  )rE  r   virtargss   & r   _lookup_virtargZ._parse_optstr_to_dict.<locals>._lookup_virtargz  s#    G!!'**  r   c                 s   < S'       dr   S^ ,          w  rS! V4      '       d    V # SP                  ^ 4       V ^;;,          RV,           ,          uu&   V'       g   K[  V ^;;,          RV,           ,          uu&   Ky  V # )r    r   r   )pop)commaoptrE  r    rj  	opttupless   &  r   _consume_comma_argZ1_parse_optstr_to_dict.<locals>._consume_comma_arg  sb    $Q<LGw''  MM!QK3=(KssSy(r   )collectionsZOrderedDictrh  Z	enumeraterk  rH  )rg  ri  remove_firstoptdictrn  ZidxrE  r    r   rl  rj  rm  s   &f&       @@r   _parse_optstr_to_dictrr  o  s     %%'G#F+I
"  )3^g?,&**1-w7	#  4
  }}Q'!'*"G)7.9HqkG1+CNr   c                   s6   a a ] tR tRt oRtV 3R ltRtVtV ;t# )
_InitClassi  zMetaclass for providing the _virtcli_class_init function.

This allows the customisation of class creation. Similar to
'__init_subclass__' (see https://www.python.org/dev/peps/pep-0487/),
but without giving us an explicit dep on python 3.6

c                s  < \        V4      ^8w  d   \        S	V `  ! V .VO5!  # TpVw  rEpVP                  R4      p\	        V\
        P                  4      '       d   \        R4      h\        S	V `	  WWV4      pVP                  4        VP                  '       d)   \        P                  ! RV: RVP                  : 24      hV# )i   _virtcli_class_initz*_virtcli_class_init must be a @classmethodzclass=z leftover aliases=)r<   r   __new__r#   
isinstancetypesZFunctionTyper\   rt  rT  r   rO  )
clsr7   r8   Zdummyrx   ZbasesZnsinitr   r   s
   &*,      r   ru  Z_InitClass.__new__  s    t9>7?3...Rvv+,dE..//KLLws%4  " <<<""T4<<#XYYr   r0   )	r&   r'   r(   r)   r?   ru  r*   r+   r   r   r   r   rs  rs    s      r   rs  c                   s   a  ] tR tRt o Rt^tRtRtRtRt	. t
/ tRt]R 4       t]R 4       t]R 4       t]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       tRR ltR tR tR tR tR tR tR tR tRt V t!R# )VirtCLIParseri  a-  
Parse a compound arg string like --option foo=bar,baz=12. This is
the desired interface to VirtCLIArgument and VirtCLIOptionString.

A command line argument like --disk just extends this interface
and calls add_arg a bunch to register subarguments like path=,
size=, etc. See existing impls examples of how to do all sorts of
crazy stuff.

Class parameters:
@guest_propname: The property name in the Guest class that tracks
    the object type that backs this parser. For example, the --sound
    option maps to DeviceSound, which on the guest class is at
    guest.devices.sound, so guest_propname = "devices.sound"
@remove_first: List of parameters to peel off the front of the
    option string, and store in the optdict. So:
    remove_first=["char_type"] for --serial pty,foo=bar
    maps to {"char_type", "pty", "foo": "bar"}
@stub_none: If the parsed option string is just 'none', make it a no-op.
    This helps us be backwards compatible: for example, --rng none is
    a no-op, but one day we decide to add an rng device by default to
    certain VMs, and --rng none is extended to handle that. --rng none
    can be added to users command lines and it will give the expected
    results regardless of the virt-install version.
@cli_arg_name: The command line argument this maps to, so
    "hostdev" for --hostdev
NTc           	     s0   V P                   '       gP   . V n         V P                  '       d7   \        RRRV P                  RRR7      pV P                   P	                  V4       V P
                  pVP                  RR4      '       d   Rp\        WV.VO5/ VB pVP                  V P                  9   dI   VP                  \        P                  ! V P                  P                  VP                  4      4      4       V P                   P	                  V4       R# )z
Add a VirtCLIArgument for this class.

:param skip_testsuite_tracking: Special argument handled here. If True,
    if means the argument is shared among multiple cli commands.
    Don't insist that each instance has full testsuite coverage.
clearxmlNTrG  rK  rJ  skip_testsuite_trackingF)r   supports_clearxmlrD  _clearxml_cbr   r   rk  rE  rT  rU  r   rW  )rx  rE  rF  r7   r8   ZclearxmlvirtargrR  r   s   &&&*,   r   add_argZVirtCLIParser.add_arg  s     }}}CM$$$"8ds/?/?4Z^# $$_5))::/77!N(N\T\U[\??ckk)0P QRW%r   c                sH    R V P                   P                  RR4      ,           # )rS  rE   -)r   r   rx  r   r   r   ZVirtCLIParser.cli_flag_name  s     c&&..sC888r   c                s    R p\        RV P                  4       ,          4       \        V P                  VR7       F  p\        RVP                  ,          4       K!  	  \        R4       R# )z;
Print out all _param names, triggered via ex. --disk help
c                 s    R pV P                   R8X  d   RpV P                   P                  R4      '       d   RpV P                   P                  R4      '       d   RpWP                   ,           # )rO   r{  r5  zaddress.r2  xpathZ2)rE  r   )r   r   r{   r   _sortkeyZ3VirtCLIParser.print_introspection.<locals>._sortkey  sY    F*,))*55))'22OO++r   z%s options:r   z  %srO   N)rq   r   r   r   rE  )rx  r  Zargr   r   print_introspectionZ!VirtCLIParser.print_introspection  sL    	, 	mc//112#--X6C&3;;&' 7b	r   c                sj    V P                   '       g   R# \        P                  ! WP                   4      # )zu
For the passed obj, return the equivalent of
getattr(obj, cls.guest_propname), but handle '.' in the guest_propname
N)guest_propnamer   r_  )rx  objr$   r   lookup_propZVirtCLIParser.lookup_prop  s*     !!!$$S*<*<==r   c                sD    V P                  V4      p\        V\        4      # r   )r  rv  rf  )rx  r  ra  r   r   prop_is_listZVirtCLIParser.prop_is_list$  s    s#$%%r   c                sJ    V \         9  d   \         P                  V 4       R # R # r   )r   r   r  r   r   r   ZVirtCLIParser.register)  s     l"$ #r   c                    R# )z-This method also terminates the super() chainNr0   r  r   r   rt  Z!VirtCLIParser._virtcli_class_init/      r   c                sX    V '       d"   V P                   '       d   \        V 4       R # R # R # r   )r  _add_xpath_args)Zsubclassr   r   _virtcli_class_init_commonZ(VirtCLIParser._virtcli_class_init_common3  s    ///H% 08r   c                s   Wn         W n        W0n        V P                   V P                  8X  d   R V n         \	        V P                   V P
                  \        P                  ! V P                  4      R,          4      V n	        R# )rO   :NNNN)
rg  ry   editingOPTSTR_EMPTYrr  r   r   rW  rp  rq  )r   rg  ry   r  r\  r   r   ZVirtCLIParser.__init__8  sY    
;;$+++DK,KK9J9J)KA)N
r   c                s    V P                   '       g!   \        RV P                  4       ,          4      hVRJd   R# VP                  RV P                  9   R7       R# )z6
Callback that handles virt-xml clearxml=yes|no magic
z!Don't know how to clearxml for %sTNr   )Z
leave_stub)r  r\   r   clearrg  r   ra  r    r   r\  r   r  ZVirtCLIParser._clearxml_cbB  sM     """BTEWEWEYYZZd? 	

sdkk1
3r   c                s   aa VV3R lpV# )au  
Create a callback used for find_inst_cb command line lookup.

:param cliarg: The cliarg string that is followed by an index.
    Example, for --disk seclabel[0-9]* mapping, this is 'seclabel'
:param list_propname: The property name on the virtinst object that
    this parameter maps too. For the seclabel example, we want
    disk.seclabels, so this value is 'seclabels'
c                 s  < Tp^ p\         P                  ! RS,          VP                  4      pV'       d!   \        VP	                  4       ^ ,          4      pV'       dT   \        \        P                  ! V S4      4      V^,           8  d(   \        P                  ! V S4      P                  4        KS   \        P                  ! V S4      V,          #   \         d    T'       g    R# h i ; i)r    z%s(\d+)N)
r   Zsearchr   r   Zgroupsr<   r   r_  add_newZ
IndexError)	ra  r    r   r^  ignoreZnumZregcliarglist_propnames	   &&&&   r   rG  Z,VirtCLIParser._make_find_inst_cb.<locals>.cba  s    FC))J/=C#**,q/*'//mDEqQ))$>FFH,,T=A#FF s   2C C(&C(r0   )r   r  r  rG  s   &ff r   _make_find_inst_cbZ VirtCLIParser._make_find_inst_cbV  s    	" 	r   c           	     s    . pV P                    Fh  p\        VP                  4       4       FH  pVP                  V4      '       g   K  \	        W4VP                  V4      4      pVP                  V4       KJ  	  Kj  	  V# )za
Convert the passed optdict to a list of instantiated
VirtCLIArguments to actually interact with
)r   rf  keysrY  rZ  rk  r   )r   rq  rX  Zvirtargstaticr   Zarginstr   r   _optdict_to_param_listZ$VirtCLIParser._optdict_to_param_listt  se    
 !^^MGLLN+ ++C00.}7;;sCSTGJJw' , ,
 
r   c           
     s    V'       dG   \        \        R4      RV P                  4       R\        VP	                  4       4      /,          4       R# R# )z
Used to check if there were any unprocessed entries in the
optdict after we should have emptied it. Like if the user
passed an invalid argument such as --disk idontexist=foo
z*Unknown %(optionflag)s options: %(string)sZ
optionflagstringN)rp   rE   r   rf  r  )r   rq  r$   r   _check_leftover_optsZ"VirtCLIParser._check_leftover_opts  sC     >?!3!3!5xgllnAUVW r   c                s    V P                   P                  4       pV P                  V4       F  pVP                  W4       K  	  V P	                  V4       V# )zZ
Subclasses can hook into this to do any pre/post processing
of the inst, or self.optdict
)rq  copyr  rb  r  )r   ra  rq  paramr   r   _parseZVirtCLIParser._parse  sN    
 ,,##%009Ed) : 	!!'*r   c                s<   V P                   '       g   R# V P                  '       d   V P                   R8X  d   R# RpV P                  '       dW   V'       gO   V P                  V P                  4      pV P                  V P                  4      pV'       d   VP                  4       p. p T P                  VRJ ;'       d    V P                  ;'       g    T4      p\        P                  ! V4       F  pV P                  '       g#   \        VR4      '       d   VP                  4        V'       g   KA  \        V\        4      '       d   V P                  P                  V4       Kt  V P                  P!                  V4       K  	  V\        P                  ! V4      ,          pV#   \"         dq   p\$        P&                  ! RYP                   RR7       \)        \+        R4      R	T P-                  4       R
T P                   R\/        T4      /,          4        Rp?T# Rp?ii ; i)ab  
Main entry point. Iterate over self._virtargs, and serialize
self.optdict into 'inst'.

For virt-xml, 'inst' is the virtinst object we are editing,
ex. a DeviceDisk from a parsed Guest object.
For virt-install, 'inst' is None, and we will create a new
inst for self.guest_propname, or edit a singleton object in place
like Guest.features/DomainFeatures
Nr   Fvalidate#Exception parsing inst=%s optstr=%sTrl   -Error: %(cli_flag_name)s %(options)s: %(err)sr   optionserr)rg  	stub_noner  r  ry   r  newr  r   rW  r  hasattrr  rv  r   Z
add_deviceZ	add_childr=   r   rP   rp   rE   r   r   )r   ra  Z
new_objectrX  Zobjsr  r_   s   &&     r   parseZVirtCLIParser.parse  s    {{{>>>dkkV3
t##DJJ/D**4::6Jxxz	;;tt|::

BBdCDt,|||Z(@(@LLN!c6**JJ))#.JJ((- - 7??4((C 
  	II;T;;Y]^AB"D$6$6$8)T[[RWY\]^Y_`a 
 
	s-   'F  =F  AF  -A1F   H+A%HHc                sl   . p\         P                  ! V P                  V P                  4      4      p V F|  pV P                  P                  4       pRpV P                  V4       F  pVP                  W4      pVRJ g   K  Rp M	  V'       d   VP                  V4       V P                  V4       K~  	  V#   \         dr   p\        P                  ! RXT P                  RR7       \        \        R4      RT P!                  4       RT P                  R\#        T4      /,          4        R	p?T# R	p?ii ; i)
z
Given a passed option string, search the guests' child list
for all objects which match the passed options.

Used only by virt-xml --edit lookups
TFr  rl   r  r   r  r  N)r   rW  r  ry   rq  r  r  re  r   r  r=   r   rP   rg  rp   rE   r   r   )	r   rX  Zobjlistra  rq  Zvalidr  Zparamretr_   s	   &        r   lookup_child_from_option_stringZ-VirtCLIParser.lookup_child_from_option_string  s    //$"2"24::">?	,,++-!88AE$11$=H5( %	 B
 JJt$))'2  $ 
  	II;T4;;Y]^AB"D$6$6$8)T[[RWY\]^Y_`a 
 
	s%   A	B7 B7 &B7 7D3A&D..D3c                r  )zDo nothing callbackNr0   r  r\  r   noset_cbZVirtCLIParser.noset_cb  r  r   )r  ry   rq  rg  )NN)"r&   r'   r(   r)   r?   r  r  rp  r  r   r   rT  r~  classmethodr  r   r  r  r  r   rt  Zstaticmethodr  r   r  r  r  r  r  r  r  r  r*   r+   r,   r.   r   rz  rz    s    8 LNLILIG& &2 9 9  ( > > & & % %
 < < & &
4(<

,\>" "r   rz  )Z	metaclassc                   sN   a a ] tR tRt oRtRtRt]R 4       tV 3R lt	Rt
VtV ;t# )r.  i  z`
Parser to set values on XMLManualAction instances, which are tracked
in XMLBuilder.xml_actions
ZxmlFc                s    \         P                  V 4       V P                  R RRR7       V P                  RRRR7       V P                  RRRR7       V P                  RR	RR7       R
# )zxpath.deletexpath_deleteTrH  	xpath.set	xpath_setzxpath.createxpath_createzxpath.valuexpath_valueNrz  r  r  r  r   r   rt  ZParserXML._virtcli_class_init  sX    005NNdCK=NNdCM=DAr   c                s`  < V P                   P                  P                  4       pV P                  P	                  R4      '       g4   V P
                  P                  4        V P                  V P
                  R&   \        SV `!  V4       V P                   P                  P                  V4       R# )z[
Parse --xml option string into XMLManualAction instances and append
to guest.xml_actions.
zxpath.r  N)
ry   xml_actionsr  rg  r   rq  r  r   r  r   r   ra  r      &&r   r  ZParserXML.parse   sz    
 zz%%))+ {{%%h//LL (,DLL%d

%%d+r   r0   )r&   r'   r(   r)   r?   r   r~  r  rt  r  r*   r+   r   r   r   r   r.  r.    s5     
 LB B, ,r   r.  c                s   a  R pV 3R lpV! RRRRVR7       V! RR	RRVR7       V! R
RRRVR7       V! RRRRVR7       R# )z3
Add xpath.* subarguments to XML based CLI options
c                 <    R pRpV P                  W44      pV! V/ VB # )r  r  r  r   r7   r8   r  r  rG     &*,   r   find_xpath_cbZ&_add_xpath_args.<locals>.find_xpath_cb  s,    %$$V;4"6""r   c                  6   < R VR&   SP                   ! V / VB  R# Tr}  Nr  r7   r8   rx     *,r   _add_argZ!_add_xpath_args.<locals>._add_arg      ,0()T$V$r   zxpath[0-9]*.deleter  TN)rH  rK  rL  zxpath[0-9]*.setr  zxpath[0-9]*.creater  zxpath[0-9]*.valuer  r0   )rx  r  r  s   f  r   r  r    sn    
#% " ;$$Ub " "r   c                   J   a a ] tR tRt oRtRt]R 4       tV 3R ltRt	Vt
V ;t# )ParserConvertToQ35i@  convert_to_q35Fc                sT    \         P                  V 4       V P                  R R 4       R# )num_pcie_root_portsNr  r  r   r   rt  Z&ParserConvertToQ35._virtcli_class_initD  s     005)+@Ar   c                   <  ! R  R4      pV! 4       p\         SV `  V4       V P                  P                  ! R/ VP                  B  R# )c                       ] tR tRtRtRtR# )2ParserConvertToQ35.parse.<locals>.ConvertToQ35DataiJ  Nr0   )r&   r'   r(   r)   r  r*   r0   r   r   ConvertToQ35Datar  J  s    "&r   r  Nr0   )r   r  ry   r  __dict__)r   ra  r  r      && r   r  ZParserConvertToQ35.parseI  s<    	' 	'  !d

!!2DMM2r   r0   r&   r'   r(   r)   r   r~  r  rt  r  r*   r+   r   r   r   r   r  r  @  s.     #LB B3 3r   r  c                   r  )ParserConvertToVNCiW  convert_to_vncFc                sT    \         P                  V 4       V P                  R R4       R# )zqemu-vdagentqemu_vdagentNr  r  r   r   rt  Z&ParserConvertToVNC._virtcli_class_init[  s    005NN3r   c                r  )c                   r  )2ParserConvertToVNC.parse.<locals>.ConvertToVNCDataia  Nr0   )r&   r'   r(   r)   r  r*   r0   r   r   ConvertToVNCDatar  a  s    Lr   r  Nr0   )r   r  ry   r  r  )r   ra  r  r   r  r   r  ZParserConvertToVNC.parse`  s<    	  	   !d

!!2DMM2r   r0   r  r   r   r   r  r  W  s,     #L4 43 3r   r  c                   8   a  ] tR tRt o RtRt]R 4       tRtV t	R# )r   in  Z
unattendedFc                s   \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
4       R# )Zprofilezadmin-password-fileZadmin_password_filez
user-loginZ
user_loginzuser-password-fileZuser_password_filezproduct-keyZproduct_keyz	reg-loginZ	reg_loginNr  r  r   r   rt  Z$ParserUnattended._virtcli_class_initr  sh    005Iy))+@AL,/(*>?M=1K-r   r0   N)
r&   r'   r(   r)   r   r~  r  rt  r*   r+   r,   r.   r   r   r   n  s"     L. .r   r   c                 st    \        4       pV ^8X  d   V# \        V 4      pVP                  V4      '       d   V# R# ru   )r   r   r  rg  rX  rG   r   r   parse_unattendedr  }  s9    

C{
f%F||C
 r   c                 sd    V P                   '       d   V P                  '       g   R V n        V = R# R# )zall=offN)forcecheck)r  r   r   convert_old_forcer    s%    }}}}}}%GMM r   c                   s>   a  ] tR tRt o RtRt]R 4       tR tRt	V t
R# )r   i  r  Fc                sX   \         P                  V 4       V P                  R RRV P                  RR7       V P                  RRRV P                  RR7       V P                  RRRV P                  RR7       V P                  RRRV P                  RR7       V P                  RRRR	7       R# )
r   NT)rJ  rG  rK  r   r   r   r   r   rJ  )rz  r  r  set_cbr  r   r   rt  ZParserCheck._virtcli_class_init  s    005M4$3::QUVKtTM4$3::QUVL$#**PTUE<$7r   c                s>    VP                  VP                  V4       R # r   )r"   rE  r  r\  r   r  ZParserCheck.set_cb  s    !!'//37r   r0   N)r&   r'   r(   r)   r   r~  r  rt  r  r*   r+   r,   r.   r   r   r     s,     L8 88 8r   r   c                 s    \         P                  ! V 4       F'  p\        V4      pVP                  \	        4       4       K)  	  R # r   )r   rW  r   r  r1   )Zchecksrg  rG   r   r   parse_checkr    s/    //&)V$%'( *r   c                   <   a  ] tR tRt o RtRtRt]R 4       tRt	V t
R# )r   i  ZinstallrX   Fc                sD   \         P                  V 4       V P                  R R RR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RR4       V P                  R	R	RR7       R
# )bootdevTr  kernelinitrdkernel_argskernel_args_overwriter  rX   
no_installNr  r  r   r   rt  Z!ParserInstall._virtcli_class_init  s    005IyD9Hh$7Hh$7M=DA+-DtTD$L,>r   r0   Nr&   r'   r(   r)   r   rp  r~  r  rt  r*   r+   r,   r.   r   r   r     s'     LL? ?r   r   c                   &   a  ] tR tRt o R tRtV tR# )InstallDatai  c                sv    R V n         R V n        R V n        R V n        R V n        R V n        RV n        R V n        R # NF)r  r  r  r  r  rX   is_setr  r   r   r   r   ZInstallData.__init__  s<    %)"r   )r  r  r  r  r  r  r  rX   Nr&   r'   r(   r)   r   r*   r+   r,   r.   r   r  r    s      r   r  c                 s    \        4       p\        V 4      Vn        \        T ;'       g    R 4      pVP	                  V4       V# r   )r  r   r  r   r  )rg  ZinstalldatarG   r   r   parse_installr    s7    -KfK6>>T*F
LLr   c                   s@   a  ] tR tRt o RtRtRR/t]R 4       tRt	V t
R# )	r   i  Z
cloud_initFroot-ssh-keyzssh-keyc                sX   \         P                  V 4       V P                  R RRR7       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  R	R
4       V P                  RR4       V P                  RR4       V P                  RR4       R# )zroot-password-generateroot_password_generateTr  zroot-password-fileZroot_password_filedisabler  Zroot_ssh_keyzclouduser-ssh-keyZclouduser_ssh_keyz	user-dataZ	user_dataz	meta-dataZ	meta_dataznetwork-configZnetwork_configNr  r  r   r   rt  Z#ParserCloudInit._virtcli_class_init  s    005,.FQUV(*>?Iy48NN3')<=K-K-$&67r   r0   N)r&   r'   r(   r)   r   r~  rT  r  rt  r*   r+   r,   r.   r   r   r     s0     L	G 	8 	8r   r   c                 s    \        4       pV ^8X  d'   \        P                  ! R4       RVn        RVn        V# \        V 4      pVP                  V4      '       d   V# R# )rv   zADefaulting to --cloud-init root-password-generate=yes,disable=yesTN)r   r   r]   r  r  r   r  r  r   r   parse_cloud_initr    sT    
/C{WX%)"
V$F||C
 r   c                   <   a  ] tR tRt o RtRtRt]R 4       tRt	V t
R# )r   i  locationFc                s    \         P                  V 4       V P                  R R RR7       V P                  RRRR7       V P                  RRRR7       R# )r  Tr  r  r  Nr  r  r   r   rt  Z"ParserLocation._virtcli_class_init  sF    005J
d;Hh$7Hh$7r   r0   Nr  r,   r.   r   r   r     s'     LL8 8r   r   c                 s     ! R  R4      pV! 4       p\        T ;'       g    R4      pVP                  V4       VP                  VP                  VP                  3# )c                   r  )$parse_location.<locals>.LocationDatai  c                s0    R V n         R V n        R V n        R # r   )r  r  r  r   r   r   r   Z-parse_location.<locals>.LocationData.__init__  s     DMDKDKr   )r  r  r  Nr  r,   r.   r   LocationDatar    s     	 	r   r  N)r   r  r  r  r  )rg  r  Z	parsedatarG      &   r   parse_locationr    sP      IFNNd+F
LLy//1A1AAAr   c                   sL   a  ] tR tRt o ^t^tR tR tR tR t	R t
R tRtV tR	# )

OSInfoDatai#  c                sL    R V n         R V n        RV n        R V n        R V n        R # r  )_name_id_detect_require_from_cli_requirer   r   r   r   ZOSInfoData.__init__'  s&    
!%r   c                s    Ve   VR8X  d   RV n         V P                  V n        R # VR8X  d
   RV n        R # RV9   d	   Wn        R # Wn        R # )NautoTr   genericz://)r  _REQUIRE_AUTOr  r  r  )r   Zrawstrr$   r   set_compat_strZOSInfoData.set_compat_str.  sE    >Vv-DL ..DMV"DJf_HJr   c                s   R pV P                   '       d$   \        P                  ! V P                   RR7      pM4V P                  '       d#   \        P                  ! V P                  RR7      pV'       d   VP
                  V n        V P                  RJ d4   V P                  '       g    \        P                  ! R4       RV n        R # R # V P                  RJ d   V P                  V n
        R # V P                  V n
        R # )NTZraise_errorFz3Converting `require=off` to fallback `name=generic`r  )r  r   lookup_os_by_full_idr  Z	lookup_osrx   r  r   rP   _REQUIRE_ONr  r  )r   osobjr{   r   r  ZOSInfoData.validate<  s    888--dhhDIEZZZNN4::4@EDJ!!U*:::		OP&
  ##t+ ,,DM ..DMr   c                    V P                   # r   )r  r   r   r   	is_detectZOSInfoData.is_detectN  s    ||r   c                s4    V P                   V P                  8H  # r   )r  r  r   r   r   is_require_onZOSInfoData.is_require_onQ  s    }} 0 000r   c                r  r   )r  r   r   r   get_nameZOSInfoData.get_nameT  s    zzr   )r  r  r  r  r  N)r&   r'   r(   r)   r  r  r   r  r  r   r  r  r*   r+   r,   r.   r   r  r  #  s2     KM /$1 r   r  c                   r  )r   iX  osinfoFc                s    \         P                  V 4       V P                  R R4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  R	R
RR7       R# )rx   r  zshort-ididr  Zdetectr  Tr  requirer  Nr  r  r   r   rt  Z ParserOSInfo._virtcli_class_init\  s_    005FG$J(D% Hi$7I2TBr   c                s   < R \        V P                  4      9  d   VP                  V P                  4       R# \        SV `  V4      # r   N)r   rg  r  r   r  r  r  r   r  ZParserOSInfo.parsee  s8    c$++&&,w}T""r   r0   r  r   r   r   r   r   X  s.     LC C# #r   r   c                 sr    \        4       p\        V 4      pVP                  V4       VP                  4        V# r   )r  r   r  r  )rg  ZdatarG   r   r   parse_osinfor  l  s-    <D&!F
LLMMOKr   c                s   VP                  4       '       d   \        P                  ! R4       R# V P                  P                  pV'       g   R# V^ ,          P
                  pVR\        P                  \        P                  39  d   \        P                  ! RV4       R# \        P                  P                  RR4      '       gb   \        P                  P                  R4      '       g=   \        P                  ! 4       '       g"   \        P                  ! \!        R	4      4       R# \"        '       g=   \        P                  ! 4       '       g"   \        P                  ! \!        R
4      4       R# R# )zc
Determine the default console for the passed guest config

:returns: 'text', 'graphical', or None
z8--cloud-init specified, defaulting to --autoconsole textr>   ra   z*No viewer to launch for graphics type '%s'NZDISPLAYrO   ZDISPLAY_WAYLANDz-No display detected. Not running virt-viewer.zlUnable to connect to graphical console: virt-viewer not installed. Please install the 'virt-viewer' package.	graphical)Zhas_cloudinitr   r   devicesgraphicsr   r   ZTYPE_VNCZ
TYPE_SPICErP   rX   r   r#   r   rZ   r]   rE   HAS_VIRTVIEWER)ry   	installerZgdevsZgtyper   r   #_determine_default_autoconsole_typer  y  s       KLMM""E!HMMEY 7 79R9RSS		>F JJNN9b))

011$$&&AEFG>'"6"6"8"8-	
 r   c                   sD   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
_AutoconsoleDatai  c                s   Wn         V P                   R9  d&   \        \        R4      V P                   ,          4       V P                   R8H  V n        V P                  '       d   \	        W#4      pT;'       g    R V n         R# R# )r   ra   zUnknown autoconsole type '%s'N)r   ra   r>   r  )_autoconsolerp   rE   _is_defaultr  )r   r   ry   r  ra      &&&& r   r   Z_AutoconsoleData.__init__  sn    '$LL23d6G6GGH,,	99%KG ' 1 16D r   c                     V P                   R 8H  # )r>   r  r   r   r   is_textZ_AutoconsoleData.is_text  s      F**r   c                r  )r  r  r   r   r   is_graphicalZ_AutoconsoleData.is_graphical  s      K//r   c                r  r   )r  r   r   r   
is_defaultZ_AutoconsoleData.is_default  s    r   c                s4    \        V P                  4       4      # r   )r   get_console_cbr   r   r   has_console_cbZ_AutoconsoleData.has_console_cb  s    D'')**r   c                sv    V P                  4       '       d   \        # V P                  4       '       d   \        # R # r   )r  r   r  r   r   r   r   r  Z_AutoconsoleData.get_console_cb  s+    <<>>r   )r  r  N)r&   r'   r(   r)   r   r  r  r  r  r  r*   r+   r,   r.   r   r  r    s(     2+0 + r   r  c                 s.    \        V P                  W4      # r   )r  r   )r  ry   r  r!   r   parse_autoconsoler    s    G//BBr   c                   s@   a  ] tR tRt o Rt]R 4       tR tR tRt	V t
R# )r   i  Zmetadatac                s   \         P                  V 4       V P                  R R RR7       V P                  RRRR7       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  R	R
R
V P                  R7       V P                  RR
R
V P                  R7       R
# )rx   Tr  ZtitleuuidZgenidZgenid_enabler  rA   Zos_nameNrK  rG  Z
os_full_id)rz  r  r  set_os_name_cbset_os_full_id_cbr  r   r   rt  Z"ParserMetadata._virtcli_class_init  s    005FFd3GW5FF#GW%NNTBM=DAItt8J8JKL$$3;P;PQr   c                (    VP                  V4       R # r   )set_os_namer  r\  r   r  ZParserMetadata.set_os_name_cb  s    r   c                sl    \         P                  ! VR R7      pVP                  VP                  4       R# )Tr  N)r   r  r  rx   )r   ra  r    r   r  r  r   r  Z ParserMetadata.set_os_full_id_cb  s&    ))#4@$r   r0   N)r&   r'   r(   r)   r   r  rt  r  r  r*   r+   r,   r.   r   r   r     s-     L	R 	R% %r   r   c                   s4   a  ] tR tRt o Rt]R 4       tRtV tR# )r"  i  Zeventsc                    \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       R# )Zon_poweroffZ	on_rebootZon_crashZon_lockfailureNr  r  r   r   rt  Z ParserEvents._virtcli_class_init  sJ    005M=1K-J
+$&67r   r0   N)	r&   r'   r(   r)   r   r  rt  r*   r+   r,   r.   r   r"  r"    s     L8 8r   r"  c                   r  )r#  i  Zresource	partitionc                s|    \         P                  V 4       V P                  R R 4       V P                  RRRR7       R# )r!  zfibrechannel.appidZfibrechannel_appidTr  Nr  r  r   r   rt  Z"ParserResource._virtcli_class_init  s2    005K-(*>$Or   r0   Nr&   r'   r(   r)   r   r  rp  r  rt  r*   r+   r,   r.   r   r#  r#    s(     LNLP Pr   r#  c                   sN   a  ] tR tRt o RtRtRtRRRR/tR t]	R 4       t
R	tV tR
# )r  i	  Znumatunenodesetmemory.modemodememory.nodesetc                <    R pR pV P                  W44      pV! V/ VB # )Zmemnoder  r  r  r   memnode_find_inst_cbZ#ParserNumatune.memnode_find_inst_cb	  ,    !$$V;4"6""r   c                sX   \         P                  V 4       V P                  R RRR7       V P                  RR4       V P                  RR4       V P                  RR	RV P                  R
7       V P                  RRV P                  R7       V P                  RRRV P                  R
7       R# )r&  Zmemory_nodesetTr  r$  Zmemory_modezmemory.placementZmemory_placementzmemnode[0-9]*.cellidZcellidrH  rL  zmemnode[0-9]*.moder%  rL  zmemnode[0-9]*.nodesetr#  N)rz  r  r  r(  r  r   r   rt  Z"ParserNumatune._virtcli_class_init	  s    005$&6$GM=1&(:;"H3KcKc 	 	
 	(&s?W?WX#11	 	 	
r   r0   N)r&   r'   r(   r)   r   r  rp  rT  r(  r  rt  r*   r+   r,   r.   r   r  r  	  s>     LNLv)G
# 
 
r   r  c                   sb   a a ] tR tRt oRtRtRRRR/tR tV 3R ltR	 t	]
R
 4       tRtVtV ;t# )r   i.	  memorymaxMemory.slotsZhotplugmemoryslots	maxMemoryZhotplugmemorymaxc                s   RV P                   9   pRV P                   9   pRV P                   9   pV'       d6   V'       d,   V P                   P                  RR4      V P                   R&   R# R# V'       d[   V'       d)   V P                   P                  R4      V P                   R&   V P                   P                  R4      V P                   R&   R# V'       d+   V P                   P                  R4      V P                   R&   R# R# )al  
Historically the cli had:
    memory -> ./currentMemory
    maxmemory -> ./memory
Then later libvirt gained ./maxMemory. So things are quite a mess.

Try to convert the back compat cases. Basically if new style option
currentMemory is specified, interpret currentMemory and memory as
the XML values. Otherwise treat memory and maxmemory as the old
swapped names.
currentMemory	maxmemoryr,  Nrq  rk  )r   havecurhavemaxZhavememr  r   _convert_old_memory_optionsZ(ParserMemory._convert_old_memory_options6	  s     "T\\1-dll*)-)9)9+t)LX& 040@0@0J_-%)\\%5%5k%BDLL",0LL,<,<X,FDLL) r   c                B   < V P                  4        \        SV `	  V4      # r   )r4  r   r  r  r  r   r  ZParserMemory._parseO	  s    ((*w~d##r   c                h    \         P                  ! WP                  \        V4      R ,          4       R# i   Nr   r`  rF  r   r  r\  r   set_memory_cbZParserMemory.set_memory_cbW	       d$4$4c#hoFr   c                sD   V P                  R R V P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RR4       V P                  RRRV P                  R7       V P                  R	R
RR7       R# )r,  rG  r/  r.  r-  ZmaxMemorySlotsr0  Nr  	hugepageszmemoryBacking.hugepagesTr  )r  r9  r  r  r   r   rt  Z ParserMemory._virtcli_class_initZ	  s    Hh3+<+<=O_9J9JKK1B1BC%'78 	K#,,G 	K!:TJr   r0   )r&   r'   r(   r)   r   rp  rT  r4  r  r9  r  rt  r*   r+   r   r   r   r   r   r   .	  sO     LL/'G
G2$G 
K 
K 
Kr   r   c                   r  )r  im	  Zmemtune
soft_limitc                r   )Z
hard_limitr=  Zswap_hard_limitZmin_guaranteeNr  r  r   r   rt  Z!ParserMemtune._virtcli_class_initr	  sJ    005L,/L,/%'89O_5r   r0   Nr"  r,   r.   r   r  r  m	  s&     LNL6 6r   r  c                   s^   a  ] tR tRt o RtRtRtRRRRRR	R
RRRRR/tR t]	R 4       t
RtV tR# )r  i	  Z	blkiotuneweightdevice[0-9]*.pathdevice_pathdevice[0-9]*.weightZdevice_weightdevice[0-9]*.read_bytes_secread_bytes_secdevice[0-9]*.write_bytes_secwrite_bytes_secdevice[0-9]*.read_iops_secread_iops_secdevice[0-9]*.write_iops_secwrite_iops_secc                r  )devicer	  r  r  r  r   device_find_inst_cbZ#ParserBlkiotune.device_find_inst_cb	  s,    !$$V;4"6""r   c                s   \         P                  V 4       V P                  R R 4       V P                  RRV P                  R7       V P                  RR V P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  R	R
V P                  R7       V P                  RRV P                  R7       R# )r>  r?  rY   r+  rA  rB  rC  rD  rE  rF  rG  rH  rI  N)rz  r  r  rK  r  r   r   rt  Z#ParserBlkiotune._virtcli_class_init	  s    005Hh''c>U>UV)8#BYBYZ)+;#JaJa 	 	
 	*,=CLcLc 	 	
 	(/H_H_ 	 	
 	)+;#JaJa 	 	
r   r0   N)r&   r'   r(   r)   r   r  rp  rT  rK  r  rt  r*   r+   r,   r.   r   r  r  	  sU     L NL]%'7&(9$o%'7G# 
 
r   r  c            
       sV   a  ] tR tRt o RtRtRRRRRR	R
RRR/tR t]R 4       t	Rt
V tR# )r  i	  ZmemorybackingZmemoryBackinghugepages.page[0-9]*.sizesizehugepages.page[0-9]*.unitunithugepages.page[0-9]*.nodesetr#  access.modeaccess_modesource.typesource_typec                r  )ZpageZpagesr  r  r  r   page_find_inst_cbZ%ParserMemoryBacking.page_find_inst_cb	  ,    $$V;4"6""r   c                s   \         P                  V 4       V P                  R R RR7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RR	RV P                  R
7       V P                  RRRR7       V P                  RRRR7       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RR4       R# )r<  Tr  rL  rM  r+  rN  rO  rP  r#  r*  ZnosharepagesZlockedrQ  rR  rS  rT  discardzallocation.modeZallocation_modezallocation.threadsZallocation_threadsN)rz  r  r  rU  r  r   r   rt  Z'ParserMemoryBacking._virtcli_class_init	  s    005Kt</cF[F[\/cF[F[\*..	 	 	
 	NNTBHh6M=1M=1Iy48%'89(*>?r   r0   N)r&   r'   r(   r)   r   r  rT  rU  r  rt  r*   r+   r,   r.   r   r  r  	  sJ     "L$N#V#V&	}}G# @ @r   r  c            
       s   a a ] tR tRt oRtRtRtRtRRRRR	R
RRRR/tR t	V 3R lt
R tR tR tR tR tR tR t]R 4       tRtVtV ;t# )r   i	  ZcpumodelF*numa.cell[0-9]*.distances.sibling[0-9]*.idz%cell[0-9]*.distances.sibling[0-9]*.id-numa.cell[0-9]*.distances.sibling[0-9]*.valuez(cell[0-9]*.distances.sibling[0-9]*.valuenuma.cell[0-9]*.idzcell[0-9]*.idnuma.cell[0-9]*.cpuszcell[0-9]*.cpusnuma.cell[0-9]*.memoryzcell[0-9]*.memoryc                sL   \         P                  ! \        4      p\        V P                  4       F%  w  r#VR9   g   K  W,          P                  V4       K'  	  \        V P                  P                  4       4       F  w  r#RpV'       g   \        V4      ^8X  d   K!  VP                  R4      '       d   R pMVP                  R4      '       d   RpV'       g   K^  V P                  V W,          P                  VR,          4       K  	  V P                  P                  V4       R# )r  r  NZ+r  :rv   NN)r  r  optionalr  forbid)ro  Zdefaultdictrf  rh  rg  r   rq  Zitemsr<   r   Zupdate)r   Z	convertedr   valuepolicy   &    r   _convert_old_feature_optionsZ&ParserCPU._convert_old_feature_options	  s      ++D1	-dkk:JCKK%%e, ;
 t||1134JCFCA ~~c"" $$"vLL%!((R1 5  	I&r   c                r5  r   )rc  r   r  r  r  r   r  ZParserCPU._parse
  s    ))+w~d##r   c                r  )cellZcellsr  r  r  r   cell_find_inst_cbZParserCPU.cell_find_inst_cb
  rV  r   c                t    V P                   ! V.VO5/ VB pTpR pRpV P                  WV4      pV! V.VO5/ VB # )ZsiblingZsiblingsre  r  r   ra  r7   r8   rd  r  r  rG     &&*,    r   cell_sibling_find_inst_cbZ#ParserCPU.cell_sibling_find_inst_cb
  sP    %%d<T<V<"$$V;$((((r   c                rf  cacheZcachesrg  rh  ri  r   cell_cache_find_inst_cbZ!ParserCPU.cell_cache_find_inst_cb
  sP    %%d<T<V< $$V;$((((r   c                r  )ZlatencyZ	latenciesr  r  r  r   latency_find_inst_cbZParserCPU.latency_find_inst_cb%
  s,    #$$V;4"6""r   c                r  )	bandwidthZ
bandwidthsr  r  r  r   bandwidth_find_inst_cbZ ParserCPU.bandwidth_find_inst_cb+
  ,    $$$V;4"6""r   c                s$   VR 8X  d,   \         P                  ! \        R4      4       VP                  pVR8X  d   VP                  pW!P
                  9   d   VP                  V P                  V4       R# VP                  V P                  V4       R# )hostz2CPU model=host is deprecated, use model=host-modelr   N)	r   r]   rE   ZSPECIAL_MODE_HOST_MODELZSPECIAL_MODE_CLEARZSPECIAL_MODESZset_special_modery   Z	set_modelr  r\  r   set_model_cbZParserCPU.set_model_cb5
  sj    &=KKNOP..C&=))C$$$!!$**c2NN4::s+r   c                s    VP                   p\        P                  ! V4       FN  pR pVP                   F  pVP                  V8X  g   K  Tp M	  V'       d	   WFn        K=  VP                  WT4       KP  	  R # r   )rE  r   rW  featuresrx   ra  Zadd_feature)r   ra  r    r   ra  Zfeature_nameZ
featureobjr6     &&&&    r   set_feature_cbZParserCPU.set_feature_cbA
  s^    #OOC0LJ]]66\)!"J #
 $*!  6 1r   c                sB
   \         P                  V 4       V P                  R R RR7       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  R	R	4       V P                  R
R
4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRV P
                  R7       V P                  R R!RV P
                  R"7       V P                  R#R$V P
                  R7       V P                  R%R&V P
                  R7       V P                  R'R(V P
                  R7       V P                  R)R*V P
                  RR+7       V P                  R,RV P                  R7       V P                  R-R.V P                  R7       V P                  R/R0V P                  R7       V P                  R1R2V P                  R7       V P                  R3R4V P                  R7       V P                  R5R6V P                  R7       V P                  R7R8V P                  R7       V P                  R9R:V P                  R7       V P                  R;R<V P                  R7       V P                  R=R>V P                  R7       V P                  R?R@V P                  R7       V P                  RARBV P                  R7       V P                  RCRDV P                  R7       V P                  RER.V P                  R7       V P                  RFR&V P                  R7       V P                  RGR>V P                  R7       V P                  RHR@V P                  R7       V P                  RIRDV P                  R7       V P                  RJRBV P                  R7       V P                  RKR.V P                  R7       V P                  RLR&V P                  R7       R# )MZsecureTr  rX  r;  zmodel.fallbackZmodel_fallbackzmodel.vendor_idZmodel_vendor_idvendorr%  r   r  Z
migratableztopology.socketsztopology.diesztopology.coresztopology.threadszcache.levelz
cache.modezmaxphysaddr.modezmaxphysaddr.bitsr  Nr  r  r^  r  r_  r[  r  r+  r\  Zcpusr*  r]  r,  znuma.cell[0-9]*.unitrO  znuma.cell[0-9]*.memAccessZ	memAccessznuma.cell[0-9]*.discardrW  rL  rJ  rY  rZ  r`  z!numa.cell[0-9]*.cache[0-9]*.levelrI   z)numa.cell[0-9]*.cache[0-9]*.associativityZassociativityz"numa.cell[0-9]*.cache[0-9]*.policyra  z&numa.cell[0-9]*.cache[0-9]*.size.valueZ
size_valuez%numa.cell[0-9]*.cache[0-9]*.size.unit	size_unitz&numa.cell[0-9]*.cache[0-9]*.line.valueZ
line_valuez%numa.cell[0-9]*.cache[0-9]*.line.unitZ	line_unitz*numa.interconnects.latency[0-9]*.initiatorZ	initiatorz'numa.interconnects.latency[0-9]*.targettargetz&numa.interconnects.latency[0-9]*.cacherl  z%numa.interconnects.latency[0-9]*.typer   z&numa.interconnects.latency[0-9]*.valuez%numa.interconnects.latency[0-9]*.unitz,numa.interconnects.bandwidth[0-9]*.initiatorz)numa.interconnects.bandwidth[0-9]*.targetz'numa.interconnects.bandwidth[0-9]*.typez(numa.interconnects.bandwidth[0-9]*.cachez(numa.interconnects.bandwidth[0-9]*.valuez'numa.interconnects.bandwidth[0-9]*.unit)
rz  r  r  rs  rv  re  rj  rm  rn  rp  r  r   r   rt  ZParserCPU._virtcli_class_initP
  s   005Hh6GW)9)9: 	$&67%'89Hh'FF#GW%GW%L,>&(:;O_5$&67&(:;M=1L,/&(:;&(:; 	GTTc6H6HIItt8J8JKJ9K9KLItt8J8JKHdds7I7IJ 	($S=R=RS"FdI^I^ 	 	
 	,hSEZEZ[*FAVAVW/3K`K`a%ys?T?T_c 	 	
 	866 	 	

 	;66 	 	
 	/sGbGb 	 	
 	744 	 	

 	0(IdId 	 	
 	444 	 	

 	344 	 	

 	444 	 	

 	344 	 	
 	811 	 	

 	511 	 	

 	4gCLdLd 	 	
 	3V#JbJb 	 	
 	4gCLdLd 	 	
 	3V#JbJb 	 	
 	:33 	 	

 	733 	 	

 	533 	 	

 	633 	 	

 	633 	 	

 	533 	 	
r   r0   )r&   r'   r(   r)   r   r  rp  r  rT  rc  r  re  rj  rm  rn  rp  rs  rv  r  rt  r*   r+   r   r   r   r   r   r   	  s     LNLI46]79co 1 "5G'8$#))##
,7 L
 L
 L
r   r   c                   sv   a  ] tR tRt o RtRtRtRtR tR t	R t
R tR	 tR
 tR tR tR t]R 4       tRtV tR# )r  i
  ZcputunerX  Fc                r  )ZvcpupinZvcpupinsr  r  r  r   vcpupin_find_inst_cbZ"ParserCputune.vcpupin_find_inst_cb
  ,    "$$V;4"6""r   c                r  )ZiothreadpinZiothreadpinsr  r  r  r   iothreadpin_find_inst_cbZ&ParserCputune.iothreadpin_find_inst_cb
  ,    &$$V;4"6""r   c                r  )Z	vcpuschedZ
vcpuschedsr  r  r  r   vcpusched_find_inst_cbZ$ParserCputune.vcpusched_find_inst_cb
  rq  r   c                r  )ZiothreadschedZiothreadschedsr  r  r  r   iothreadsched_find_inst_cbZ(ParserCputune.iothreadsched_find_inst_cb
  s,     ($$V;4"6""r   c                r  )	cachetuneZ
cachetunesr  r  r  r   cachetune_find_inst_cbZ$ParserCputune.cachetune_find_inst_cb  rq  r   c                rf  rk  r  r  r   ra  r7   r8   r  r  r  rG  ri  r   cache_find_inst_cbZ ParserCputune.cache_find_inst_cb	  sP    //FtFvF	 $$V;$((((r   c                rf  )ZmonitorZmonitorsr  r  ri  r   monitor_find_inst_cbZ"ParserCputune.monitor_find_inst_cb  sP    //FtFvF	"$$V;$((((r   c                r  )
memorytuneZmemorytunesr  r  r  r   memorytune_find_inst_cbZ%ParserCputune.memorytune_find_inst_cb  s,    %$$V;4"6""r   c                rf  )ZnodeZnodes)r  r  )r   ra  r7   r8   r  r  r  rG  ri  r   node_find_inst_cbZParserCputune.node_find_inst_cb!  sP    11$HHH
$$V;$((((r   c                s   \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
V P                  R7       V P                  RRRV P                  R7       V P                  RRRR7       V P                  RRV P                  R7       V P                  RRRV P                  R7       V P                  RR4       V P                  RR4       V P                  RRRV P
                  R7       V P                  RRV P
                  R7       V P                  RRV P
                  R7       V P                  R R!RV P                  R7       V P                  R"RV P                  R7       V P                  R#RV P                  R7       V P                  R$RV P                  RR%7       V P                  R&R'V P                  R7       V P                  R(R)V P                  R7       V P                  R*R+V P                  R7       V P                  R,R-V P                  R7       V P                  R.R/V P                  R7       V P                  R0R)V P                  R7       V P                  R1RV P                  RR%7       V P                  R2RV P                  RR%7       V P                  R3R'V P                  R7       V P                  R4R5V P                  R7       R6# )7ZsharesZperiodZquotaZglobal_periodZglobal_quotaZemulator_periodZemulator_quotaZiothread_periodZiothread_quotazvcpupin[0-9]*.vcpuvcpur+  zvcpupin[0-9]*.cpusetcpusetTr*  zemulatorpin.cpusetZemulatorpin_cpusetr  ziothreadpin[0-9]*.iothreadiothreadziothreadpin[0-9]*.cpusetzemulatorsched.schedulerZemulatorsched_schedulerzemulatorsched.priorityZemulatorsched_priorityzvcpusched[0-9]*.vcpusvcpuszvcpusched[0-9]*.schedulerZ	schedulerzvcpusched[0-9]*.priorityZpriorityziothreadsched[0-9]*.iothreads	iothreadsziothreadsched[0-9]*.schedulerziothreadsched[0-9]*.priorityzcachetune[0-9]*.vcpus)rL  rH  zcachetune[0-9]*.cache[0-9]*.idr  z!cachetune[0-9]*.cache[0-9]*.levelrI   z cachetune[0-9]*.cache[0-9]*.typer   z cachetune[0-9]*.cache[0-9]*.sizerM  z cachetune[0-9]*.cache[0-9]*.unitrO  z#cachetune[0-9]*.monitor[0-9]*.levelz#cachetune[0-9]*.monitor[0-9]*.vcpuszmemorytune[0-9]*.vcpuszmemorytune[0-9]*.node[0-9]*.idz%memorytune[0-9]*.node[0-9]*.bandwidthro  N)rz  r  r  r{  r}  r  r  r  r  r  r  r  r  r   r   rt  Z!ParserCputune._virtcli_class_init*  s[   005Hh'Hh'GW%O_5NN3%'89$&67%'89$&67 	(&s?W?WX"H3KcKc 	 	
 	(*>$O(*3C_C_ 	 	
 	&55	 	 	
 	-/HI,.FG#33	 	 	
 	'3C]C] 	 	
 	.
IcIcd+77	 	 	
 	+77 	 	

 	*JSEcEc 	 	

 	#33	 	 	
 	4dI_I_`/sG]G] 	 	
 	6SMcMcd6SMcMcd6SMcMcd17IaIa 	 	
 	111	 	 	
 	$44	 	 	
 	4dI^I^_3[sOdOd 	 	
r   r0   N)r&   r'   r(   r)   r   r  rp  r  r{  r}  r  r  r  r  r  r  r  r  rt  r*   r+   r,   r.   r   r  r  
  s\     LNLI#####))#) Y
 Y
r   r  c                   sH   a  ] tR tRt o RtRtRtR tR t]	R 4       t
RtV tR# )r  i  r  c                r  )r  Ziothreadidsr  r  r  r   iothreads_find_inst_cbZ&ParserIOThreads.iothreads_find_inst_cb  s,    %$$V;4"6""r   c                r'  )Zdefaultiothreadr  r  r  r   defaultiothread_find_inst_cbZ,ParserIOThreads.defaultiothread_find_inst_cb  s,    ")$$V;4"6""r   c                s4   \         P                  V 4       V P                  R R 4       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  R	RV P                  R7       V P                  R
RV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       R# )r  ziothreadids.iothread[0-9]*.idr  r+  z*iothreadids.iothread[0-9]*.thread_pool_minZthread_pool_minz*iothreadids.iothread[0-9]*.thread_pool_maxZthread_pool_maxzdefaultiothread.thread_pool_minzdefaultiothread.thread_pool_maxz#iothreadids.iothread[0-9]*.poll.maxZmaxz$iothreadids.iothread[0-9]*.poll.growZgrowz&iothreadids.iothread[0-9]*.poll.shrinkZshrinkN)rz  r  r  r  r  r  r   r   rt  Z#ParserIOThreads._virtcli_class_init  s   005K-3THbHbc833 	 	

 	833 	 	

 	-99 	 	

 	-99 	 	

 	15sGaGa 	 	
 	2FIcIc 	 	
 	433 	 	
r   r0   N)r&   r'   r(   r)   r   r  rp  r  r  r  rt  r*   r+   r,   r.   r   r  r    s2     L NL## #
 #
r   r  c                   sj   a a ] tR tRt oRtRtRR/tR tR tV 3R lt	R	 t
R
 t]R 4       tRtVtV ;t# )r   i  r  r  vcpu.placementZ	placementc                s   R V P                   9   pRV P                   9   pRV P                   9   pV'       d5   V'       d+   V P                   P                  R 4      V P                   R&   R# R# V'       d[   V'       d)   V P                   P                  R4      V P                   R&   V P                   P                  R 4      V P                   R&   R# R# )maxvcpusvcpu.currentr  Nr1  )r   r3  r2  Zhavevcpr  r   _convert_old_vcpu_optsZ!ParserVCPU._convert_old_vcpu_opts  s    , DLL0DLL('+||'7'7
'CV$ /3||/?/?/G^,#'<<#3#3J#?DLL  r   c                    R V P                   9   d)   V P                   P                  R 4      V P                   R&   RV P                   9   d+   V P                   P                  R4      V P                   R&   R# R# )r  vcpu.cpusetr  r  Nr1  r   r   r   _add_advertised_aliasesZ"ParserVCPU._add_advertised_aliases  s[     t||#*.,,*:*:8*DDLL'dll"#'<<#3#3G#<DLL  #r   c                sb   < V P                  4        V P                  4        \        SV `  V4      # r   )r  r  r   r  r  r  r   r  ZParserVCPU._parse  s*    $$&##%w~d##r   c                r  )r  zvcpulist.vcpur  r  r  r   vcpu_find_inst_cbZParserVCPU.vcpu_find_inst_cb  s,    '$$V;4"6""r   c                s2    VR 8w  d	   W!n         R# R Vn        R# )r  N)vcpu_cpusetvcpu_placementr  r\  r   set_cpuset_cbZParserVCPU.set_cpuset_cb  s    &=" %r   c                s   \         P                  V 4       V P                  R RV P                  R7       V P                  RRRV P                  R7       V P                  RRV P                  R7       V P                  RR4       V P                  R	R
4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRV P                  R7       V P                  RR4       V P                  RRV P
                  R7       V P                  RRV P
                  RR7       V P                  RRV P
                  RR7       V P                  RRV P
                  R7       R# ) r  r  r;  r  r  T)rH  rG  Zsocketszcpu.topology.socketsZdieszcpu.topology.diesZcoreszcpu.topology.coresZthreadszcpu.topology.threadsr  r  Zvcpu_currentr  r  r  zvcpus.vcpu[0-9]*.idr  r+  zvcpus.vcpu[0-9]*.enabledenabledrx  zvcpus.vcpu[0-9]*.hotpluggableZhotpluggablezvcpus.vcpu[0-9]*.orderZorderN)rz  r  r  r  r  r  r  r   r   rt  ZParserVCPU._virtcli_class_init   sV   005JCLL9HmtMGW6 	I56F/0G12I56 	FG$NN3M=DSEVEVW$&67 	)4c>S>ST&	@U@U`d 	 	
 	+..	 	 	
 	,gCDYDYZr   r0   )r&   r'   r(   r)   r   rp  rT  r  r  r  r  r  r  rt  r*   r+   r   r   r   r   r   r     sQ     LL+G@=$#	% [ [ [r   r   c                   s   a a ] tR tRt oRtRtRRRRRR	R
RR.RRRRRRRRRR/	tR tV 3R ltR t	R t
R tR tR tR tR tR  tR! tR" tR# t]R$ 4       tR%tVtV ;t# )&r(  i(  bootrX   bios.rebootTimeoutZrebootTimeoutbios.useserialZ	useserialbootmenu.enableZmenucmdlineZ
extra_argsr  loader.readonly	loader_roloader.typeloader_typeloader.secureloader_securenvram.templatenvram_templatesmbios.modesmbios_modec                s    . p\        V P                  P                  4       4       F;  pW1P                  9  d   K  V P                  V W29  g   K*  VP	                  V4       K=  	  V'       d	   W!n        R # R # r   )rf  rq  r  ZBOOT_DEVICESr   Z	bootorder)r   ra  
boot_orderrE  r   r   _convert_boot_orderZParserBoot._convert_boot_order7  sa    
DLL--/0G///W%(!!'* 1 'N r   c                s   < V P                  V4       V P                  P                  R R4      f   RV P                  R &   \        SV `  V4      # )uefir4  rf   )r  rq  r#   r   r  r  r  r   r  ZParserBoot._parseE  sG      & <<FB'/#'DLL w~d##r   c                sJ    VR J d   V P                   P                  4        R# R# )TN)ry   Zrefresh_machine_typer  r\  r   refresh_machine_type_cbZ"ParserBoot.refresh_machine_type_cbR  s    $;JJ++- r   c                s    \        R V4      pV P                  '       g   W P                  n        R# V'       g   V P                  P	                  4        R# V P                  P                  4        R# )r  N)r9  r  ry   Zuefi_requestedZdisable_uefiZenable_uefir  r\  r   set_uefi_cbZParserBoot.set_uefi_cbV  sF    fc*||| ),JJ%

'')

&&(r   c                r  r   )Zset_initargs_stringr  r\  r   set_initargs_cbZParserBoot.set_initargs_cbd        %r   c                &    W P                   n        R # r   )ry   
bootloaderr  r\  r   set_bootloader_cbZParserBoot.set_bootloader_cbg  s     #

r   c                r  r   )ry   bootloader_argsr  r\  r   set_bootloader_args_cbZ!ParserBoot.set_bootloader_args_cbj  s    %(

"r   c                r  r   )ry   r   r  r\  r   set_domain_type_cbZParserBoot.set_domain_type_cbm  s    

r   c                r  r   )ry   emulatorr  r\  r   set_emulator_cbZParserBoot.set_emulator_cbp  s    !

r   c                r  )r  Zbootdevsr  r  r  r   boot_find_inst_cbZParserBoot.boot_find_inst_cbs  s,    "$$V;4"6""r   c                r  )Zinitarginitargsr  r  r  r   initarg_find_inst_cbZParserBoot.initarg_find_inst_cby  r|  r   c                r  )ZinitenvZinitenvsr  r  r  r   initenv_find_inst_cbZParserBoot.initenv_find_inst_cb  r|  r   c                r  )ZfeatureZfirmware_featuresr  r  r  r   feature_find_inst_cbZParserBoot.feature_find_inst_cb  s,    +$$V;4"6""r   c                s(   \         P                  V 4       V P                  R RRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRV P                  RRR7       V P                  R	R	4       V P                  R
R
4       V P                  RR4       V P                  RRRV P
                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  RR4       V P                  RRV P                  RR7       V P                  RR V P                  R!7       V P                  R"R"4       V P                  R#R$4       V P                  R%R&V P                  R!7       V P                  R'R(RR7       V P                  R)R*4       V P                  R+R,RR7       V P                  R-R.4       V P                  R/R04       V P                  R1R24       V P                  R3R34       V P                  R4R44       V P                  R5R6RR77       V P                  R8R84       V P                  R9R:4       V P                  R;R<4       V P                  R=R=4       V P                  R>R>V P                  R?7       V P                  R@RAV P                  R!7       V P                  RBRCV P                  R!7       V P                  RDR V P                  R!7       V P                  RERE4       V P                  RFRF4       V P                  RGRG4       R# )HZhdNr  ZcdromZfdnetworkzrefresh-machine-typeTr|  Zos_typeZarchZmachiner  r  Zdomain_typer  r  Zloaderr  r  r  r  r  r  r  zloader.statelessZloader_statelessZfirmwarezfirmware.feature[0-9]*.enabledr  rx  zfirmware.feature[0-9]*.namerx   r+  Znvramr  r  zboot[0-9]*.devr   r  Zbootmenu_enablezbootmenu.timeoutZbootmenu_timeoutr  Zbios_useserialr  Zbios_rebootTimeoutr  r  znvram.templateFormatZnvram_templateFormatr  r  r  r  r  Zdtbz
acpi.tableZacpi_tbzacpi.table.typeZacpi_tb_typery  r  r;  zinitarg[0-9]*r    zinitenv[0-9]*r`  zinitenv[0-9]*.nameZinitdirZinituserZ	initgroup)rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   rt  ZParserBoot._virtcli_class_init  s}   005 	D$$3<<@GTTcllCD$$3<<@IttE"** 	 	
 	Iy)FF#Iy)L$$3;P;PQ%tt@Z@Z[M44C<R<RSJ9L9LMFDDS__E 	Hh'%{TBM=1O_tD&(:TJ 	J
+,11	 	 	
 	16H`H`aGW%$&67$e#:O:OP%'84H&(:;$&6F(*>?M=1*,BC 	Hh'Hh'I}=E5!L),%~6 	FF#J
s/B/BCOU9Q9QROW3;S;ST(&s?W?WXIy)J
+K-r   r0   )r&   r'   r(   r)   r   r  rT  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rt  r*   r+   r   r   r   r   r(  r(  (  s     LNo+6L-0;}*}
G($.)&$)"#### F. F. F.r   r(  c                   sT   a  ] tR tRt o RtRtRRRRRRR	R
RRRR/t]R 4       tRt	V t
R# )r)  i  Zidmap	uid.start	uid_start
uid.target
uid_target	uid.count	uid_count	gid.start	gid_start
gid.target
gid_target	gid.count	gid_countc                s   \         P                  V 4       V P                  R R4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR	4       V P                  R
R4       R# )r  r  r  r  r  r  r  r  r  r  r  r  Nr  r  r   r   rt  ZParserIdmap._virtcli_class_init  sd    005K-L,/K-K-L,/K-r   r0   Nr&   r'   r(   r)   r   r  rT  r  rt  r*   r+   r,   r.   r   r)  r)    sH     LN[l[[l[G . .r   r)  c                   r  )r  i  seclabel	seclabelsc                s    \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       R# )	r   rX  relabelTr  labelr  Z	baselabelNr  r  r   r   rt  Z"ParserSeclabel._virtcli_class_init  sb    005FF#GW%Iy48GW5K=r   r0   N
r&   r'   r(   r)   r   r  r  rt  r*   r+   r,   r.   r   r  r    s!     L N> >r   r  c                   s>   a  ] tR tRt o RtRtR t]R 4       tRt	V t
R# )r  i	  Zkeywrapc                r'  )Zcipherr  r  r  r   cipher_find_inst_cbZ!ParserKeyWrap.cipher_find_inst_cb  s,     $$V;4"6""r   c                s    \         P                  V 4       V P                  R RRV P                  R7       V P                  RRRV P                  R7       R# )zcipher[0-9]*.namerx   Tr*  zcipher[0-9]*.stater   N)rz  r  r  r  r  r   r   rt  Z!ParserKeyWrap._virtcli_class_init  sR    0054cF]F] 	 	
 	 'TH_H_ 	 	
r   r0   N)r&   r'   r(   r)   r   r  r  r  rt  r*   r+   r,   r.   r   r  r  	  s(     LN# 
 
r   r  c                   sp   a  ] tR tRt o RtRtRRRRRRR	R
RRRRRRRRRRRRRRRRRR/t]R 4       tRt	V t
R# ) r  i#  rt  apic.eoieoi	pmu.statepmuvmport.statevmportkvm.hidden.state
kvm_hiddengic.versiongic_version	smm.statesmmvmcoreinfo.state
vmcoreinfohyperv.relaxed.statehyperv_relaxedhyperv.vapic.statehyperv_vapichyperv.spinlocks.statehyperv_spinlockshyperv.spinlocks.retrieshyperv_spinlocks_retrieshyperv.synic.statehyperv_synichyperv.reset.statehyperv_resetc                s8   \         P                  V 4       V P                  R R RR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RR	RR7       V P                  R
RRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  R R!RR7       V P                  R"R#RR7       V P                  R$R%RR7       V P                  R&R'RR7       V P                  R(R)RR7       V P                  R*R+RR7       V P                  R,R-RR7       V P                  R.R/RR7       V P                  R0R1RR7       V P                  R2R3RR7       V P                  R4R5RR7       V P                  R6R7RR7       V P                  R8R9RR7       V P                  R:R;RR7       V P                  R<R=RR7       V P                  R>R?RR7       V P                  R@RA4       V P                  RBRCRR7       V P                  RDRERR7       V P                  RFRG4       V P                  RHRI4       RJ# )KZacpiTr  ZapicZpaeZprivnetZhapZviridianr  r  r  r  r  r  r  r  r  r  r  r  zhyperv.vpindex.stateZhyperv_vpindexzhyperv.runtime.stateZhyperv_runtimer  r  zhyperv.stimer.stateZhyperv_stimerzhyperv.stimer.direct.stateZhyperv_stimer_directr  r  zhyperv.frequencies.stateZhyperv_frequencieszhyperv.reenlightenment.stateZhyperv_reenlightenmentzhyperv.tlbflush.stateZhyperv_tlbflushzhyperv.tlbflush.direct.stateZhyperv_tlbflush_directzhyperv.tlbflush.extended.stateZhyperv_tlbflush_extendedzhyperv.ipi.stateZ
hyperv_ipizhyperv.evmcs.stateZhyperv_evmcszhyperv.avic.stateZhyperv_aviczhyperv.xmm_input.stateZhyperv_xmm_inputzhyperv.emsr_bitmap.stateZhyperv_emsr_bitmapr  r  r  r  zkvm.hint-dedicated.stateZkvm_hint_dedicatedzkvm.poll-control.stateZkvm_poll_controlzkvm.pv-ipi.stateZ
kvm_pv_ipizpvspinlock.stateZ
pvspinlockr  r  r  r  r  r  zioapic.driverZioapic_driverzmsrs.unknownZmsrs_unknownNr  r  r   r   rt  Z"ParserFeatures._virtcli_class_init6  s   005FFT2FFT2E540Iy48E540J
T:J5K6*,<tL(.4H,.@4P.0JK*,<tL*,<tL(.4H)?TJ02HSWX(.4H.0DtT24LW[\+->N24LW[\46P[_`&tD(.4H'F,.@4P.0DtTNHt<&tD.0DtT,.@4P&tD&tDM=1K6&tDO_5NN3r   r0   Nr  r,   r.   r   r  r  #  sn     LNEUL}UL 0n "4"$>nnG  -4 -4r   r  c                   s\   a a ] tR tRt oRtRtR tV 3R ltR tR t	]
R 4       tRtVtV ;t# )	r   il  Zclockc                s   R V P                   9   d   V P                   P                  R 4       RV P                   9   d   V P                   P                  R4       RV P                   9   d   V P                   P                  R4       RV P                   9   d   V P                   P                  R4       RV P                   9   d   V P                   P                  R4       R# R# )Zplatform_tickpolicyZhpet_tickpolicyZtsc_tickpolicyZkvmclock_tickpolicyZhypervclock_tickpolicyNr1  r   r   r   _remove_old_optionsZParserClock._remove_old_optionsp  s     !DLL0LL23,LL./t||+LL-. DLL0LL23#t||3LL56 4r   c                r5  r   )r  r   r  r  r  r   r  ZParserClock._parse  s      "w~d##r   c                s   VP                   P                  R 4      w  rERpVP                   F  pVP                  V8X  g   K  Tp M	  V'       g!   VP                  P	                  4       pWFn        \
        P                  ! WeV4       R# )rE   N)rE  r   timersrx   r  r   r`  )r   ra  r    r   ZtnamerF  Ztimerobjr3  ru  r   	set_timerZParserClock.set_timer  sj    !////4Avv 
 {{**,H!Mh#6r   c                r  )Ztimerr  r  r  r  r   timer_find_inst_cbZParserClock.timer_find_inst_cb  ,     $$V;4"6""r   c                s   \         P                  V 4       V P                  R RRV P                  R7       V P                  RRRV P                  R7       V P                  RRRRV P                  R7       V P                  RRRRV P                  R7       V P                  RRRRV P                  R7       V P                  R	RRRV P                  R7       V P                  R
RRRV P                  R7       V P                  RRRRV P                  R7       V P                  RRRRV P                  R7       V P                  RR4       V P                  RRV P                  R7       V P                  RRRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  R R!V P                  R7       R# )"Zpit_tickpolicyNr  Zrtc_tickpolicyZplatform_presentT)rK  rJ  rG  Zpit_presentZrtc_presentZhpet_presentZtsc_presentZkvmclock_presentZhypervclock_presentZoffsetztimer[0-9]*.namerx   r+  ztimer[0-9]*.presentZpresentrJ  rL  ztimer[0-9]*.tickpolicyZ
tickpolicyztimer[0-9]*.trackZtrackztimer[0-9]*.moder%  ztimer[0-9]*.frequencyZ	frequencyztimer[0-9]*.catchup.thresholdZ	thresholdztimer[0-9]*.catchup.slewZslewztimer[0-9]*.catchup.limitZlimit)rz  r  r  r  r  r  r   r   rt  ZParserClock._virtcli_class_init  s   005
 	$dds}}M$dds}}M&tPSP]P]^M44$3==YM44$3==YNDD4CMMZM44$3==Y&tPSP]P]^)44$SVS`S`a 	Hh'&S=S=ST!9t#J`J` 	 	
 	,lI_I_`'s?U?UV&S=S=ST+[sG]G]^+[sG]G] 	 	
 	.SE[E[\/sG]G]^r   r0   )r&   r'   r(   r)   r   r  r  r  r  r  r  rt  r*   r+   r   r   r   r   r   r   l  s?     LN7$7# _ _ _r   r   c                   sD   a  ] tR tRt o RtRtRRRR/t]R 4       tRt	V t
R	# )
r!  i  Zpmsuspend_to_mem.enabledsuspend_to_memsuspend_to_disk.enabledsuspend_to_diskc                s    \         P                  V 4       V P                  R RRR7       V P                  RRRR7       R# )r  r  Tr  r  r  Nr  r  r   r   rt  ZParserPM._virtcli_class_init  s8    005,.>N-/@4Pr   r0   Nr  r,   r.   r   r!  r!    s8     LN "2!#4G
 Q Qr   r!  c                   s   a a ] tR tRt oRtRtRt/ RRbRRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!bR"R#bR$R%btV 3R& ltR' t	R( t
R) tR* t]R+ 4       tR,tVtV ;t# )-r$  i  sysinfor   bios.vendorbios_vendorbios.versionbios_version	bios.date	bios_datebios.releasebios_releasesystem.manufacturersystem_manufacturersystem.productsystem_productsystem.versionsystem_versionsystem.serialsystem_serialsystem.uuidsystem_uuid
system.sku
system_skusystem.familysystem_familybaseBoard.manufacturerbaseBoard_manufacturerbaseBoard.productbaseBoard_productbaseBoard.versionbaseBoard_versionbaseBoard.serialbaseBoard_serialbaseBoard.assetbaseBoard_assetbaseBoard.locationbaseBoard_locationc                s   < V P                   '       d!   R V P                  9  d   RV P                  R &   V'       gF   V P                  R ,          pV P                  P                   F  pVP                  V8X  g   K  Tp M	  \
        SV `  V4      # )r   smbios)rg  rq  ry   r  r   r   r  )r   ra  rT   r  r   s   &&  r   r  ZParserSysinfo.parse  ss    ;;;65 $,DLL  ,,v&C::--<<3&"D .
 w}T""r   c                s    VR 8X  g   VR8X  d   W P                   P                  n        R# VR8X  d   RV P                   P                  n        W!n        R# )rr  ZemulateNr  r  )ry   rX   r  r   r  r\  r   set_type_cbZParserSysinfo.set_type_cb  s=    &=C9,(+JJMM%(?(1DJJMM%	r   c                s2    W!n         W P                  n        R # r   )r
  ry   r  r  r\  r   set_uuid_cbZParserSysinfo.set_uuid_cb  s    
 

r   c                r  )entryZ
oemStringsr  r  r  r   oem_find_inst_cbZParserSysinfo.oem_find_inst_cb  s,    $$$V;4"6""r   c                r  )r  Zentriesr  r  r  r   entry_find_inst_cbZ ParserSysinfo.entry_find_inst_cb  s,    !$$V;4"6""r   c                s   \         P                  V 4       V P                  R R V P                  RR7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R R!4       V P                  R"R#4       V P                  R$R%4       V P                  R&R'4       V P                  R(R)4       V P                  R*R+4       V P                  R,R-4       V P                  R.R/4       V P                  R0R1RV P
                  R27       V P                  R3R1RV P                  R27       V P                  R4R5RV P                  R27       V P                  R6R7RV P                  R27       R8# )9r   T)rG  rH  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r	  r
  r;  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  zchassis.manufacturerZchassis_manufacturerzchassis.versionZchassis_versionzchassis.serialZchassis_serialzchassis.assetZchassis_assetzchassis.skuZchassis_skuzoemStrings.entry[0-9]*r`  r*  zentry[0-9]*zentry[0-9]*.namerx   zentry[0-9]*.filers   N)rz  r  r  r  r  r  r   r  r   r   rt  Z!ParserSysinfo._virtcli_class_init%  s   005FFs$G 	M=1NN3K-NN3 	)+@A$&67$&67O_5M=S__EL,/O_5 	,.FG')<=')<=&(:;%'89(*>?*,BC%'89$&67O_5M=1$gCL`L` 	 	
 	M7dI_I_`&$SMcMcd&$SMcMcdr   r0   )r&   r'   r(   r)   r   r  rp  rT  r  r  r  r  r   r  rt  r*   r+   r   r   r   r   r$  r$    s!    LNL} 	[ 		
 	4 	* 	* 	 	} 	l 	 	!": 	0 	0 	.  	,!" 	2#G(#.## (e (e (er   r$  c                   sV   a a ] tR tRt oRtRtR tR tV 3R lt]	R 4       t
RtVtV ;t# )	r%  iV  Zqemu_commandlineZ
xmlns_qemuc                s    \         P                  ! V4       F#  pVP                  P                  4       pWEn        K%  	  R # r   )r   r   r7   r  r`  )r   ra  r    r   r   r     &&&&  r   args_cbZParserQemuCLI.args_cbZ  s,    ;;s#C))##%CI $r   c                sz    VP                  R ^4      w  rEVP                  P                  4       pWFn        WVn        R# r  )r   Zenvsr  rx   r`  )r   ra  r    r   rx   Zenvvalr  s   &&&&   r   env_cbZParserQemuCLI.env_cb_  s0    yya(ii!	r   c                st  < V P                   P                  4        V P                  P                  R 4      '       d2   V P                  P	                  R^4      ^,          V P                   R&   MV P                  P                  R4      '       d2   V P                  P	                  R^4      ^,          V P                   R&   MkV P                  P                  R4      '       d2   V P                  P	                  R^4      ^,          V P                   R&   MV P                  V P                   R&   \
        SV `  V4      # )zenv=r   envzargs=r7   z	clearxml=r{  )rq  r  rg  r   r   r   r  r  r  r   r  ZParserQemuCLI._parsee  s    ;;!!&))"&++"3"3C";A">DLL[[##G,,#';;#4#4S!#<Q#?DLL [[##K00'+{{'8'8a'@'CDLL$#';;DLL w~d##r   c                s    \         P                  V 4       V P                  R RRV P                  RR7       V P                  RRRV P                  RR7       R# )r7   NT)rK  rG  rH  r$  )rz  r  r  r"  r#  r  r   r   rt  Z!ParserQemuCLI._virtcli_class_initq  sD    005FDDS[[DQE44CJJ$Or   r0   )r&   r'   r(   r)   r   r  r"  r#  r  r  rt  r*   r+   r   r   r   r   r%  r%  V  s:     %L!N

$ P P Pr   r%  c                sX  a  V 3R lpV! RR4       V! RR4       V! RR4       V! RR4       V! RRRR7       V! R	R	4       V! R
R
4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       R pV'       d   RS P                   R&   V! RRVR7       V'       d
   V! RR4       V'       d/   V! RR RR7       V! R!R"RR7       V! R#R$RR7       V! R%R&RR7       R'# R'# )(z.
Add common Device parameters, like address.*
c                  r  r  r  r  r  r   r  Z)_add_common_device_args.<locals>._add_arg  r  r   zaddress.typezaddress.domainzaddress.buszaddress.slotzaddress.multifunctionTr  zaddress.functionzaddress.controllerzaddress.unitzaddress.portzaddress.targetzaddress.regzaddress.cssidzaddress.ssidzaddress.devnoaddress.iobasezaddress.irqzaddress.basezaddress.zpci.uidzaddress.zpci_uidzaddress.zpci.fidzaddress.zpci_fidz
alias.namec                 sR    \        V4      pV P                  P                  W4       R # r   )r   ry   Zreorder_boot_orderr  r\  r   set_boot_order_cbZ2_add_common_device_args.<locals>.set_boot_order_cb  s    #h

%%d0r   r  z
boot.orderr;  zboot.loadparmz
driver.atszvirtio_driver.atszdriver.iommuzvirtio_driver.iommuzdriver.packedzvirtio_driver.packedzdriver.page_per_vqzvirtio_driver.page_per_vqN)rT  )rx  r  boot_loadparmvirtio_optionsr  r&  s   f&&&  r   _add_common_device_argsr)  }  sS   
% ^^,/0]M*^^,$&=M!34!#78^^,^^,/0]M*_o.^^,_o./0]M*^^,!34!34\<(1 $0L!|0AB/22TB!6F"84H%'BTR	 r   c                 s   a a V3R  lpV 3R lpV! VR,           RVR7       V! VR,           RRVR7       V! VR	,           R
RVR7       R# )c                 s<   < R pV P                  VS4      pV! V/ VB # )r  r  )cr7   r8   r  rG  r  s   &*,  r   seclabel_find_inst_cbZ8_add_device_seclabel_args.<locals>.seclabel_find_inst_cb  s*    !!&-84"6""r   c                  r  r  r  r  r  r   r  Z+_add_device_seclabel_args.<locals>._add_arg  r  r   source.seclabel[0-9]*.modelrX  r+  source.seclabel[0-9]*.relabelr  Tr  source.seclabel[0-9]*.labelr  r*  Nr0   )rx  r  r   r+  r  s   ff&  r   _add_device_seclabel_argsr/    sX    #%
 V33WK`a00*	 ..*	r   c                s  a a R pR pR pV V3R lpV! RR4       V! RRVR7       V! RR4       V! R	R	VR7       V! R
R
4       V! RRVR7       V! RR4       V! RR4       V! RR4       V! RR4       \        S RSR7       V! RR4       V! RR4       V! RRRR7       V! RRRR7       V! RR4       V! RR4       V! RRRR7       R # )!za
Add arguments that represent the CharSource object, which is shared
among multiple device types
c                 <    VP                   P                  V4       R # r   sourceZset_friendly_hostr*  ra  r    r   r\  r   set_sourcehost_cbZ0_add_char_source_args.<locals>.set_sourcehost_cb      %%c*r   c                 r0  r   )r2  set_friendly_bindr3  r\  r   set_bind_cbZ*_add_char_source_args.<locals>.set_bind_cb  r5  r   c                 r0  r   )r2  set_friendly_connectr3  r\  r   set_connect_cbZ-_add_char_source_args.<locals>.set_connect_cb  s    ((-r   c                 sN   < R VR&   SP                   ! SV ,           V.VO5/ VB  R# r  r  )rE  rF  r7   r8   rx  r   s   &&*,r   r  Z'_add_char_source_args.<locals>._add_arg  s+    ,0()FW$h@@@r   source.pathsource.hostr;  zsource.servicesource.bind_hostzsource.bind_servicezsource.connect_hostzsource.connect_servicesource.modezsource.masterzsource.slavezsource.seclabelsr   protocol.typesource.protocolzlog.filezsource.log_filez
log.appendzsource.log_appendTr  zsource.clipboard.copypastezsource.clipboard_copypastezsource.mouse.modezsource.mouse_modezsource.channelz
source.tlsN)r/  )rx  r   r4  r7  r9  r  s   ff    r   _add_char_source_argsrA    s    ++.A ]M*]M.?@/0!3D"$9:"$9nM%'?@]M*_o.^^,c#5fE_/0Z*+\.>)+GRVW "56/0\<$7r   c                 sJ    V P                   P                  4       '       d   R # R# )Zqcow2Zraw)ZsupportZconn_default_qcow2)rd   r   r   _default_image_file_formatrB    s    ||&&((r   c                 s|    \        V 4      pWn        VP                  \         P                  8w  d   R # \	        V 4      # r   )r   poolZ	file_type	TYPE_FILErB  )rd   poolobjZtmpvolr   r   _get_default_image_formatrF    s3    4 FK=222%d++r   c                 s    \         P                  ! V4      p\         P                  ! V P                  YP                  ;'       g    R W0R7      # )disk)ZsuffixZcollideguest)r   Zget_file_extension_for_formatZfind_free_namerd   rx   )ry   rE  fmtZextr   r   _generate_new_volume_namerI    s<    

5
5c
:C''

GZZ116# r   c                   s>  a a ] tR tRt oRtRtRtRt/ RRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!bR"R#bR$R%bR&R'b/ R(R)bR*R+bR,R-bR.R/bR0R1bR2R3bR4R5bR6R7bR8R9bR:R;bR<R=bR>R?bR@RAbRBRCbRDREbRFRGbRHRIbCtRJ t	V 3RK lt
RL tRM tRN t]RO 4       tRPtVtV ;t# )Qr+  i  rG  zdevices.diskrY   Fblockio.logical_block_sizelogical_block_sizeblockio.physical_block_sizephysical_block_sizeiotune.read_bytes_secrC  iotune.write_bytes_secrE  iotune.total_bytes_secZtotal_bytes_seciotune.read_iops_secrG  iotune.write_iops_secrI  iotune.total_iops_secZtotal_iops_secsource.poolsource_poolsource.volumesource_volumesource.namesource_namer@  Zsource_protocolsource.host[0-9]*.nameZsource_host_namesource.host[0-9]*.portZsource_host_portsource.host[0-9]*.socketZsource_host_socketsource.host[0-9]*.transportZsource_host_transportsource.startupPolicystartup_policyr,  zseclabel[0-9]*.modelr-  zseclabel[0-9]*.relabelr.  zseclabel[0-9]*.labelsource.reservations.managedzreservations.managedsource.reservations.source.typezreservations.source.typesource.reservations.source.pathzreservations.source.pathsource.reservations.source.modezreservations.source.modesnapshotsnapshot_policy
target.devrz  target.removable	removabletarget.rotation_raterotation_ratedriver.discardrW  driver.detect_zeroesZdetect_zeroesdriver.error_policyerror_policy	driver.ior   driver.namedriver_namedriver.typedriver_typec                r  )bus
target.busrl  driver.cacheNr1  r   r   r   r  Z"ParserDisk._add_advertised_aliases5  s[     DLL )-)9)9%)@DLL&dll"+/<<+;+;G+DDLL( #r   c                s  <a  S P                  4        S P                  R 8X  d   R# R pV 3R lpS P                  P                  RR4      pS P                  P                  RR4      pS P                  P                  RR4      pS P                  P                  RR4      pV! S P                  P                  RR4      4      pS P                  P                  R	R4      p	\	        R
S P                  P                  R
R4      4      p
V! S P                  P                  RR4      4       S P                  P                  RR4      pV'       dU   VP                  R4      ^8w  d   \        \        R4      4      hVP                  R4      w  rg\        P                  ! RWg4       V'       d   Wn        \        SS `5  V4       V'       dD   V'       g<   V'       g4   VP                  4       '       d   VP                  VP                  8X  d   RpRpRpV'       d   VR8X  d?   \         P"                  ! S P$                  P&                  4      pV'       d   VP(                  pS P$                  P&                  P+                  V4      p\         P,                  ! V4       V'       d%   VP/                  V4      pVP1                  W4       RpV'       g   VP3                  4       '       d   V	'       g   V'       g   V
'       g	   V'       d   V'       g>   VP5                  4       p\6        P8                  P;                  VP=                  4       4      pV'       d)   V	'       g!   \?        S P$                  P&                  V4      p	Vf   \A        S P$                  W4      p\B        PD                  ! S P$                  P&                  VVVV
V	VVR7      pVPG                  V4       V# )r   Nc                 s    V f   R #  \        V 4      #   \         d0   p\        \        R4      \	        T4      ,          4        R p?R # R p?ii ; i)NzImproper value for 'size': %s)Zfloatr=   rp   rE   r   )r    r_   r{   r   
parse_sizeZ%ParserDisk._parse.<locals>.parse_sizeD  sF    {BSz! BQ67#a&@AABs   
 A$AAc                 s   < V f   R # V R8X  d   RSP                   R&   R # V R8X  d   RSP                   R&   R # V R8X  d   R # \        \        R4      RR	R
V /,          4       R # )NZror4  readonlyZsh	shareableZrwz+Unknown '%(optionname)s' value '%(string)s'Z
optionnamepermsr  )rq  rp   rE   )r    r   s   &r   convert_permsZ(ParserDisk._parse.<locals>.convert_permsL  sa    {d{+/Z(,0[)CD#Wh<=r   backing_storebacking_formatrC  volrM  rJ   sparser1  rz  r   /z8Storage volume must be specified as vol=poolname/volnamez'Parsed --disk volume as: pool=%s vol=%sra   )rH  r|  r}  )$r  rg  rq  rk  r9  countr   rE   r   r   rP   r   r   r  Zis_emptyrD  r   Zbuild_default_poolry   rd   rx   ZstoragePoolLookupByNameZensure_pool_is_runningZstorageVolLookupByNameZset_vol_objectZwants_storage_creationZget_parent_poolrX   rY   Zbasenamer   rF  rI  r   Zbuild_vol_installZset_vol_install)r   ra  rw  r{  r|  r}  ZpoolnameZvolnamerM  rH  r  ZdisktypeZ
newvolnamerE  ZpoolxmlZ
vol_objectZvol_installr   s   f&               r   r  ZParserDisk._parse>  s   $$&;;& 	B	  (($?))*:DA<<##FD1,,""5$/$,,**6489llx. 4<<+;+;He+LMdll&&w56<<##FD1}}S!Q& #]!^__ 'c 2HII?S  It 		T^^+ !H 
9$%88I&||Hjjoo==hGG..w7 77@J
4Gt22443$&Ta..0WW--d.B.B.DE
s/

I!6tzz7P
$66

+-	K   -r   c                r  r   )Zset_source_pathr  r\  r   set_path_cbZParserDisk.set_path_cb  s    S!r   c                s(    VP                  4       V8H  # r   )r   r  r\  r   path_lookup_cbZParserDisk.path_lookup_cb  s    ##%,,r   c                r  )Zhostszsource.hostsr  r  r  r   host_find_inst_cbZParserDisk.host_find_inst_cb  s,    &$$V;4"6""r   c                s   \         P                  V 4       \        V R R R R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  RRRV P                  R7       V P                  R	RRV P                  R7       V P                  R
RRV P                  R7       V P                  RRRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRR R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R R 4       V P                  R!R"V P
                  R#7       V P                  R$R%V P
                  R#7       V P                  R&R'V P
                  R#7       V P                  R(R)V P
                  R#7       \        V R*4       V P                  R+RV P                  V P                  R,7       V P                  R-R-4       V P                  R.R/4       V P                  R0R04       V P                  R1R14       V P                  R2R24       V P                  R3R34       V P                  R4R5R R7       V P                  R6R6R R7       V P                  R7R7R R7       V P                  R8R9R R7       V P                  R:R4       V P                  R;R<R R7       V P                  R=R>4       V P                  R?R@4       V P                  RAR4       V P                  RBRC4       V P                  RDRE4       V P                  RFRG4       V P                  RHRI4       V P                  RJRKR R7       V P                  RLRM4       V P                  RNRO4       V P                  RPRQ4       V P                  RRRS4       V P                  RTRUR R7       V P                  RVRW4       V P                  RXRY4       V P                  RZR[4       V P                  R\R]4       V P                  R^R_4       V P                  R`Ra4       V P                  RbRc4       V P                  RdRe4       V P                  RfRg4       V P                  RhRi4       V P                  RjRk4       V P                  RlRm4       V P                  RnRo4       V P                  RpRq4       V P                  RrRs4       V P                  RtRu4       V P                  RvRw4       V P                  RxRy4       V P                  RzR{4       V P                  R|R}4       R# )~Tr  r'  r(  r|  Nr  r}  rC  r~  rM  rJ   r  r   rt  r;  rl  Zdriver_cache
source.dirsource.file
source.devrT  rV  rX  r@  r^  r_  rS  zsource.namespacezsource.managedr  source.address.domainsource.address.bussource.address.slotsource.address.functionrZ  rx   r+  r[  portr\  socketr]  Z	transportr  rY   rG  rK  rJ  rd  re  ZsgioZrawioserialZwwnrx  Z	read_onlyry  Z	transientztransient.shareBackingZtransient_shareBackingru  rg  rh  rf  rz  ri  rj  rv  rk  Zdriver_discardrl  Zdriver_detect_zeroesrp  rq  rr  rs  zdriver.copy_on_readZdriver_copy_on_readro  Z	driver_iodriver.iothreaddriver_iothreaddriver.queuesdriver_queuesrm  rn  zdriver.discard_no_unrefZdriver_discard_no_unrefzdriver.queue_sizeZdriver_queue_sizezdriver.metadata_cache.max_sizeZdriver_metadata_cache_max_sizez#driver.metadata_cache.max_size.unitZ#driver_metadata_cache_max_size_unitrN  Z
iotune_rbsrO  Z
iotune_wbsrP  Z
iotune_tbsrQ  Z
iotune_risrR  Z
iotune_wisrS  Z
iotune_tisrJ  rK  rL  rM  zblockio.discard_granularityZdiscard_granularityzgeometry.cylsZgeometry_cylszgeometry.headsZgeometry_headszgeometry.secsZgeometry_secszgeometry.transZgeometry_transr`  Zreservations_managedra  Zreservations_source_typerb  Zreservations_source_pathrc  Zreservations_source_mode)	rz  r  r)  r  r  r  r/  r  r  r  r   r   rt  ZParserDisk._virtcli_class_init  sF   005DY]^ 	OTTcllK$dds||LFDDS\\BE44CLLAFDDS\\BHdds||DHdds||DFDDS\\B 	E5S\\2G^= 	L,/M=1L,/M=1O_5M=1%'89*,<=M=1&(:;$&6F+-DE(*>?)+@A-/HI,f3CXCXY,f3CXCXY.sG\G\]1;SMbMbc!#{3FDS__@R@RSHh'J 12FF#GW%Hh'E5!Jd;Kt<Kt<,.FQUVL%(&dCL(+*O<NN3$&67*,BCM=1M=1)+@4PK-%'89O_5)>:-/HSWX')<=46VW9;`a+\:,l;,l;*L9+\:+\:02FG13HI13HIO_5$&67O_5$&6713IJ57QR57QR57QRr   r0   )r&   r'   r(   r)   r   r  rp  r  rT  r  r  r  r  r  r  rt  r*   r+   r   r   r   r   r+  r+    s    L#NLI#$&:#%'<# 	 !1# 	!"3	#
 	!"3# 	# 	 !1# 	 !1# 	}# 	# 	}# 	,# 	!"4# 	!"4# 	#$8#  	&'>!#" 	 0##$ 	&'=%#& 	()A'#( 	&'=)#* 	&'=+#, 	*+E-#. 	*+E/#0 	*+E1#2 	%3#4 	h5#6 	K7#8 	9#: 	);#< 	=#> 	~?#@ 	TA#B 	}C#D 	}E#GJEaN"-# _S _S _Sr   r+  c                   s   a a ] tR tRt oRtRtRtRt/ RRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!bR"R#bR$R%bR&R'bR(R)R*R+R,R-/CtR. t	V 3R/ lt
R0 tR1 tR2 tR3 tR4 tR5 tR6 t]R7 4       tR8tVtV ;t# )9r   i  r  zdevices.interfacer   Frp  rq  r  r  filterref.filter	filterref
link.state
link_statemac.addressmac
model.typerX  rom.filerom_filerom.barrom_barrf  rz  source.portgroup	portgrouprS  rT  r:  source_pathr=  source_modevirtualport.typeZvirtualport_type virtualport.parameters.manageridZvirtualport_manageridvirtualport.parameters.typeidZvirtualport_typeid$virtualport.parameters.typeidversionZvirtualport_typeidversion!virtualport.parameters.instanceidZvirtualport_instanceid virtualport.parameters.profileidZvirtualport_profileid"virtualport.parameters.interfaceidZvirtualport_interfaceidc                s   R V P                   9   d)   V P                   P                  R 4      V P                   R&   RV P                   9   d)   V P                   P                  R4      V P                   R&   RV P                   9  d   RV P                   9   dH   \        P                  V P                   R&   V P                   P                  R4      V P                   R&   R# RV P                   9   dH   \        P                  V P                   R&   V P                   P                  R4      V P                   R&   R# R# V P                   P                  RR4       V P                   P                  RR4       R# )	rX  r  r  r  r   r  r2  bridgeN)rq  rk  r	   ZTYPE_VIRTUALZTYPE_BRIDGEr   r   r   r  Z%ParserNetwork._add_advertised_aliases5  s    dll")-)9)9')BDLL&DLL *.,,*:*:5*ADLL' %DLL('6'C'CV$)-)9)9))DX&T\\)'6'B'BV$)-)9)9()CX& * LLY-LLXt,r   c                sh   < V P                  4        V P                  R 8X  d   R# \        SV `  V4      # )r   N)r  rg  r   r  r  r  r   r  ZParserNetwork._parseJ  s-    $$&;;& w~d##r   c                s$    VR 8X  d   R# W!n         V# )ZRANDOMN)r   r  r\  r   
set_mac_cbZParserNetwork.set_mac_cbV  s    (?
r   c                s    VR 8X  d   VP                  4        R# VR8X  d   RVn        RVP                  n        R# W!n        R# )ra   Zpasstr~   N)Zset_default_sourcer   backendr  r\  r   r  ZParserNetwork.set_type_cb\  s5    )##%G^DI 'DLLIr   c                sl    TpVR9   d	   W!n         R# \        V4      pVRJ d   R pMVRJ d   RpW!n         R# )updownNTF)r  r  )r  r8  )r   ra  r    r   r  rX  r!  r   set_link_stateZParserNetwork.set_link_statee  s>    . !O!#&$;CE\Cr   c                r'  )ZportForwardr  r  r  r   portForward_find_inst_cbZ&ParserNetwork.portForward_find_inst_cbr  s,    %$$V;4"6""r   c                st    V P                   ! V.VO5/ VB pTpR pR pV P                  WV4      pV! V.VO5/ VB # )range)r  r  rh  ri  r   range_find_inst_cbZ ParserNetwork.range_find_inst_cbx  sP    ,,TCDCFC$$V;$((((r   c                s   R V9   d   VP                  R ^4      w  r$MRpRV9   d   VP                  R^4      w  r%MRpRV9   d   VP                  R^4      w  rbMRpRV9   d   VP                  R^4      w  rxMTpRpVP                  '       g   VP                  P                  4        VP                  ^ ,          p	WAn        Wan        Wyn        Wn        WYn        R# )r  Ztcp:Nr  )r   r  r  protoaddressstartendto)
r   ra  r    r[  r  Zport_torr  Z
port_startZport_endZrangeobjs
   &&&&      r   set_port_forward_prettyZ%ParserNetwork.set_port_forward_pretty  s    #:C+JCE#:::c1-LCG#:

3*ID#D#:#&::c1#5 JJHzzzJJ ::a=
#r   c                sT    \        VP                  V4      pVP                  V4       R # r   )_lookupNodedevFromStringrd   set_from_nodedevr  r\  r   set_hostdev_cbZParserNetwork.set_hostdev_cb  s     &tyy#6c"r   c                s"   \         P                  V 4       \        V R R R R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  R	R	V P
                  R7       V P                  R
R
4       V P                  RR4       V P                  RRR R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R R!V P                  R!R"7       V P                  R#R$4       V P                  R%R4       V P                  R&RV P                  R7       V P                  R'R(4       V P                  R)R*V P                  R7       V P                  R+R,4       V P                  R-R.4       V P                  R/R04       V P                  R1R2R R7       V P                  R3R44       V P                  R5R54       V P                  R6R74       V P                  R8R94       V P                  R:R;4       V P                  R<R=4       V P                  R>R?4       V P                  R@RA4       V P                  RBRCV P                  RD7       V P                  RERFV P                  RD7       V P                  RGRHV P                  RD7       V P                  RIRJV P                  RD7       V P                  RKRLV P                  RD7       V P                  RMRNV P                  RD7       V P                  RORPR V P                  RQ7       V P                  RRR!R!V P                  V P                  RS7       R!# )TTr  rX  r;  r  r   r  r2  r  r   backend.typezbackend.logFileZtrustGuestRxFiltersr  r=  r  rS  rT  r:  r  r  r  zsource.address.typezsource_address.typer  zsource_address.domainr  zsource_address.busr  zsource_address.slotr  zsource_address.functionr   Nr  rf  Z
target_devr  r  r  r  r  r  rp  rq  r  r  r  r  r  r  zmtu.sizeZmtu_sizer  r  zvirtualport.manageridr  zvirtualport.typeidr  zvirtualport.typeidversionr  zvirtualport.instanceidr  zvirtualport.profileidr  zvirtualport.interfaceidzportForward[0-9]*.protor  r+  zportForward[0-9]*.addressr  zportForward[0-9]*.devr   z#portForward[0-9]*.range[0-9]*.startr  z!portForward[0-9]*.range[0-9]*.endr  z portForward[0-9]*.range[0-9]*.tor  z%portForward[0-9]*.range[0-9]*.excludeZexcluder  zportForward[0-9]*)rK  rG  rL  )rz  r  r)  r  r  r  r  r  r  r  r  r  r  r   r   rt  Z!ParserNetwork._virtcli_class_init  s|   005DY]^ 	GW6E96IxCLL9Hh3<<8 	FFs7NN3%'89)+@4PHh'M=1M=1M=1&4)+@A+-DE(*>?)+@A-/HIIt(:(:dKL,/L'*M9@&4L,33E3EFM=1O_5J
+Iy48J
+&(:;68OP35IJ:<WX79QR68OP8:ST-wSEaEab'A]A] 	 	
 	+UA]A]^17I_I_ 	 	
 	7SMcMcd63KaKab3//	 	 	
 	**55 	 	
r   r0   )r&   r'   r(   r)   r   r  rp  r  rT  r  r  r  r  r  r  r  r  r  r  rt  r*   r+   r   r   r   r   r   r     sO    L(NLI} 	K 	l	
 	u 	g 	J 	9 	h 	K 	} 	} 	} 	. 	+,C  	()=!" 	/0K#$ 	,-E*,C,.G)G.-*$#)@# H
 H
 H
r   r   c                   s   a a ] tR tRt oRtRtRtRtRRRR	R
RRRRRRRRRRRRRRR/
tV 3R lt	R t
R tR t]R 4       tRtVtV ;t# ) r   i  r
  zdevices.graphicsr   FtlsPortZtlsportpasswordpasswdpasswordValidTopasswdValidToimage.compressionimage_compressionstreaming.modestreaming_modeclipboard.copypasteclipboard_copypastefiletransfer.enablefiletransfer_enable
mouse.mode
mouse_mode	gl.enableglgl.rendernode
rendernodec                j   < V P                   R 8X  d   RV P                  n        R# \        SV `  V4      # r   TN)rg  ry   Zskip_default_graphicsr   r  r  r  r   r  ZParserGraphics._parse  s-    ;;& /3DJJ,w~d##r   c                s    V'       g   R pMEVP                  4       R8X  d   \        P                  ! R4       R pMVP                  4       R8X  d   R pW!n        R # )NZlocalz2keymap=local is no longer implemented. Using None.r   )r7  r   rP   keymapr  r\  r   set_keymap_cbZParserGraphics.set_keymap_cb  sB    CYY[G#IIJKCYY[F"Cr   c                s    V P                   '       d   V P                  P                  W!4       R# VR 8X  d   R# W!n        R# )ra   N)r  ry   Zchange_graphicsr   r  r\  r   r  ZParserGraphics.set_type_cb  s-    <<<JJ&&s1iIr   c                r'  )Zlistensr  r  r  r   listens_find_inst_cbZ#ParserGraphics.listens_find_inst_cb%  r)  r   c                s   \         P                  V 4       \        V 4       V P                  R R V P                  R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRV P
                  R7       V P                  RR4       V P                  R	R
4       V P                  RR4       V P                  RR4       V P                  RR V P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RR RR7       V P                  R!R"4       V P                  R#R$RR7       V P                  R%R&4       R'# )(r   r;  r  r  Z	websocketZlistenr  r  r  r  r  Z	connectedZdefaultModezlistens[0-9]*.typer+  zlistens[0-9]*.addressr  zlistens[0-9]*.networkr  zlistens[0-9]*.socketr  r  r  r  r  r  r  Tr  r  r  r  r  zzlib.compressionZzlib_compressionr  r  r  r  N)rz  r  r)  r  r  r  r  r  r   r   rt  Z"ParserGraphics._virtcli_class_init+  s   005$FFs7FF#Iy)K-Hh'Hh3+<+<=J)%7K-M=1(&s?W?WX+YSE]E]^+YSE]E]^*H3C[C[\')<=$&67)+@4PL,/)+@4P&(:;K5O\2r   r0   )r&   r'   r(   r)   r   r  rp  r  rT  r  r  r  r  r  rt  r*   r+   r   r   r   r   r   r     s     L'NLI9H?0*44lTG$# 3 3 3r   r   c                   s`   a a ] tR tRt oRtRtRtRRRR/tV 3R	 ltR
 t	]
R 4       tRtVtV ;t# )r   iP  Z
controllerzdevices.controllerr   master.startportZmasterr  r  c                s  < V P                   R 8X  d!   \        P                  ! VP                  4      # V P                   R8X  d,   \        P                  ! VP                  V P
                  4      # RV P                  9   d6   \        V P                  P                  R4      4      V P
                  n	        R# \        SV `-  V4      # )Zusb2Zusb3r  N)rg  r   Zget_usb2_controllersrd   Zget_usb3_controllerry   rq  r   rk  r  r   r  r  r  r   r  ZParserController._parseY  s    ;;& #88CC[[F"#77		4::NN DLL0-01A1ABW1X-YDJJ*w~d##r   c                s   TpVP                  R 4      R9   d   RV9   d   VP                  P                  VP                  n        VP	                  R^4      w  qAP                  n        VP                  R ^4      w  qAP                  n        RVP                  n        R V9   d4   VP	                  R ^4      w  VP                  n        VP                  n	        R# \        \        R4      V,          4      h)r  rV  r5  Nz#Expected PCI format string for '%s'rv   i   )r  r  ZADDRESS_TYPE_PCIr   r   functionr   slotr   rt  r   rE   )r   ra  r    r   addrstrr  r   set_address_cbZParserController.set_address_cbi  s     =='C7N $ = =DLL-4]]3-B*G\\*)0Q)?&G\\&"%DLLg~8?c18M5#T\\%5@AGKLLr   c                s   \         P                  V 4       \        V R R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRV P                  R7       V P                  R RRV P
                  R7       R# )!Tr(  r   rX  ZindexZmaxGrantFramesZvectorsr  Zmaster_startportr  r  r  r  ztarget.chassisNrZtarget_chassisNrztarget.chassisZtarget_chassistarget.porttarget_portztarget.hotplugZtarget_hotplugztarget.busNrZtarget_busNrztarget.indexZtarget_indextarget.nodetarget_nodeztarget.memReserveZtarget_memReserver  Nr  r  )rz  r  r)  r  r  r  r  r   r   rt  Z$ParserController._virtcli_class_initx  s;   005D9FF#GW%GW%$&67Iy)&(:;%'89O_5&(:;$&67M=1$&67NN3NN3M=1')<=Itt8J8JK)44CLLQr   r0   )r&   r'   r(   r)   r   r  rp  rT  r  r  r  rt  r*   r+   r   r   r   r   r   r   P  sL     L)NLHG

$ M R R Rr   r   c                   sR   a a ] tR tRt oRtRtRtRtV 3R lt]	R 4       t
RtVtV ;t# )	r   i  rj   zdevices.inputr   Fc                r  r  )rg  ry   Zskip_default_inputr   r  r  r  r   r  ZParserInput._parse  -    ;;& ,0DJJ)w~d##r   c                sv   \         P                  V 4       \        V R R7       V P                  RRR R7       V P                  RRR R7       V P                  RR4       V P                  RR4       V P                  RR	4       V P                  R
RR R7       V P                  RR4       V P                  RR4       R# )Tr  r   rI  rt  rX  zsource.evdevZsource_evdevr  
source_devzsource.repeatZsource_repeatr  zsource.grabZsource_grabzsource.grabToggleZsource_grabToggleNrz  r  r)  r  r  r   r   rt  ZParserInput._virtcli_class_init  s    005D9FF48E56GW%NN3L,/O_tDM=1')<=r   r0   )r&   r'   r(   r)   r   r  rp  r  r  r  rt  r*   r+   r   r   r   r   r   r     s7     L$NLI$ > > >r   r   c                   r  )r  i  Ziommuzdevices.iommurX  c                s   \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  R	R
RR7       V P                  RRRR7       R# )rX  zdriver.aw_bitsZaw_bitszdriver.intremapZintremapTr  zdriver.caching_modeZcaching_modez
driver.eimZeimzdriver.iotlbZiotlbNr  r  r   r   rt  ZParserIommu._virtcli_class_init  sw    005GW%$i0%zDA)>DIL%$7NGd;r   r0   Nr"  r,   r.   r   r  r    s&     L$NL< <r   r  c                   sB   a  ] tR tRt o RtRtRtR t]R 4       t	Rt
V tR# )	r  i  Z	smartcardzdevices.smartcardr%  c                r  )ZcertificateZcertificatesr  r  r  r   certificate_find_inst_cbZ(ParserSmartcard.certificate_find_inst_cb  r~  r   c                s   \         P                  V 4       \        V 4       V P                  R R RR7       V P                  RRRR7       \	        V 4       V P                  RRRR7       V P                  RRRV P
                  R7       R	# )
r%  Tr  r   Zdatabaser  zcertificate[0-9]*r`  r*  N)rz  r  r)  r  rA  r  r  r   r   rt  Z#ParserSmartcard._virtcli_class_init  sv    005$FF48FF48c"J
d;DsGcGc 	 	
r   r0   N)r&   r'   r(   r)   r   r  rp  r  r  rt  r*   r+   r,   r.   r   r  r    s-     L(NL# 
 
r   r  c                   sX   a a ] tR tRt oRtRtRtRtR tV 3R lt	]
R 4       tR	tVtV ;t# )
r  i  Zredirdevzdevices.redirdevrt  Fc                r0  r   r1  r  r\  r   set_server_cbZParserRedir.set_server_cb  r5  r   c                r  r  )rg  ry   Zskip_default_usbredirr   r  r  r  r   r  ZParserRedir._parse  s-    ;;& /3DJJ,w~d##r   c                s    \         P                  V 4       \        V R R7       V P                  RRR R7       V P                  RRR R7       V P                  RRRV P                  R7       \        V 4       R# )Tr  rt  r  r   ZserverNr  )rz  r  r)  r  r  rA  r  r   r   rt  ZParserRedir._virtcli_class_init  s`    0055E56FF48Hdds7H7HIc"r   r0   )r&   r'   r(   r)   r   r  rp  r  r  r  r  rt  r*   r+   r   r   r   r   r  r    s<     L'NLI+$ # # #r   r  c                   sb   a a ] tR tRt oRtRtRtRtRRRRR	R
/tV 3R lt	]
R 4       tRtVtV ;t# )r  i  Ztpmzdevices.tpmr   Fr  backend.versionrC   backend.device.pathrY   c                s  < V P                   R 8X  d   RV P                  n        R# V P                  P	                  RR4      P                  R4      '       d)   V P                  P                  R4      V P                  R&   V P                  P	                  R4      R8X  d   V P                  P                  R4       \        SV `!  V4      # )r   TNr   rO   r  rY   ra   )	rg  ry   Zskip_default_tpmrq  r#   r   rk  r   r  r  r  r   r  ZParserTPM._parse  s    ;;& *.DJJ' <<FB'22377#'<<#3#3F#;DLL  <<F#y0LLV$w~d##r   c                sv   \         P                  V 4       \        V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
RR7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       R# ) rX  r  r   r  rC   r  r@  zbackend.encryption.secretZencryption_secretzbackend.persistent_stateZpersistent_stateTr  zbackend.debugrP   zbackend.source.typerT  zbackend.source.pathr  zbackend.profile.sourceZprofile_sourcezbackend.profile.removeDisabledZprofile_removeDisabledzbackend.active_pcr_banks.sha1zactive_pcr_banks.sha1zbackend.active_pcr_banks.sha256zactive_pcr_banks.sha256zbackend.active_pcr_banks.sha384zactive_pcr_banks.sha384zbackend.active_pcr_banks.sha512zactive_pcr_banks.sha512Nr  r  r   r   rt  ZParserTPM._virtcli_class_init'  s   005$GW%NF+%y1)=9/1DE.0BTROW-)=9)=9,.>?46NO35LW[\57P[_`57P[_`57P[_`r   r0   )r&   r'   r(   r)   r   r  rp  r  rT  r  r  rt  r*   r+   r   r   r   r   r  r    sP     L"NLI9vG$ a a ar   r  c                   s|   a a ] tR tRt oRtRtRtRtRRRR	R
RRRRRRRRRRR/tR t	V 3R lt
]R 4       tRtVtV ;t# )r  iC  Zrngzdevices.rngbackend.modelFr  backend_typezbackend.source.modeZbackend_modezbackend.source.hostZbackend_hostzbackend.source.serviceZbackend_servicezbackend.source.connect_hostZbackend_connect_hostzbackend.source.connect_serviceZbackend_connect_service
rate.bytes
rate_bytesrate.periodrate_periodc                r  )r   r  rJ  r  Nr1  r   r   r   r  Z!ParserRNG._add_advertised_aliasesS  s[     T\\!,0LL,<,<V,DDLL)t||#&*ll&6&6x&@DLL# $r   c                sZ  < V P                   R 8X  d   RV P                  n        R# V P                  4        V P                  P                  RR4      P                  R4      '       d8   V P                  P                  R4      V P                  R&   RV P                  R&   \        SV `%  V4      # )r   TNr  rO   r  r  Zrandom)
rg  ry   Zskip_default_rngr  rq  r#   r   rk  r   r  r  r  r   r  ZParserRNG._parse\  s    ;;& *.DJJ'$$&<<OR0;;C@@&*ll&6&6&GDLL#,4DLL)w~d##r   c                s   \         P                  V 4       \        V R R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
4       \        V RR7       V P                  RR4       V P                  RR4       R# )Tr  r   Zbackend_modelr;  rJ  rX  r  r  r  r  zbackend.r>  r  r  r  r  N)rz  r  r)  r  r  rA  r  r   r   rt  ZParserRNG._virtcli_class_initm  s    005D9 	FO=Hh3<<8GW%Ix(O_5NN3c*5L,/M=1r   r0   )r&   r'   r(   r)   r   r  rp  r  rT  r  r  r  rt  r*   r+   r   r   r   r   r  r  C  so     L"N"LI~~ "3%'=(*Cl}	GA$" 2 2 2r   r  c                   r  )r	  i  Zwatchdogzdevices.watchdogrX  c                s    \         P                  V 4       \        V 4       V P                  R R RR7       V P                  RRRR7       R# )rX  Tr  rD   Nr  r  r   r   rt  Z"ParserWatchdog._virtcli_class_init  s<    005$GWT:Hht<r   r0   Nr"  r,   r.   r   r	  r	    s&     L'NL= =r   r	  c                   s^   a  ] tR tRt o RtRtRtRRRRR	R
RRRRRR/tR t]	R 4       t
RtV tR# )r  i  Zmemdevzdevices.memoryrX  target.sizeZtarget_sizer  r  target.label_sizeZtarget_label_sizesource.pagesizeZsource_pagesizer:  r  source.nodemaskZsource_nodemaskc                r6  r7  r8  r  r\  r   set_target_sizeZParserMemdev.set_target_size  r:  r   c                s&   \         P                  V 4       \        V 4       V P                  R R 4       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RRV P                  R7       V P                  RR4       V P                  R	R	V P                  R7       V P                  R
R
4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RRRR7       V P                  RRV P                  R7       V P                  RR4       R# )rX  r[   rW  Tr  r  r  r;  r  r  ztarget.blockztarget.currentztarget.requestedztarget.readonlyztarget.address_baser  r:  r  r  zsource.pmemzsource.alignsizeztarget.dynamicMemslotsN)rz  r  r)  r  r  r  r   r   rt  Z ParserMemdev._virtcli_class_init  sT   005$GW%Hh'Iy48FF#M=S5H5HIM=1')<ATATUNN3$&67&(:;%'84H)+@A%'89M=1%'8DIM=4@&(:s?R?RS,.FGr   r0   N)r&   r'   r(   r)   r   r  rp  rT  r  r  rt  r*   r+   r,   r.   r   r  r    sX     L%NL}}0,},GG H Hr   r  c                   s@   a  ] tR tRt o RtRtRtRt]R 4       t	Rt
V tR# )	r  i  Z
memballoonzdevices.memballoonrX  Fc                s    \         P                  V 4       \        V R R7       V P                  RRR R7       V P                  RRR R7       V P                  RR4       V P                  RRR R7       R	# )
Tr  rX  r  Zautodeflater  zstats.periodZstats_periodZfreePageReportingNr  r  r   r   rt  Z$ParserMemballoon._virtcli_class_init  s`    005D9GWT:M=4@NN3')<tLr   r0   N)r&   r'   r(   r)   r   r  rp  r  r  rt  r*   r+   r,   r.   r   r  r    s-     L)NLIM Mr   r  c                   sV   a a ] tR tRt oRtRtRtRR/tV 3R lt]	R 4       t
R	tVtV ;t# )
r  i  Zpaniczdevices.panicrX  r%  Ziobasec                s  < \        V P                  4      ^8X  da   V P                  P                  RR4      P                  R4      '       d0   V P                  R,          V P                  R&   RV P                  R&   \        SV `  V4      # )rv   rX  rO   Z0xr%  Zisa)r<   rq  r#   r   r   r  r  r  r   r  ZParserPanic._parse  sj    t||!dll&6&6w&C&N&Nt&T&T-1\\'-BDLL)*$)DLL!w~d##r   c                sn    \         P                  V 4       \        V 4       V P                  R R RR7       R# )rX  Tr  Nr  r  r   r   rt  ZParserPanic._virtcli_class_init  s*    005$GWT:r   r0   )r&   r'   r(   r)   r   r  rp  rT  r  r  rt  r*   r+   r   r   r   r   r  r    s>     L$NL(G$ ; ; ;r   r  c                   r  )r  i  Zshmemzdevices.shmemrx   c                sf   \         P                  V 4       \        V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R
4       V P                  RR4       R# )rx   Zroler  r   rM  z	size.unitry  zserver.pathZserver_pathzmsi.vectorsZmsi_vectorszmsi.ioeventfdZmsi_ioeventfdNr  r  r   r   rt  ZParserShMem._virtcli_class_init  s    005$FF#FF#L&)FF#K-M=1M=1O_5r   r0   Nr"  r,   r.   r   r  r    s&     L$NL6 6r   r  c                   sL   a  ] tR tRt o RtRtRtRtRRRR	/t]	R
 4       t
RtV tR# )r  i  Zvsockzdevices.vsockrX  Fcid.autoauto_cidcid.addresscidc                s    \         P                  V 4       \        V R R7       V P                  RRR R7       V P                  RRR R7       V P                  RR4       R	# )
Tr  rX  r  r  r  r  r  r  Nr  r  r   r   rt  ZParserVsock._virtcli_class_init   sL    005D9GWT:J
T:M5)r   r0   N)r&   r'   r(   r)   r   r  rp  r  rT  r  rt  r*   r+   r,   r.   r   r  r    s>     L$NLIJuG
 * *r   r  c            
       st   a a ] tR tRt oRtRtRRRRRRR	R
RR/tR tV 3R ltR t	R t
]R 4       tRtVtV ;t# )_ParserChari/  r   FZ	char_typer?  Zprotocoltarget.addresstarget_addresstarget.typetarget_typetarget.namerx   c                s`   R V P                   9   d)   V P                   P                  R 4      V P                   R&   RV P                   9   d)   V P                   P                  R4      V P                   R&   RV P                   9   d+   V P                   P                  R4      V P                   R&   R# R# )rY   r:  r%  r=  	bind_hostr<  Nr1  r   r   r   r  Z#_ParserChar._add_advertised_aliases:  s     T\\!*.,,*:*:6*BDLL'T\\!*.,,*:*:6*BDLL'$,,&/3||/?/?/LDLL+, 'r   c                s  < V P                   R 8X  d%   VP                  R8X  d   RV P                  n        R# V P                   R 8X  d%   VP                  R8X  d   RV P                  n        R# V P                  4        \        SV `  V4      # )r   r   TNchannel)rg  rc  ry   Zskip_default_consoleZskip_default_channelr  r   r  r  r  r   r  Z_ParserChar._parseE  sn    ;;& T%5%5%B.2DJJ+;;& T%5%5%B.2DJJ+$$&w~d##r   c                s    R V P                   9  d?   V P                   P                  RR4      R8X  d   VP                  P                  V4       R# VP                  P	                  V4       R# )r<  r=  NZbind)rq  r#   r2  r6  r8  r  r\  r   set_host_cbZ_ParserChar.set_host_cbT  sK    dll2  5?KK))#.KK,,S1r   c                r  r   )Zset_friendly_targetr  r\  r   set_target_cbZ_ParserChar.set_target_cb]  r  r   c                sz   V P                   '       d   R # \        P                  V 4       \        V 4       \	        V 4       V P                  RR4       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  RRV P                  R7       V P                  R	R
V P                  R7       \        V 4       V P                  RRV P                  R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       R # )Nr   rY   r:  r;  r%  r=  r   r<  rr  r;  r  r  r  r  r  Ztarget_namer  r  ztarget.model.nameZtarget_model_name)
r   rz  r  r)  r  r  r  r  rA  r  r  r   r   rt  Z_ParserChar._virtcli_class_init`  s     ===005$FF# 	FMcll;FMcll;K!3EFMcoo>c"$&63;L;LMM=1M=1M=1')<=r   r0   )r&   r'   r(   r)   rp  r  rT  r  r  r  r  r  rt  r*   r+   r   r   r   r   r  r  /  s^     LI*}vG	M	$2& > > >r   r  c                       ] tR tRtRtRtRtR# )r  i}  r  zdevices.serialr0   Nr&   r'   r(   r)   r   r  r*   r0   r   r   r  r  }  s    L%Nr   r  c                   r  )r  i  Zparallelzdevices.parallelr0   Nr  r0   r   r   r  r    s    L'Nr   r  c                   r  )r  i  r  zdevices.channelr0   Nr  r0   r   r   r  r        L&Nr   r  c                   r  )r  i  r   zdevices.consoler0   Nr  r0   r   r   r  r    r  r   r  c                   sH   a  ] tR tRt o RtRtRR.tRR/t]R 4       t	R	t
V tR
# )r  i  Z
filesystemzdevices.filesystemr2  rz  
accessmoder%  c                s   \         P                  V 4       \        V R R7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRR R7       V P                  RR4       V P                  R	R	4       V P                  R
R
4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R R!4       V P                  R"R#4       V P                  R$R%R R7       V P                  R&R'4       V P                  R(R)R R7       V P                  R*R+R R7       V P                  R,R-4       V P                  R.R/4       V P                  R0R14       V P                  R2R34       V P                  R4R54       V P                  R6R74       R8# )9Tr  r   r  rX  Z	multidevsrx  r  Zspace_hard_limitZspace_soft_limitZfmodeZdmoder2  rz  r  Zsource_filer  Z
source_dirr  r  rX  rY  rT  rU  rV  rW  zsource.unitsZsource_unitszsource.usageZsource_usagezsource.socketZsource_socketz
target.dirZ
target_dirzbinary.pathZbinary_pathzbinary.xattrZbinary_xattrzbinary.cache.modeZbinary_cache_modezbinary.lock.posixZbinary_lock_posixzbinary.lock.flockZbinary_lock_flockzbinary.sandbox.modeZbinary_sandbox_modezdriver.formatZdriver_formatrp  rq  zdriver.queueZdriver_queuerr  rs  zdriver.wrpolicyZdriver_wrpolicyNr  r  r   r   rt  Z$ParserFilesystem._virtcli_class_init  s   005D9FF#L,/GW%K-J
T:&(:;&(:;GW%GW%Hh'Hh'M=1L,/L,/M=1M=1O_5NN3NN3O_5L,/M=1NNTB')<=')<tL')<tL)+@AO_5M=1NN3M=1%'89r   r0   Nr&   r'   r(   r)   r   r  rp  rT  r  rt  r*   r+   r,   r.   r   r  r    s9     L)Nh'LfG (: (:r   r  c                   s\   a  ] tR tRt o RtRtRtRRRRRR	R
RRRRRRR/t]R 4       t	Rt
V tR# )r
  i  Zvideozdevices.videor  rX  model.headsheads	model.ramram
model.vramvrammodel.vram64vram64model.vgamemvgamemmodel.acceleration.accel3daccel3dc                sr   \         P                  V 4       \        V R R7       V P                  RRR R7       V P                  RRR R7       V P                  RR	4       V P                  R
R4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       R# )Tr  r  rX  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  z
model.blobZblobNr  r  r   r   rt  ZParserVideo._virtcli_class_init  s    005D9L'$?0)dKM7+K'L&)NH-NH-L&)r   r0   Nr  r,   r.   r   r
  r
    sR     L$NLgwUf$iG * *r   r
  c                   sX   a a ] tR tRt oRtRtRtRtV 3R ltR t	]
R 4       tR	tVtV ;t# )
r  i  r   zdevices.soundrX  Fc                r  r  )rg  ry   Zskip_default_soundr   r  r  r  r   r  ZParserSound._parse  r  r   c                r  )ZcodecZcodecsr  r  r  r   codec_find_inst_cbZParserSound.codec_find_inst_cb  r  r   c                s   \         P                  V 4       \        V 4       V P                  R R RR7       V P                  RR4       V P                  RRV P                  R7       V P                  RR4       V P                  R	R	4       R
# )rX  Tr  zaudio.idZaudio_idzcodec[0-9]*.typer   r+  ZmultichannelZstreamsN)rz  r  r)  r  r  r  r   r   rt  ZParserSound._virtcli_class_init  sm    005$GWT:J
+&S=S=STNN3Iy)r   r0   )r&   r'   r(   r)   r   r  rp  r  r  r  r  rt  r*   r+   r   r   r   r   r  r    s<     L$NLI$# * * *r   r  c                   r  )r  i  Zaudiozdevices.audioc                sx    \         P                  V 4       V P                  R R 4       V P                  RR4       R# )r   r  Nr  r  r   r   rt  ZParserAudio._virtcli_class_init  s,    005FF#D$r   r0   Nr  r,   r.   r   r  r    s!     L$N   r   r  c                   r  )r  i  Zpstorezdevices.pstorec                s    \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RR4       R# )r  rY   rM  Nr  r  r   r   rt  Z ParserPstore._virtcli_class_init  s:    005Iy)FF#FF#r   r0   Nr  r,   r.   r   r  r    s!     L%N$ $r   r  c                s   \        V 4      pVP                  R4      R	9   d   RV9   d   VP                  R^4      w  rVP                  R^4      w  rRpRV9   d   VP                  R^4      w  rVMTpRVn        R\        V^4      ,          Vn        R\        V^4      ,          Vn        R\        V^4      ,          Vn        R\        V^4      ,          Vn	        V# RV9   dM   VP                  R4      w  rxRVn        R\        V^4      ,          Vn
        R\        V^4      ,          Vn        V# RV9   d*   VP                  R^4      w  riRVn        Wbn	        Wn        V# \        RV,          4      h)
a  
Decompose common USB and PCI address string formats into a DeviceHostdev
instance. The 3 expected formats are:

- bus.addr (ex. 001.003 for a usb device)
- vendor:product (ex. 0x1234:0x5678 for a usb device
- (domain:)bus:slot.func (ex. 00:10.0 for a pci device)
r  rV  r5  Zpciz0x%.4Xz0x%.2XZusbz*Unknown hostdev address string format '%s'r  )r   r  r   r   r   r   r   r  r  rt  rw  productrJ  r\   )
rd   r  r   Zfuncr  r   rt  rw  r  rJ  r   r   _AddressStringToHostdevr  -  sW    D!G}}SV#wc1-sA.'>!--Q/KFCC!CO3#c$m3#dB-/S"-( N% 
!--,!CO3"S"%55 N 
mmC+ N G'QRRr   c                 st    \        W4      p^ pRpT P	                  4        F'  pTP                  T4      '       g   K  TpT^,          pK)  	  T^8  d   \        \        R4      T,          4      hT^8  d   \        \        R4      T,          4      hT#   \         d    \        P                  ! R RR7       h i ; i)z!Error parsing node device string.Trl   Nz'%s corresponds to multiple node devicesz,Did not find a matching node device for '%s')r  r=   r   rP   Zfetch_all_nodedevscompare_to_hostdevr   rE   )rd   r  r   r  nodedevZxmlobjr   r   _AddressStringToNodedevr  ]  s    )$8
 EG))+$$W--GQJE ,
 qyDEOPPqyIJWTUUN!  		5Es   B %B7c                 s    \         P                  ! W4      pV'       d   V#  \        W4      #   \         d    \        P
                  ! R TRR7       h i ; i)z)Error looking up nodedev from idstring=%sTrl   )r   ZlookupNodedevByNamer  r=   r   rP   )rd   Zidstringr  r   r   r  r  s  sN    ,,T<G&t66 		=xRVWs	   
- &Ac                   sT   a  ] tR tRt o RtRtRtRRRR/tR	 tR
 t	]
R 4       tRtV tR# )r  i  r   zdevices.hostdevrx   rp  rq  r  r  c                s   VP                   R 8X  d   RVn        W!n        R# VP                   R8X  d   RVn        W!n        R# VP                   R8X  d   RVn        W!n        R# \        VP                  V4      pVP                  V4       R# )ZnetZcapabilitiesZmiscstorageN)r   r%  Znet_interfaceZ	misc_charZstorage_blockr  rd   r  r  r\  r   set_name_cbZParserHostdev.set_name_cb  sj    99&DI!$YY& &DI NYY)#&DI!$*499c:C!!#&r   c                sP    \        VP                  V4      pVP                  V4      # r   )r  rd   r  )r   ra  r    r   r  r  r   name_lookup_cbZParserHostdev.name_lookup_cb  s#    *499c:))$//r   c                s0   \         P                  V 4       \        V R R7       V P                  RR4       V P                  RRV P                  V P
                  R7       V P                  RR4       V P                  RR	R R
7       V P                  RR4       R# )Tr  r   rx   Nr  rp  rq  r  r  r  r^  r_  )rz  r  r)  r  r  r  r  r   r   rt  Z!ParserHostdev._virtcli_class_init  sv    0055FF#FDS__@R@RSM=1Iy48*,<=r   r0   N)r&   r'   r(   r)   r   r  rp  rT  r  r  r  rt  r*   r+   r,   r.   r   r  r    sC     L&NL}9G
'0 > >r   r  c                   r  )r&  i  ZlaunchSecurityr   c                s   \         P                  V 4       V P                  R R 4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  R	R	4       V P                  R
R
RR7       V P                  RRRR7       V P                  RRRR7       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RRRR7       V P                  RR4       R# )r   ZcbitposZreducedPhysBitsra  ZsessionZdhCertZguestVisibleWorkaroundsZidBlockZidAuthZhostDataZkernelHashesTr  Z	authorKeyZvcekZ
mrConfigIdZmrOwnerZmrOwnerConfigZquoteGenerationServiceZquoteGenerationSocketNr  r  r   r   rt  Z(ParserLaunchSecurity._virtcli_class_init  s%   005FF#Iy)%'89Hh'Iy)Hh'-/HIIy)Hh'J
+NNTBKt<FFT2L,/Iy)O_5,.FQUV+-DEr   r0   Nr"  r,   r.   r   r&  r&    s(     #L%NLF Fr   r&  c                s    . p\         P                  ! V4       FD  pV! WP\        V4      R7      pVP                  V4      pV\         P                  ! V4      ,          pKF  	  V# )z
Lookup the cli options.* string associated with the passed in Parser*
class, and parse its values into the passed guest instance, or editinst
for some virt-xml usage.
)ry   r  )r   rW  r   r  )ry   r   parservalueZeditinstrX  rg  Z	parserobjZparseretru  r   
run_parserr    sT     C//+.T(^L	??8,wx(( /
 Jr   c                 st    . p\          F+  p\        WP                  4      pV\        WV4      ,          pK-  	  V# r   )r   rd  r   r  )r  ry   rX  r   r  s   &&   r   run_all_parsersr     s9    
C#g'?'?@z%k:: $ Jr   c                s"   Rp\        4        F~  p\        WP                  4      '       g   K   \        P                  ! \        WP                  4      4      pV'       g   KS  V F%  pVR8X  g
   VR8X  g   K  VP                  4        RpK'  	  K  	  V# )zF
Check if the user requested option introspection with ex: '--disk=?'
Fr   r   T)r   r  r   r   rW  rd  r  )r  rX  r   Zoptlistrg  rb  r   check_option_introspectionr!    sy     C-/w 8 899//''3K3K"LMF}& 0//1  0 Jr   c                 s    V P                   R 8w  d   R# \        P                  ! 4        F'  p\        RP	                  VP
                  4      4       K)  	  \        4        \        \        R4      4       R# )rf  Fz, z<You can see additional information with:

  osinfo-query os
T)r  r   Zlist_osrq   rQ   Z	all_namesrE   )r  r  r{   r   check_osinfo_listr"    sN    ~~dii()   
G	!M
NOr   )F)Tr   )FT)FFFFFFF)TF)FFF)rO   )r4   ro  rX   r   r   ZshutilrS   rR   rw  rg   rO   r   Zbuildconfigr   Z
connectionr   r	  r   r   r   r   r   r	   ry   r
   Zloggerr   r   r  r   Zosdictr   r  r   r   Zinstall.unattendedr   Zinstall.cloudinitr   Zwhichr  r   r/   r1   r2   r   r5   r3   rH   rM   r`   re   rb   rp   rr   rt   rn   rz   r|   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r'  r*  r,  r-  r/  r8  r9  r:  rP  rD  rZ  rh  rr  r   rs  rz  r.  r  r  r  r   r  r  r   r  r   r  r  r   r  r   r  r  r   r  r  r  r  r   r"  r#  r  r   r  r  r  r   r  r  r   r(  r)  r  r  r  r   r!  r$  r%  r)  r/  rA  rB  rF  rI  r+  r   r   r   r   r  r  r  r  r  r	  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r  r  r  r&  r  r   r!  r"  r0   r   r   <module>r#     si     	 	   
     $ *   &   / . , m,< <$ "
 $<< $6CIdb
8	 
H=	

-'&T*	''5!'4T 0(0p
Sbl
\=<"L^od.&$*	<& && %&b bJZ  Z z04n 4g"j g"^	, ,D'^3 3.3 3..} . 8- 8$)?M ?"	 	8m 8(&
8] 
8B&2 2j#= #(%P >C%] %8	8= 	8"	P] 	P"
] 
N7K= 7K~6M 6&$
m $
X$@- $@XE
 E
Z_
M _
N5
m 5
zW[ W[~j. j.d.- .8>] >&
M 
4A4] A4RO_- O_nQ} Q(weM we~PM PN.Sb6$8X,FS FS\U
M U
zR3] R3t?R} ?RN>- >B<- <,
m 
>#- #@.a .al;2 ;2F=] =&&H= &H\M} M,;- ;:6- 68*- *2K>- K>\&; &
([ (
'K '
'K '1:} 1:r*- *D*- *<	 - 	 
$= 
$$-`,$>M $>XF= FB (	r   