qemu-options.hx 196 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938
  1. HXCOMM Use DEFHEADING() to define headings in both help text and texi
  2. HXCOMM Text between STEXI and ETEXI are copied to texi version and
  3. HXCOMM discarded from C version
  4. HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
  5. HXCOMM construct option structures, enums and help message for specified
  6. HXCOMM architectures.
  7. HXCOMM HXCOMM can be used for comments, discarded from both texi and C
  8. DEFHEADING(Standard options:)
  9. STEXI
  10. @table @option
  11. ETEXI
  12. DEF("help", 0, QEMU_OPTION_h,
  13. "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
  14. STEXI
  15. @item -h
  16. @findex -h
  17. Display help and exit
  18. ETEXI
  19. DEF("version", 0, QEMU_OPTION_version,
  20. "-version display version information and exit\n", QEMU_ARCH_ALL)
  21. STEXI
  22. @item -version
  23. @findex -version
  24. Display version information and exit
  25. ETEXI
  26. DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
  27. "-machine [type=]name[,prop[=value][,...]]\n"
  28. " selects emulated machine ('-machine help' for list)\n"
  29. " property accel=accel1[:accel2[:...]] selects accelerator\n"
  30. " supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n"
  31. " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
  32. " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
  33. " kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
  34. " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
  35. " mem-merge=on|off controls memory merge support (default: on)\n"
  36. " igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
  37. " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
  38. " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
  39. " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
  40. " nvdimm=on|off controls NVDIMM support (default=off)\n"
  41. " enforce-config-section=on|off enforce configuration section migration (default=off)\n"
  42. " memory-encryption=@var{} memory encryption object to use (default=none)\n",
  43. QEMU_ARCH_ALL)
  44. STEXI
  45. @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
  46. @findex -machine
  47. Select the emulated machine by @var{name}. Use @code{-machine help} to list
  48. available machines.
  49. For architectures which aim to support live migration compatibility
  50. across releases, each release will introduce a new versioned machine
  51. type. For example, the 2.8.0 release introduced machine types
  52. ``pc-i440fx-2.8'' and ``pc-q35-2.8'' for the x86_64/i686 architectures.
  53. To allow live migration of guests from QEMU version 2.8.0, to QEMU
  54. version 2.9.0, the 2.9.0 version must support the ``pc-i440fx-2.8''
  55. and ``pc-q35-2.8'' machines too. To allow users live migrating VMs
  56. to skip multiple intermediate releases when upgrading, new releases
  57. of QEMU will support machine types from many previous versions.
  58. Supported machine properties are:
  59. @table @option
  60. @item accel=@var{accels1}[:@var{accels2}[:...]]
  61. This is used to enable an accelerator. Depending on the target architecture,
  62. kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
  63. more than one accelerator specified, the next one is used if the previous one
  64. fails to initialize.
  65. @item kernel_irqchip=on|off
  66. Controls in-kernel irqchip support for the chosen accelerator when available.
  67. @item gfx_passthru=on|off
  68. Enables IGD GFX passthrough support for the chosen machine when available.
  69. @item vmport=on|off|auto
  70. Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
  71. value based on accel. For accel=xen the default is off otherwise the default
  72. is on.
  73. @item kvm_shadow_mem=size
  74. Defines the size of the KVM shadow MMU.
  75. @item dump-guest-core=on|off
  76. Include guest memory in a core dump. The default is on.
  77. @item mem-merge=on|off
  78. Enables or disables memory merge support. This feature, when supported by
  79. the host, de-duplicates identical memory pages among VMs instances
  80. (enabled by default).
  81. @item aes-key-wrap=on|off
  82. Enables or disables AES key wrapping support on s390-ccw hosts. This feature
  83. controls whether AES wrapping keys will be created to allow
  84. execution of AES cryptographic functions. The default is on.
  85. @item dea-key-wrap=on|off
  86. Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
  87. controls whether DEA wrapping keys will be created to allow
  88. execution of DEA cryptographic functions. The default is on.
  89. @item nvdimm=on|off
  90. Enables or disables NVDIMM support. The default is off.
  91. @item enforce-config-section=on|off
  92. If @option{enforce-config-section} is set to @var{on}, force migration
  93. code to send configuration section even if the machine-type sets the
  94. @option{migration.send-configuration} property to @var{off}.
  95. NOTE: this parameter is deprecated. Please use @option{-global}
  96. @option{migration.send-configuration}=@var{on|off} instead.
  97. @item memory-encryption=@var{}
  98. Memory encryption object to use. The default is none.
  99. @end table
  100. ETEXI
  101. HXCOMM Deprecated by -machine
  102. DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
  103. DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
  104. "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
  105. STEXI
  106. @item -cpu @var{model}
  107. @findex -cpu
  108. Select CPU model (@code{-cpu help} for list and additional feature selection)
  109. ETEXI
  110. DEF("accel", HAS_ARG, QEMU_OPTION_accel,
  111. "-accel [accel=]accelerator[,thread=single|multi]\n"
  112. " select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
  113. " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
  114. STEXI
  115. @item -accel @var{name}[,prop=@var{value}[,...]]
  116. @findex -accel
  117. This is used to enable an accelerator. Depending on the target architecture,
  118. kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
  119. more than one accelerator specified, the next one is used if the previous one
  120. fails to initialize.
  121. @table @option
  122. @item thread=single|multi
  123. Controls number of TCG threads. When the TCG is multi-threaded there will be one
  124. thread per vCPU therefor taking advantage of additional host cores. The default
  125. is to enable multi-threading where both the back-end and front-ends support it and
  126. no incompatible TCG features have been enabled (e.g. icount/replay).
  127. @end table
  128. ETEXI
  129. DEF("smp", HAS_ARG, QEMU_OPTION_smp,
  130. "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,dies=dies][,sockets=sockets]\n"
  131. " set the number of CPUs to 'n' [default=1]\n"
  132. " maxcpus= maximum number of total cpus, including\n"
  133. " offline CPUs for hotplug, etc\n"
  134. " cores= number of CPU cores on one socket (for PC, it's on one die)\n"
  135. " threads= number of threads on one CPU core\n"
  136. " dies= number of CPU dies on one socket (for PC only)\n"
  137. " sockets= number of discrete sockets in the system\n",
  138. QEMU_ARCH_ALL)
  139. STEXI
  140. @item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,dies=dies][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
  141. @findex -smp
  142. Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
  143. CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
  144. to 4.
  145. For the PC target, the number of @var{cores} per die, the number of @var{threads}
  146. per cores, the number of @var{dies} per packages and the total number of
  147. @var{sockets} can be specified. Missing values will be computed.
  148. If any on the three values is given, the total number of CPUs @var{n} can be omitted.
  149. @var{maxcpus} specifies the maximum number of hotpluggable CPUs.
  150. ETEXI
  151. DEF("numa", HAS_ARG, QEMU_OPTION_numa,
  152. "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
  153. "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
  154. "-numa dist,src=source,dst=destination,val=distance\n"
  155. "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n",
  156. QEMU_ARCH_ALL)
  157. STEXI
  158. @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
  159. @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
  160. @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance}
  161. @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}]
  162. @findex -numa
  163. Define a NUMA node and assign RAM and VCPUs to it.
  164. Set the NUMA distance from a source node to a destination node.
  165. Legacy VCPU assignment uses @samp{cpus} option where
  166. @var{firstcpu} and @var{lastcpu} are CPU indexes. Each
  167. @samp{cpus} option represent a contiguous range of CPU indexes
  168. (or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
  169. set of VCPUs can be represented by providing multiple @samp{cpus}
  170. options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
  171. split between them.
  172. For example, the following option assigns VCPUs 0, 1, 2 and 5 to
  173. a NUMA node:
  174. @example
  175. -numa node,cpus=0-2,cpus=5
  176. @end example
  177. @samp{cpu} option is a new alternative to @samp{cpus} option
  178. which uses @samp{socket-id|core-id|thread-id} properties to assign
  179. CPU objects to a @var{node} using topology layout properties of CPU.
  180. The set of properties is machine specific, and depends on used
  181. machine type/@samp{smp} options. It could be queried with
  182. @samp{hotpluggable-cpus} monitor command.
  183. @samp{node-id} property specifies @var{node} to which CPU object
  184. will be assigned, it's required for @var{node} to be declared
  185. with @samp{node} option before it's used with @samp{cpu} option.
  186. For example:
  187. @example
  188. -M pc \
  189. -smp 1,sockets=2,maxcpus=2 \
  190. -numa node,nodeid=0 -numa node,nodeid=1 \
  191. -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
  192. @end example
  193. @samp{mem} assigns a given RAM amount to a node. @samp{memdev}
  194. assigns RAM from a given memory backend device to a node. If
  195. @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
  196. split equally between them.
  197. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
  198. if one node uses @samp{memdev}, all of them have to use it.
  199. @var{source} and @var{destination} are NUMA node IDs.
  200. @var{distance} is the NUMA distance from @var{source} to @var{destination}.
  201. The distance from a node to itself is always 10. If any pair of nodes is
  202. given a distance, then all pairs must be given distances. Although, when
  203. distances are only given in one direction for each pair of nodes, then
  204. the distances in the opposite directions are assumed to be the same. If,
  205. however, an asymmetrical pair of distances is given for even one node
  206. pair, then all node pairs must be provided distance values for both
  207. directions, even when they are symmetrical. When a node is unreachable
  208. from another node, set the pair's distance to 255.
  209. Note that the -@option{numa} option doesn't allocate any of the
  210. specified resources, it just assigns existing resources to NUMA
  211. nodes. This means that one still has to use the @option{-m},
  212. @option{-smp} options to allocate RAM and VCPUs respectively.
  213. ETEXI
  214. DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
  215. "-add-fd fd=fd,set=set[,opaque=opaque]\n"
  216. " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
  217. STEXI
  218. @item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
  219. @findex -add-fd
  220. Add a file descriptor to an fd set. Valid options are:
  221. @table @option
  222. @item fd=@var{fd}
  223. This option defines the file descriptor of which a duplicate is added to fd set.
  224. The file descriptor cannot be stdin, stdout, or stderr.
  225. @item set=@var{set}
  226. This option defines the ID of the fd set to add the file descriptor to.
  227. @item opaque=@var{opaque}
  228. This option defines a free-form string that can be used to describe @var{fd}.
  229. @end table
  230. You can open an image using pre-opened file descriptors from an fd set:
  231. @example
  232. @value{qemu_system} \
  233. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
  234. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
  235. -drive file=/dev/fdset/2,index=0,media=disk
  236. @end example
  237. ETEXI
  238. DEF("set", HAS_ARG, QEMU_OPTION_set,
  239. "-set group.id.arg=value\n"
  240. " set <arg> parameter for item <id> of type <group>\n"
  241. " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
  242. STEXI
  243. @item -set @var{group}.@var{id}.@var{arg}=@var{value}
  244. @findex -set
  245. Set parameter @var{arg} for item @var{id} of type @var{group}
  246. ETEXI
  247. DEF("global", HAS_ARG, QEMU_OPTION_global,
  248. "-global driver.property=value\n"
  249. "-global driver=driver,property=property,value=value\n"
  250. " set a global default for a driver property\n",
  251. QEMU_ARCH_ALL)
  252. STEXI
  253. @item -global @var{driver}.@var{prop}=@var{value}
  254. @itemx -global driver=@var{driver},property=@var{property},value=@var{value}
  255. @findex -global
  256. Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
  257. @example
  258. @value{qemu_system_x86} -global ide-hd.physical_block_size=4096 disk-image.img
  259. @end example
  260. In particular, you can use this to set driver properties for devices which are
  261. created automatically by the machine model. To create a device which is not
  262. created automatically and set properties on it, use -@option{device}.
  263. -global @var{driver}.@var{prop}=@var{value} is shorthand for -global
  264. driver=@var{driver},property=@var{prop},value=@var{value}. The
  265. longhand syntax works even when @var{driver} contains a dot.
  266. ETEXI
  267. DEF("boot", HAS_ARG, QEMU_OPTION_boot,
  268. "-boot [order=drives][,once=drives][,menu=on|off]\n"
  269. " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
  270. " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
  271. " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
  272. " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
  273. " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
  274. QEMU_ARCH_ALL)
  275. STEXI
  276. @item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off]
  277. @findex -boot
  278. Specify boot order @var{drives} as a string of drive letters. Valid
  279. drive letters depend on the target architecture. The x86 PC uses: a, b
  280. (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
  281. from network adapter 1-4), hard disk boot is the default. To apply a
  282. particular boot order only on the first startup, specify it via
  283. @option{once}. Note that the @option{order} or @option{once} parameter
  284. should not be used together with the @option{bootindex} property of
  285. devices, since the firmware implementations normally do not support both
  286. at the same time.
  287. Interactive boot menus/prompts can be enabled via @option{menu=on} as far
  288. as firmware/BIOS supports them. The default is non-interactive boot.
  289. A splash picture could be passed to bios, enabling user to show it as logo,
  290. when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
  291. supports them. Currently Seabios for X86 system support it.
  292. limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
  293. format(true color). The resolution should be supported by the SVGA mode, so
  294. the recommended is 320x240, 640x480, 800x640.
  295. A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
  296. when boot failed, then reboot. If @option{reboot-timeout} is not set,
  297. guest will not reboot by default. Currently Seabios for X86
  298. system support it.
  299. Do strict boot via @option{strict=on} as far as firmware/BIOS
  300. supports it. This only effects when boot priority is changed by
  301. bootindex options. The default is non-strict boot.
  302. @example
  303. # try to boot from network first, then from hard disk
  304. @value{qemu_system_x86} -boot order=nc
  305. # boot from CD-ROM first, switch back to default order after reboot
  306. @value{qemu_system_x86} -boot once=d
  307. # boot with a splash picture for 5 seconds.
  308. @value{qemu_system_x86} -boot menu=on,splash=/root/boot.bmp,splash-time=5000
  309. @end example
  310. Note: The legacy format '-boot @var{drives}' is still supported but its
  311. use is discouraged as it may be removed from future versions.
  312. ETEXI
  313. DEF("m", HAS_ARG, QEMU_OPTION_m,
  314. "-m [size=]megs[,slots=n,maxmem=size]\n"
  315. " configure guest RAM\n"
  316. " size: initial amount of guest memory\n"
  317. " slots: number of hotplug slots (default: none)\n"
  318. " maxmem: maximum amount of guest memory (default: none)\n"
  319. "NOTE: Some architectures might enforce a specific granularity\n",
  320. QEMU_ARCH_ALL)
  321. STEXI
  322. @item -m [size=]@var{megs}[,slots=n,maxmem=size]
  323. @findex -m
  324. Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
  325. Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
  326. megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
  327. could be used to set amount of hotpluggable memory slots and maximum amount of
  328. memory. Note that @var{maxmem} must be aligned to the page size.
  329. For example, the following command-line sets the guest startup RAM size to
  330. 1GB, creates 3 slots to hotplug additional memory and sets the maximum
  331. memory the guest can reach to 4GB:
  332. @example
  333. @value{qemu_system} -m 1G,slots=3,maxmem=4G
  334. @end example
  335. If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
  336. be enabled and the guest startup RAM will never increase.
  337. ETEXI
  338. DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
  339. "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
  340. STEXI
  341. @item -mem-path @var{path}
  342. @findex -mem-path
  343. Allocate guest RAM from a temporarily created file in @var{path}.
  344. ETEXI
  345. DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
  346. "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
  347. QEMU_ARCH_ALL)
  348. STEXI
  349. @item -mem-prealloc
  350. @findex -mem-prealloc
  351. Preallocate memory when using -mem-path.
  352. ETEXI
  353. DEF("k", HAS_ARG, QEMU_OPTION_k,
  354. "-k language use keyboard layout (for example 'fr' for French)\n",
  355. QEMU_ARCH_ALL)
  356. STEXI
  357. @item -k @var{language}
  358. @findex -k
  359. Use keyboard layout @var{language} (for example @code{fr} for
  360. French). This option is only needed where it is not easy to get raw PC
  361. keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
  362. display). You don't normally need to use it on PC/Linux or PC/Windows
  363. hosts.
  364. The available layouts are:
  365. @example
  366. ar de-ch es fo fr-ca hu ja mk no pt-br sv
  367. da en-gb et fr fr-ch is lt nl pl ru th
  368. de en-us fi fr-be hr it lv nl-be pt sl tr
  369. @end example
  370. The default is @code{en-us}.
  371. ETEXI
  372. HXCOMM Deprecated by -audiodev
  373. DEF("audio-help", 0, QEMU_OPTION_audio_help,
  374. "-audio-help show -audiodev equivalent of the currently specified audio settings\n",
  375. QEMU_ARCH_ALL)
  376. STEXI
  377. @item -audio-help
  378. @findex -audio-help
  379. Will show the -audiodev equivalent of the currently specified
  380. (deprecated) environment variables.
  381. ETEXI
  382. DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
  383. "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
  384. " specifies the audio backend to use\n"
  385. " id= identifier of the backend\n"
  386. " timer-period= timer period in microseconds\n"
  387. " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
  388. " in|out.fixed-settings= use fixed settings for host audio\n"
  389. " in|out.frequency= frequency to use with fixed settings\n"
  390. " in|out.channels= number of channels to use with fixed settings\n"
  391. " in|out.format= sample format to use with fixed settings\n"
  392. " valid values: s8, s16, s32, u8, u16, u32\n"
  393. " in|out.voices= number of voices to use\n"
  394. " in|out.buffer-length= length of buffer in microseconds\n"
  395. "-audiodev none,id=id,[,prop[=value][,...]]\n"
  396. " dummy driver that discards all output\n"
  397. #ifdef CONFIG_AUDIO_ALSA
  398. "-audiodev alsa,id=id[,prop[=value][,...]]\n"
  399. " in|out.dev= name of the audio device to use\n"
  400. " in|out.period-length= length of period in microseconds\n"
  401. " in|out.try-poll= attempt to use poll mode\n"
  402. " threshold= threshold (in microseconds) when playback starts\n"
  403. #endif
  404. #ifdef CONFIG_AUDIO_COREAUDIO
  405. "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
  406. " in|out.buffer-count= number of buffers\n"
  407. #endif
  408. #ifdef CONFIG_AUDIO_DSOUND
  409. "-audiodev dsound,id=id[,prop[=value][,...]]\n"
  410. " latency= add extra latency to playback in microseconds\n"
  411. #endif
  412. #ifdef CONFIG_AUDIO_OSS
  413. "-audiodev oss,id=id[,prop[=value][,...]]\n"
  414. " in|out.dev= path of the audio device to use\n"
  415. " in|out.buffer-count= number of buffers\n"
  416. " in|out.try-poll= attempt to use poll mode\n"
  417. " try-mmap= try using memory mapped access\n"
  418. " exclusive= open device in exclusive mode\n"
  419. " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
  420. #endif
  421. #ifdef CONFIG_AUDIO_PA
  422. "-audiodev pa,id=id[,prop[=value][,...]]\n"
  423. " server= PulseAudio server address\n"
  424. " in|out.name= source/sink device name\n"
  425. " in|out.latency= desired latency in microseconds\n"
  426. #endif
  427. #ifdef CONFIG_AUDIO_SDL
  428. "-audiodev sdl,id=id[,prop[=value][,...]]\n"
  429. #endif
  430. #ifdef CONFIG_SPICE
  431. "-audiodev spice,id=id[,prop[=value][,...]]\n"
  432. #endif
  433. "-audiodev wav,id=id[,prop[=value][,...]]\n"
  434. " path= path of wav file to record\n",
  435. QEMU_ARCH_ALL)
  436. STEXI
  437. @item -audiodev [driver=]@var{driver},id=@var{id}[,@var{prop}[=@var{value}][,...]]
  438. @findex -audiodev
  439. Adds a new audio backend @var{driver} identified by @var{id}. There are
  440. global and driver specific properties. Some values can be set
  441. differently for input and output, they're marked with @code{in|out.}.
  442. You can set the input's property with @code{in.@var{prop}} and the
  443. output's property with @code{out.@var{prop}}. For example:
  444. @example
  445. -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
  446. -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
  447. @end example
  448. NOTE: parameter validation is known to be incomplete, in many cases
  449. specifying an invalid option causes QEMU to print an error message and
  450. continue emulation without sound.
  451. Valid global options are:
  452. @table @option
  453. @item id=@var{identifier}
  454. Identifies the audio backend.
  455. @item timer-period=@var{period}
  456. Sets the timer @var{period} used by the audio subsystem in microseconds.
  457. Default is 10000 (10 ms).
  458. @item in|out.mixing-engine=on|off
  459. Use QEMU's mixing engine to mix all streams inside QEMU and convert
  460. audio formats when not supported by the backend. When off,
  461. @var{fixed-settings} must be off too. Note that disabling this option
  462. means that the selected backend must support multiple streams and the
  463. audio formats used by the virtual cards, otherwise you'll get no sound.
  464. It's not recommended to disable this option unless you want to use 5.1
  465. or 7.1 audio, as mixing engine only supports mono and stereo audio.
  466. Default is on.
  467. @item in|out.fixed-settings=on|off
  468. Use fixed settings for host audio. When off, it will change based on
  469. how the guest opens the sound card. In this case you must not specify
  470. @var{frequency}, @var{channels} or @var{format}. Default is on.
  471. @item in|out.frequency=@var{frequency}
  472. Specify the @var{frequency} to use when using @var{fixed-settings}.
  473. Default is 44100Hz.
  474. @item in|out.channels=@var{channels}
  475. Specify the number of @var{channels} to use when using
  476. @var{fixed-settings}. Default is 2 (stereo).
  477. @item in|out.format=@var{format}
  478. Specify the sample @var{format} to use when using @var{fixed-settings}.
  479. Valid values are: @code{s8}, @code{s16}, @code{s32}, @code{u8},
  480. @code{u16}, @code{u32}. Default is @code{s16}.
  481. @item in|out.voices=@var{voices}
  482. Specify the number of @var{voices} to use. Default is 1.
  483. @item in|out.buffer-length=@var{usecs}
  484. Sets the size of the buffer in microseconds.
  485. @end table
  486. @item -audiodev none,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  487. Creates a dummy backend that discards all outputs. This backend has no
  488. backend specific properties.
  489. @item -audiodev alsa,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  490. Creates backend using the ALSA. This backend is only available on
  491. Linux.
  492. ALSA specific options are:
  493. @table @option
  494. @item in|out.dev=@var{device}
  495. Specify the ALSA @var{device} to use for input and/or output. Default
  496. is @code{default}.
  497. @item in|out.period-length=@var{usecs}
  498. Sets the period length in microseconds.
  499. @item in|out.try-poll=on|off
  500. Attempt to use poll mode with the device. Default is on.
  501. @item threshold=@var{threshold}
  502. Threshold (in microseconds) when playback starts. Default is 0.
  503. @end table
  504. @item -audiodev coreaudio,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  505. Creates a backend using Apple's Core Audio. This backend is only
  506. available on Mac OS and only supports playback.
  507. Core Audio specific options are:
  508. @table @option
  509. @item in|out.buffer-count=@var{count}
  510. Sets the @var{count} of the buffers.
  511. @end table
  512. @item -audiodev dsound,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  513. Creates a backend using Microsoft's DirectSound. This backend is only
  514. available on Windows and only supports playback.
  515. DirectSound specific options are:
  516. @table @option
  517. @item latency=@var{usecs}
  518. Add extra @var{usecs} microseconds latency to playback. Default is
  519. 10000 (10 ms).
  520. @end table
  521. @item -audiodev oss,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  522. Creates a backend using OSS. This backend is available on most
  523. Unix-like systems.
  524. OSS specific options are:
  525. @table @option
  526. @item in|out.dev=@var{device}
  527. Specify the file name of the OSS @var{device} to use. Default is
  528. @code{/dev/dsp}.
  529. @item in|out.buffer-count=@var{count}
  530. Sets the @var{count} of the buffers.
  531. @item in|out.try-poll=on|of
  532. Attempt to use poll mode with the device. Default is on.
  533. @item try-mmap=on|off
  534. Try using memory mapped device access. Default is off.
  535. @item exclusive=on|off
  536. Open the device in exclusive mode (vmix won't work in this case).
  537. Default is off.
  538. @item dsp-policy=@var{policy}
  539. Sets the timing policy (between 0 and 10, where smaller number means
  540. smaller latency but higher CPU usage). Use -1 to use buffer sizes
  541. specified by @code{buffer} and @code{buffer-count}. This option is
  542. ignored if you do not have OSS 4. Default is 5.
  543. @end table
  544. @item -audiodev pa,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  545. Creates a backend using PulseAudio. This backend is available on most
  546. systems.
  547. PulseAudio specific options are:
  548. @table @option
  549. @item server=@var{server}
  550. Sets the PulseAudio @var{server} to connect to.
  551. @item in|out.name=@var{sink}
  552. Use the specified source/sink for recording/playback.
  553. @item in|out.latency=@var{usecs}
  554. Desired latency in microseconds. The PulseAudio server will try to honor this
  555. value but actual latencies may be lower or higher.
  556. @end table
  557. @item -audiodev sdl,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  558. Creates a backend using SDL. This backend is available on most systems,
  559. but you should use your platform's native backend if possible. This
  560. backend has no backend specific properties.
  561. @item -audiodev spice,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  562. Creates a backend that sends audio through SPICE. This backend requires
  563. @code{-spice} and automatically selected in that case, so usually you
  564. can ignore this option. This backend has no backend specific
  565. properties.
  566. @item -audiodev wav,id=@var{id}[,@var{prop}[=@var{value}][,...]]
  567. Creates a backend that writes audio to a WAV file.
  568. Backend specific options are:
  569. @table @option
  570. @item path=@var{path}
  571. Write recorded audio into the specified file. Default is
  572. @code{qemu.wav}.
  573. @end table
  574. ETEXI
  575. DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
  576. "-soundhw c1,... enable audio support\n"
  577. " and only specified sound cards (comma separated list)\n"
  578. " use '-soundhw help' to get the list of supported cards\n"
  579. " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
  580. STEXI
  581. @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
  582. @findex -soundhw
  583. Enable audio and selected sound hardware. Use 'help' to print all
  584. available sound hardware. For example:
  585. @example
  586. @value{qemu_system_x86} -soundhw sb16,adlib disk.img
  587. @value{qemu_system_x86} -soundhw es1370 disk.img
  588. @value{qemu_system_x86} -soundhw ac97 disk.img
  589. @value{qemu_system_x86} -soundhw hda disk.img
  590. @value{qemu_system_x86} -soundhw all disk.img
  591. @value{qemu_system_x86} -soundhw help
  592. @end example
  593. Note that Linux's i810_audio OSS kernel (for AC97) module might
  594. require manually specifying clocking.
  595. @example
  596. modprobe i810_audio clocking=48000
  597. @end example
  598. ETEXI
  599. DEF("device", HAS_ARG, QEMU_OPTION_device,
  600. "-device driver[,prop[=value][,...]]\n"
  601. " add device (based on driver)\n"
  602. " prop=value,... sets driver properties\n"
  603. " use '-device help' to print all possible drivers\n"
  604. " use '-device driver,help' to print all possible properties\n",
  605. QEMU_ARCH_ALL)
  606. STEXI
  607. @item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
  608. @findex -device
  609. Add device @var{driver}. @var{prop}=@var{value} sets driver
  610. properties. Valid properties depend on the driver. To get help on
  611. possible drivers and properties, use @code{-device help} and
  612. @code{-device @var{driver},help}.
  613. Some drivers are:
  614. @item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}][,sdrfile=@var{file}][,furareasize=@var{val}][,furdatafile=@var{file}][,guid=@var{uuid}]
  615. Add an IPMI BMC. This is a simulation of a hardware management
  616. interface processor that normally sits on a system. It provides
  617. a watchdog and the ability to reset and power control the system.
  618. You need to connect this to an IPMI interface to make it useful
  619. The IPMI slave address to use for the BMC. The default is 0x20.
  620. This address is the BMC's address on the I2C network of management
  621. controllers. If you don't know what this means, it is safe to ignore
  622. it.
  623. @table @option
  624. @item id=@var{id}
  625. The BMC id for interfaces to use this device.
  626. @item slave_addr=@var{val}
  627. Define slave address to use for the BMC. The default is 0x20.
  628. @item sdrfile=@var{file}
  629. file containing raw Sensor Data Records (SDR) data. The default is none.
  630. @item fruareasize=@var{val}
  631. size of a Field Replaceable Unit (FRU) area. The default is 1024.
  632. @item frudatafile=@var{file}
  633. file containing raw Field Replaceable Unit (FRU) inventory data. The default is none.
  634. @item guid=@var{uuid}
  635. value for the GUID for the BMC, in standard UUID format. If this is set,
  636. get "Get GUID" command to the BMC will return it. Otherwise "Get GUID"
  637. will return an error.
  638. @end table
  639. @item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
  640. Add a connection to an external IPMI BMC simulator. Instead of
  641. locally emulating the BMC like the above item, instead connect
  642. to an external entity that provides the IPMI services.
  643. A connection is made to an external BMC simulator. If you do this, it
  644. is strongly recommended that you use the "reconnect=" chardev option
  645. to reconnect to the simulator if the connection is lost. Note that if
  646. this is not used carefully, it can be a security issue, as the
  647. interface has the ability to send resets, NMIs, and power off the VM.
  648. It's best if QEMU makes a connection to an external simulator running
  649. on a secure port on localhost, so neither the simulator nor QEMU is
  650. exposed to any outside network.
  651. See the "lanserv/README.vm" file in the OpenIPMI library for more
  652. details on the external interface.
  653. @item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
  654. Add a KCS IPMI interafce on the ISA bus. This also adds a
  655. corresponding ACPI and SMBIOS entries, if appropriate.
  656. @table @option
  657. @item bmc=@var{id}
  658. The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
  659. @item ioport=@var{val}
  660. Define the I/O address of the interface. The default is 0xca0 for KCS.
  661. @item irq=@var{val}
  662. Define the interrupt to use. The default is 5. To disable interrupts,
  663. set this to 0.
  664. @end table
  665. @item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
  666. Like the KCS interface, but defines a BT interface. The default port is
  667. 0xe4 and the default interrupt is 5.
  668. ETEXI
  669. DEF("name", HAS_ARG, QEMU_OPTION_name,
  670. "-name string1[,process=string2][,debug-threads=on|off]\n"
  671. " set the name of the guest\n"
  672. " string1 sets the window title and string2 the process name\n"
  673. " When debug-threads is enabled, individual threads are given a separate name\n"
  674. " NOTE: The thread names are for debugging and not a stable API.\n",
  675. QEMU_ARCH_ALL)
  676. STEXI
  677. @item -name @var{name}
  678. @findex -name
  679. Sets the @var{name} of the guest.
  680. This name will be displayed in the SDL window caption.
  681. The @var{name} will also be used for the VNC server.
  682. Also optionally set the top visible process name in Linux.
  683. Naming of individual threads can also be enabled on Linux to aid debugging.
  684. ETEXI
  685. DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
  686. "-uuid %08x-%04x-%04x-%04x-%012x\n"
  687. " specify machine UUID\n", QEMU_ARCH_ALL)
  688. STEXI
  689. @item -uuid @var{uuid}
  690. @findex -uuid
  691. Set system UUID.
  692. ETEXI
  693. STEXI
  694. @end table
  695. ETEXI
  696. DEFHEADING()
  697. DEFHEADING(Block device options:)
  698. STEXI
  699. @table @option
  700. ETEXI
  701. DEF("fda", HAS_ARG, QEMU_OPTION_fda,
  702. "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
  703. DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
  704. STEXI
  705. @item -fda @var{file}
  706. @itemx -fdb @var{file}
  707. @findex -fda
  708. @findex -fdb
  709. Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
  710. ETEXI
  711. DEF("hda", HAS_ARG, QEMU_OPTION_hda,
  712. "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
  713. DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
  714. DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
  715. "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
  716. DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
  717. STEXI
  718. @item -hda @var{file}
  719. @itemx -hdb @var{file}
  720. @itemx -hdc @var{file}
  721. @itemx -hdd @var{file}
  722. @findex -hda
  723. @findex -hdb
  724. @findex -hdc
  725. @findex -hdd
  726. Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
  727. ETEXI
  728. DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
  729. "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
  730. QEMU_ARCH_ALL)
  731. STEXI
  732. @item -cdrom @var{file}
  733. @findex -cdrom
  734. Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
  735. @option{-cdrom} at the same time). You can use the host CD-ROM by
  736. using @file{/dev/cdrom} as filename (@pxref{host_drives}).
  737. ETEXI
  738. DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
  739. "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
  740. " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
  741. " [,read-only=on|off][,auto-read-only=on|off]\n"
  742. " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
  743. " [,driver specific parameters...]\n"
  744. " configure a block backend\n", QEMU_ARCH_ALL)
  745. STEXI
  746. @item -blockdev @var{option}[,@var{option}[,@var{option}[,...]]]
  747. @findex -blockdev
  748. Define a new block driver node. Some of the options apply to all block drivers,
  749. other options are only accepted for a specific block driver. See below for a
  750. list of generic options and options for the most common block drivers.
  751. Options that expect a reference to another node (e.g. @code{file}) can be
  752. given in two ways. Either you specify the node name of an already existing node
  753. (file=@var{node-name}), or you define a new node inline, adding options
  754. for the referenced node after a dot (file.filename=@var{path},file.aio=native).
  755. A block driver node created with @option{-blockdev} can be used for a guest
  756. device by specifying its node name for the @code{drive} property in a
  757. @option{-device} argument that defines a block device.
  758. @table @option
  759. @item Valid options for any block driver node:
  760. @table @code
  761. @item driver
  762. Specifies the block driver to use for the given node.
  763. @item node-name
  764. This defines the name of the block driver node by which it will be referenced
  765. later. The name must be unique, i.e. it must not match the name of a different
  766. block driver node, or (if you use @option{-drive} as well) the ID of a drive.
  767. If no node name is specified, it is automatically generated. The generated node
  768. name is not intended to be predictable and changes between QEMU invocations.
  769. For the top level, an explicit node name must be specified.
  770. @item read-only
  771. Open the node read-only. Guest write attempts will fail.
  772. Note that some block drivers support only read-only access, either generally or
  773. in certain configurations. In this case, the default value
  774. @option{read-only=off} does not work and the option must be specified
  775. explicitly.
  776. @item auto-read-only
  777. If @option{auto-read-only=on} is set, QEMU may fall back to read-only usage
  778. even when @option{read-only=off} is requested, or even switch between modes as
  779. needed, e.g. depending on whether the image file is writable or whether a
  780. writing user is attached to the node.
  781. @item force-share
  782. Override the image locking system of QEMU by forcing the node to utilize
  783. weaker shared access for permissions where it would normally request exclusive
  784. access. When there is the potential for multiple instances to have the same
  785. file open (whether this invocation of QEMU is the first or the second
  786. instance), both instances must permit shared access for the second instance to
  787. succeed at opening the file.
  788. Enabling @option{force-share=on} requires @option{read-only=on}.
  789. @item cache.direct
  790. The host page cache can be avoided with @option{cache.direct=on}. This will
  791. attempt to do disk IO directly to the guest's memory. QEMU may still perform an
  792. internal copy of the data.
  793. @item cache.no-flush
  794. In case you don't care about data integrity over host failures, you can use
  795. @option{cache.no-flush=on}. This option tells QEMU that it never needs to write
  796. any data to the disk but can instead keep things in cache. If anything goes
  797. wrong, like your host losing power, the disk storage getting disconnected
  798. accidentally, etc. your image will most probably be rendered unusable.
  799. @item discard=@var{discard}
  800. @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls
  801. whether @code{discard} (also known as @code{trim} or @code{unmap}) requests are
  802. ignored or passed to the filesystem. Some machine types may not support
  803. discard requests.
  804. @item detect-zeroes=@var{detect-zeroes}
  805. @var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
  806. conversion of plain zero writes by the OS to driver specific optimized
  807. zero write commands. You may even choose "unmap" if @var{discard} is set
  808. to "unmap" to allow a zero write to be converted to an @code{unmap} operation.
  809. @end table
  810. @item Driver-specific options for @code{file}
  811. This is the protocol-level block driver for accessing regular files.
  812. @table @code
  813. @item filename
  814. The path to the image file in the local filesystem
  815. @item aio
  816. Specifies the AIO backend (threads/native, default: threads)
  817. @item locking
  818. Specifies whether the image file is protected with Linux OFD / POSIX locks. The
  819. default is to use the Linux Open File Descriptor API if available, otherwise no
  820. lock is applied. (auto/on/off, default: auto)
  821. @end table
  822. Example:
  823. @example
  824. -blockdev driver=file,node-name=disk,filename=disk.img
  825. @end example
  826. @item Driver-specific options for @code{raw}
  827. This is the image format block driver for raw images. It is usually
  828. stacked on top of a protocol level block driver such as @code{file}.
  829. @table @code
  830. @item file
  831. Reference to or definition of the data source block driver node
  832. (e.g. a @code{file} driver node)
  833. @end table
  834. Example 1:
  835. @example
  836. -blockdev driver=file,node-name=disk_file,filename=disk.img
  837. -blockdev driver=raw,node-name=disk,file=disk_file
  838. @end example
  839. Example 2:
  840. @example
  841. -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
  842. @end example
  843. @item Driver-specific options for @code{qcow2}
  844. This is the image format block driver for qcow2 images. It is usually
  845. stacked on top of a protocol level block driver such as @code{file}.
  846. @table @code
  847. @item file
  848. Reference to or definition of the data source block driver node
  849. (e.g. a @code{file} driver node)
  850. @item backing
  851. Reference to or definition of the backing file block device (default is taken
  852. from the image file). It is allowed to pass @code{null} here in order to disable
  853. the default backing file.
  854. @item lazy-refcounts
  855. Whether to enable the lazy refcounts feature (on/off; default is taken from the
  856. image file)
  857. @item cache-size
  858. The maximum total size of the L2 table and refcount block caches in bytes
  859. (default: the sum of l2-cache-size and refcount-cache-size)
  860. @item l2-cache-size
  861. The maximum size of the L2 table cache in bytes
  862. (default: if cache-size is not specified - 32M on Linux platforms, and 8M on
  863. non-Linux platforms; otherwise, as large as possible within the cache-size,
  864. while permitting the requested or the minimal refcount cache size)
  865. @item refcount-cache-size
  866. The maximum size of the refcount block cache in bytes
  867. (default: 4 times the cluster size; or if cache-size is specified, the part of
  868. it which is not used for the L2 cache)
  869. @item cache-clean-interval
  870. Clean unused entries in the L2 and refcount caches. The interval is in seconds.
  871. The default value is 600 on supporting platforms, and 0 on other platforms.
  872. Setting it to 0 disables this feature.
  873. @item pass-discard-request
  874. Whether discard requests to the qcow2 device should be forwarded to the data
  875. source (on/off; default: on if discard=unmap is specified, off otherwise)
  876. @item pass-discard-snapshot
  877. Whether discard requests for the data source should be issued when a snapshot
  878. operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/off;
  879. default: on)
  880. @item pass-discard-other
  881. Whether discard requests for the data source should be issued on other
  882. occasions where a cluster gets freed (on/off; default: off)
  883. @item overlap-check
  884. Which overlap checks to perform for writes to the image
  885. (none/constant/cached/all; default: cached). For details or finer
  886. granularity control refer to the QAPI documentation of @code{blockdev-add}.
  887. @end table
  888. Example 1:
  889. @example
  890. -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
  891. -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
  892. @end example
  893. Example 2:
  894. @example
  895. -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
  896. @end example
  897. @item Driver-specific options for other drivers
  898. Please refer to the QAPI documentation of the @code{blockdev-add} QMP command.
  899. @end table
  900. ETEXI
  901. DEF("drive", HAS_ARG, QEMU_OPTION_drive,
  902. "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
  903. " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
  904. " [,snapshot=on|off][,rerror=ignore|stop|report]\n"
  905. " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
  906. " [,readonly=on|off][,copy-on-read=on|off]\n"
  907. " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
  908. " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
  909. " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
  910. " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
  911. " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
  912. " [[,iops_size=is]]\n"
  913. " [[,group=g]]\n"
  914. " use 'file' as a drive image\n", QEMU_ARCH_ALL)
  915. STEXI
  916. @item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
  917. @findex -drive
  918. Define a new drive. This includes creating a block driver node (the backend) as
  919. well as a guest device, and is mostly a shortcut for defining the corresponding
  920. @option{-blockdev} and @option{-device} options.
  921. @option{-drive} accepts all options that are accepted by @option{-blockdev}. In
  922. addition, it knows the following options:
  923. @table @option
  924. @item file=@var{file}
  925. This option defines which disk image (@pxref{disk_images}) to use with
  926. this drive. If the filename contains comma, you must double it
  927. (for instance, "file=my,,file" to use file "my,file").
  928. Special files such as iSCSI devices can be specified using protocol
  929. specific URLs. See the section for "Device URL Syntax" for more information.
  930. @item if=@var{interface}
  931. This option defines on which type on interface the drive is connected.
  932. Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none.
  933. @item bus=@var{bus},unit=@var{unit}
  934. These options define where is connected the drive by defining the bus number and
  935. the unit id.
  936. @item index=@var{index}
  937. This option defines where is connected the drive by using an index in the list
  938. of available connectors of a given interface type.
  939. @item media=@var{media}
  940. This option defines the type of the media: disk or cdrom.
  941. @item snapshot=@var{snapshot}
  942. @var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
  943. (see @option{-snapshot}).
  944. @item cache=@var{cache}
  945. @var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough"
  946. and controls how the host cache is used to access block data. This is a
  947. shortcut that sets the @option{cache.direct} and @option{cache.no-flush}
  948. options (as in @option{-blockdev}), and additionally @option{cache.writeback},
  949. which provides a default for the @option{write-cache} option of block guest
  950. devices (as in @option{-device}). The modes correspond to the following
  951. settings:
  952. @c Our texi2pod.pl script doesn't support @multitable, so fall back to using
  953. @c plain ASCII art (well, UTF-8 art really). This looks okay both in the manpage
  954. @c and the HTML output.
  955. @example
  956. @ │ cache.writeback cache.direct cache.no-flush
  957. ─────────────┼─────────────────────────────────────────────────
  958. writeback │ on off off
  959. none │ on on off
  960. writethrough │ off off off
  961. directsync │ off on off
  962. unsafe │ on off on
  963. @end example
  964. The default mode is @option{cache=writeback}.
  965. @item aio=@var{aio}
  966. @var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
  967. @item format=@var{format}
  968. Specify which disk @var{format} will be used rather than detecting
  969. the format. Can be used to specify format=raw to avoid interpreting
  970. an untrusted format header.
  971. @item werror=@var{action},rerror=@var{action}
  972. Specify which @var{action} to take on write and read errors. Valid actions are:
  973. "ignore" (ignore the error and try to continue), "stop" (pause QEMU),
  974. "report" (report the error to the guest), "enospc" (pause QEMU only if the
  975. host disk is full; report the error to the guest otherwise).
  976. The default setting is @option{werror=enospc} and @option{rerror=report}.
  977. @item copy-on-read=@var{copy-on-read}
  978. @var{copy-on-read} is "on" or "off" and enables whether to copy read backing
  979. file sectors into the image file.
  980. @item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w}
  981. Specify bandwidth throttling limits in bytes per second, either for all request
  982. types or for reads or writes only. Small values can lead to timeouts or hangs
  983. inside the guest. A safe minimum for disks is 2 MB/s.
  984. @item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm}
  985. Specify bursts in bytes per second, either for all request types or for reads
  986. or writes only. Bursts allow the guest I/O to spike above the limit
  987. temporarily.
  988. @item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w}
  989. Specify request rate limits in requests per second, either for all request
  990. types or for reads or writes only.
  991. @item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm}
  992. Specify bursts in requests per second, either for all request types or for reads
  993. or writes only. Bursts allow the guest I/O to spike above the limit
  994. temporarily.
  995. @item iops_size=@var{is}
  996. Let every @var{is} bytes of a request count as a new request for iops
  997. throttling purposes. Use this option to prevent guests from circumventing iops
  998. limits by sending fewer but larger requests.
  999. @item group=@var{g}
  1000. Join a throttling quota group with given name @var{g}. All drives that are
  1001. members of the same group are accounted for together. Use this option to
  1002. prevent guests from circumventing throttling limits by using many small disks
  1003. instead of a single larger disk.
  1004. @end table
  1005. By default, the @option{cache.writeback=on} mode is used. It will report data
  1006. writes as completed as soon as the data is present in the host page cache.
  1007. This is safe as long as your guest OS makes sure to correctly flush disk caches
  1008. where needed. If your guest OS does not handle volatile disk write caches
  1009. correctly and your host crashes or loses power, then the guest may experience
  1010. data corruption.
  1011. For such guests, you should consider using @option{cache.writeback=off}. This
  1012. means that the host page cache will be used to read and write data, but write
  1013. notification will be sent to the guest only after QEMU has made sure to flush
  1014. each write to the disk. Be aware that this has a major impact on performance.
  1015. When using the @option{-snapshot} option, unsafe caching is always used.
  1016. Copy-on-read avoids accessing the same backing file sectors repeatedly and is
  1017. useful when the backing file is over a slow network. By default copy-on-read
  1018. is off.
  1019. Instead of @option{-cdrom} you can use:
  1020. @example
  1021. @value{qemu_system} -drive file=file,index=2,media=cdrom
  1022. @end example
  1023. Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
  1024. use:
  1025. @example
  1026. @value{qemu_system} -drive file=file,index=0,media=disk
  1027. @value{qemu_system} -drive file=file,index=1,media=disk
  1028. @value{qemu_system} -drive file=file,index=2,media=disk
  1029. @value{qemu_system} -drive file=file,index=3,media=disk
  1030. @end example
  1031. You can open an image using pre-opened file descriptors from an fd set:
  1032. @example
  1033. @value{qemu_system} \
  1034. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
  1035. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
  1036. -drive file=/dev/fdset/2,index=0,media=disk
  1037. @end example
  1038. You can connect a CDROM to the slave of ide0:
  1039. @example
  1040. @value{qemu_system_x86} -drive file=file,if=ide,index=1,media=cdrom
  1041. @end example
  1042. If you don't specify the "file=" argument, you define an empty drive:
  1043. @example
  1044. @value{qemu_system_x86} -drive if=ide,index=1,media=cdrom
  1045. @end example
  1046. Instead of @option{-fda}, @option{-fdb}, you can use:
  1047. @example
  1048. @value{qemu_system_x86} -drive file=file,index=0,if=floppy
  1049. @value{qemu_system_x86} -drive file=file,index=1,if=floppy
  1050. @end example
  1051. By default, @var{interface} is "ide" and @var{index} is automatically
  1052. incremented:
  1053. @example
  1054. @value{qemu_system_x86} -drive file=a -drive file=b"
  1055. @end example
  1056. is interpreted like:
  1057. @example
  1058. @value{qemu_system_x86} -hda a -hdb b
  1059. @end example
  1060. ETEXI
  1061. DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
  1062. "-mtdblock file use 'file' as on-board Flash memory image\n",
  1063. QEMU_ARCH_ALL)
  1064. STEXI
  1065. @item -mtdblock @var{file}
  1066. @findex -mtdblock
  1067. Use @var{file} as on-board Flash memory image.
  1068. ETEXI
  1069. DEF("sd", HAS_ARG, QEMU_OPTION_sd,
  1070. "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
  1071. STEXI
  1072. @item -sd @var{file}
  1073. @findex -sd
  1074. Use @var{file} as SecureDigital card image.
  1075. ETEXI
  1076. DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
  1077. "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
  1078. STEXI
  1079. @item -pflash @var{file}
  1080. @findex -pflash
  1081. Use @var{file} as a parallel flash image.
  1082. ETEXI
  1083. DEF("snapshot", 0, QEMU_OPTION_snapshot,
  1084. "-snapshot write to temporary files instead of disk image files\n",
  1085. QEMU_ARCH_ALL)
  1086. STEXI
  1087. @item -snapshot
  1088. @findex -snapshot
  1089. Write to temporary files instead of disk image files. In this case,
  1090. the raw disk image you use is not written back. You can however force
  1091. the write back by pressing @key{C-a s} (@pxref{disk_images}).
  1092. ETEXI
  1093. DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
  1094. "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
  1095. " [,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode]\n"
  1096. " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
  1097. " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
  1098. " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
  1099. " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
  1100. " [[,throttling.iops-size=is]]\n"
  1101. "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly]\n"
  1102. "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly]\n"
  1103. "-fsdev synth,id=id\n",
  1104. QEMU_ARCH_ALL)
  1105. STEXI
  1106. @item -fsdev local,id=@var{id},path=@var{path},security_model=@var{security_model} [,writeout=@var{writeout}][,readonly][,fmode=@var{fmode}][,dmode=@var{dmode}] [,throttling.@var{option}=@var{value}[,throttling.@var{option}=@var{value}[,...]]]
  1107. @itemx -fsdev proxy,id=@var{id},socket=@var{socket}[,writeout=@var{writeout}][,readonly]
  1108. @itemx -fsdev proxy,id=@var{id},sock_fd=@var{sock_fd}[,writeout=@var{writeout}][,readonly]
  1109. @itemx -fsdev synth,id=@var{id}[,readonly]
  1110. @findex -fsdev
  1111. Define a new file system device. Valid options are:
  1112. @table @option
  1113. @item local
  1114. Accesses to the filesystem are done by QEMU.
  1115. @item proxy
  1116. Accesses to the filesystem are done by virtfs-proxy-helper(1).
  1117. @item synth
  1118. Synthetic filesystem, only used by QTests.
  1119. @item id=@var{id}
  1120. Specifies identifier for this device.
  1121. @item path=@var{path}
  1122. Specifies the export path for the file system device. Files under
  1123. this path will be available to the 9p client on the guest.
  1124. @item security_model=@var{security_model}
  1125. Specifies the security model to be used for this export path.
  1126. Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
  1127. In "passthrough" security model, files are stored using the same
  1128. credentials as they are created on the guest. This requires QEMU
  1129. to run as root. In "mapped-xattr" security model, some of the file
  1130. attributes like uid, gid, mode bits and link target are stored as
  1131. file attributes. For "mapped-file" these attributes are stored in the
  1132. hidden .virtfs_metadata directory. Directories exported by this security model cannot
  1133. interact with other unix tools. "none" security model is same as
  1134. passthrough except the sever won't report failures if it fails to
  1135. set file attributes like ownership. Security model is mandatory
  1136. only for local fsdriver. Other fsdrivers (like proxy) don't take
  1137. security model as a parameter.
  1138. @item writeout=@var{writeout}
  1139. This is an optional argument. The only supported value is "immediate".
  1140. This means that host page cache will be used to read and write data but
  1141. write notification will be sent to the guest only when the data has been
  1142. reported as written by the storage subsystem.
  1143. @item readonly
  1144. Enables exporting 9p share as a readonly mount for guests. By default
  1145. read-write access is given.
  1146. @item socket=@var{socket}
  1147. Enables proxy filesystem driver to use passed socket file for communicating
  1148. with virtfs-proxy-helper(1).
  1149. @item sock_fd=@var{sock_fd}
  1150. Enables proxy filesystem driver to use passed socket descriptor for
  1151. communicating with virtfs-proxy-helper(1). Usually a helper like libvirt
  1152. will create socketpair and pass one of the fds as sock_fd.
  1153. @item fmode=@var{fmode}
  1154. Specifies the default mode for newly created files on the host. Works only
  1155. with security models "mapped-xattr" and "mapped-file".
  1156. @item dmode=@var{dmode}
  1157. Specifies the default mode for newly created directories on the host. Works
  1158. only with security models "mapped-xattr" and "mapped-file".
  1159. @item throttling.bps-total=@var{b},throttling.bps-read=@var{r},throttling.bps-write=@var{w}
  1160. Specify bandwidth throttling limits in bytes per second, either for all request
  1161. types or for reads or writes only.
  1162. @item throttling.bps-total-max=@var{bm},bps-read-max=@var{rm},bps-write-max=@var{wm}
  1163. Specify bursts in bytes per second, either for all request types or for reads
  1164. or writes only. Bursts allow the guest I/O to spike above the limit
  1165. temporarily.
  1166. @item throttling.iops-total=@var{i},throttling.iops-read=@var{r}, throttling.iops-write=@var{w}
  1167. Specify request rate limits in requests per second, either for all request
  1168. types or for reads or writes only.
  1169. @item throttling.iops-total-max=@var{im},throttling.iops-read-max=@var{irm}, throttling.iops-write-max=@var{iwm}
  1170. Specify bursts in requests per second, either for all request types or for reads
  1171. or writes only. Bursts allow the guest I/O to spike above the limit temporarily.
  1172. @item throttling.iops-size=@var{is}
  1173. Let every @var{is} bytes of a request count as a new request for iops
  1174. throttling purposes.
  1175. @end table
  1176. -fsdev option is used along with -device driver "virtio-9p-...".
  1177. @item -device virtio-9p-@var{type},fsdev=@var{id},mount_tag=@var{mount_tag}
  1178. Options for virtio-9p-... driver are:
  1179. @table @option
  1180. @item @var{type}
  1181. Specifies the variant to be used. Supported values are "pci", "ccw" or "device",
  1182. depending on the machine type.
  1183. @item fsdev=@var{id}
  1184. Specifies the id value specified along with -fsdev option.
  1185. @item mount_tag=@var{mount_tag}
  1186. Specifies the tag name to be used by the guest to mount this export point.
  1187. @end table
  1188. ETEXI
  1189. DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
  1190. "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
  1191. " [,id=id][,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
  1192. "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly]\n"
  1193. "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly]\n"
  1194. "-virtfs synth,mount_tag=tag[,id=id][,readonly]\n",
  1195. QEMU_ARCH_ALL)
  1196. STEXI
  1197. @item -virtfs local,path=@var{path},mount_tag=@var{mount_tag} ,security_model=@var{security_model}[,writeout=@var{writeout}][,readonly] [,fmode=@var{fmode}][,dmode=@var{dmode}][,multidevs=@var{multidevs}]
  1198. @itemx -virtfs proxy,socket=@var{socket},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly]
  1199. @itemx -virtfs proxy,sock_fd=@var{sock_fd},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly]
  1200. @itemx -virtfs synth,mount_tag=@var{mount_tag}
  1201. @findex -virtfs
  1202. Define a new filesystem device and expose it to the guest using a virtio-9p-device. The general form of a Virtual File system pass-through options are:
  1203. @table @option
  1204. @item local
  1205. Accesses to the filesystem are done by QEMU.
  1206. @item proxy
  1207. Accesses to the filesystem are done by virtfs-proxy-helper(1).
  1208. @item synth
  1209. Synthetic filesystem, only used by QTests.
  1210. @item id=@var{id}
  1211. Specifies identifier for the filesystem device
  1212. @item path=@var{path}
  1213. Specifies the export path for the file system device. Files under
  1214. this path will be available to the 9p client on the guest.
  1215. @item security_model=@var{security_model}
  1216. Specifies the security model to be used for this export path.
  1217. Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
  1218. In "passthrough" security model, files are stored using the same
  1219. credentials as they are created on the guest. This requires QEMU
  1220. to run as root. In "mapped-xattr" security model, some of the file
  1221. attributes like uid, gid, mode bits and link target are stored as
  1222. file attributes. For "mapped-file" these attributes are stored in the
  1223. hidden .virtfs_metadata directory. Directories exported by this security model cannot
  1224. interact with other unix tools. "none" security model is same as
  1225. passthrough except the sever won't report failures if it fails to
  1226. set file attributes like ownership. Security model is mandatory only
  1227. for local fsdriver. Other fsdrivers (like proxy) don't take security
  1228. model as a parameter.
  1229. @item writeout=@var{writeout}
  1230. This is an optional argument. The only supported value is "immediate".
  1231. This means that host page cache will be used to read and write data but
  1232. write notification will be sent to the guest only when the data has been
  1233. reported as written by the storage subsystem.
  1234. @item readonly
  1235. Enables exporting 9p share as a readonly mount for guests. By default
  1236. read-write access is given.
  1237. @item socket=@var{socket}
  1238. Enables proxy filesystem driver to use passed socket file for
  1239. communicating with virtfs-proxy-helper(1). Usually a helper like libvirt
  1240. will create socketpair and pass one of the fds as sock_fd.
  1241. @item sock_fd
  1242. Enables proxy filesystem driver to use passed 'sock_fd' as the socket
  1243. descriptor for interfacing with virtfs-proxy-helper(1).
  1244. @item fmode=@var{fmode}
  1245. Specifies the default mode for newly created files on the host. Works only
  1246. with security models "mapped-xattr" and "mapped-file".
  1247. @item dmode=@var{dmode}
  1248. Specifies the default mode for newly created directories on the host. Works
  1249. only with security models "mapped-xattr" and "mapped-file".
  1250. @item mount_tag=@var{mount_tag}
  1251. Specifies the tag name to be used by the guest to mount this export point.
  1252. @item multidevs=@var{multidevs}
  1253. Specifies how to deal with multiple devices being shared with a 9p export.
  1254. Supported behaviours are either "remap", "forbid" or "warn". The latter is
  1255. the default behaviour on which virtfs 9p expects only one device to be
  1256. shared with the same export, and if more than one device is shared and
  1257. accessed via the same 9p export then only a warning message is logged
  1258. (once) by qemu on host side. In order to avoid file ID collisions on guest
  1259. you should either create a separate virtfs export for each device to be
  1260. shared with guests (recommended way) or you might use "remap" instead which
  1261. allows you to share multiple devices with only one export instead, which is
  1262. achieved by remapping the original inode numbers from host to guest in a
  1263. way that would prevent such collisions. Remapping inodes in such use cases
  1264. is required because the original device IDs from host are never passed and
  1265. exposed on guest. Instead all files of an export shared with virtfs always
  1266. share the same device id on guest. So two files with identical inode
  1267. numbers but from actually different devices on host would otherwise cause a
  1268. file ID collision and hence potential misbehaviours on guest. "forbid" on
  1269. the other hand assumes like "warn" that only one device is shared by the
  1270. same export, however it will not only log a warning message but also
  1271. deny access to additional devices on guest. Note though that "forbid" does
  1272. currently not block all possible file access operations (e.g. readdir()
  1273. would still return entries from other devices).
  1274. @end table
  1275. ETEXI
  1276. DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
  1277. "-virtfs_synth Create synthetic file system image\n",
  1278. QEMU_ARCH_ALL)
  1279. STEXI
  1280. @item -virtfs_synth
  1281. @findex -virtfs_synth
  1282. Create synthetic file system image. Note that this option is now deprecated.
  1283. Please use @code{-fsdev synth} and @code{-device virtio-9p-...} instead.
  1284. ETEXI
  1285. DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
  1286. "-iscsi [user=user][,password=password]\n"
  1287. " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
  1288. " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
  1289. " [,timeout=timeout]\n"
  1290. " iSCSI session parameters\n", QEMU_ARCH_ALL)
  1291. STEXI
  1292. @item -iscsi
  1293. @findex -iscsi
  1294. Configure iSCSI session parameters.
  1295. ETEXI
  1296. STEXI
  1297. @end table
  1298. ETEXI
  1299. DEFHEADING()
  1300. DEFHEADING(USB options:)
  1301. STEXI
  1302. @table @option
  1303. ETEXI
  1304. DEF("usb", 0, QEMU_OPTION_usb,
  1305. "-usb enable on-board USB host controller (if not enabled by default)\n",
  1306. QEMU_ARCH_ALL)
  1307. STEXI
  1308. @item -usb
  1309. @findex -usb
  1310. Enable USB emulation on machine types with an on-board USB host controller (if
  1311. not enabled by default). Note that on-board USB host controllers may not
  1312. support USB 3.0. In this case @option{-device qemu-xhci} can be used instead
  1313. on machines with PCI.
  1314. ETEXI
  1315. DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
  1316. "-usbdevice name add the host or guest USB device 'name'\n",
  1317. QEMU_ARCH_ALL)
  1318. STEXI
  1319. @item -usbdevice @var{devname}
  1320. @findex -usbdevice
  1321. Add the USB device @var{devname}. Note that this option is deprecated,
  1322. please use @code{-device usb-...} instead. @xref{usb_devices}.
  1323. @table @option
  1324. @item mouse
  1325. Virtual Mouse. This will override the PS/2 mouse emulation when activated.
  1326. @item tablet
  1327. Pointer device that uses absolute coordinates (like a touchscreen). This
  1328. means QEMU is able to report the mouse position without having to grab the
  1329. mouse. Also overrides the PS/2 mouse emulation when activated.
  1330. @item braille
  1331. Braille device. This will use BrlAPI to display the braille output on a real
  1332. or fake device.
  1333. @end table
  1334. ETEXI
  1335. STEXI
  1336. @end table
  1337. ETEXI
  1338. DEFHEADING()
  1339. DEFHEADING(Display options:)
  1340. STEXI
  1341. @table @option
  1342. ETEXI
  1343. DEF("display", HAS_ARG, QEMU_OPTION_display,
  1344. #if defined(CONFIG_SPICE)
  1345. "-display spice-app[,gl=on|off]\n"
  1346. #endif
  1347. #if defined(CONFIG_SDL)
  1348. "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
  1349. " [,window_close=on|off][,gl=on|core|es|off]\n"
  1350. #endif
  1351. #if defined(CONFIG_GTK)
  1352. "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
  1353. #endif
  1354. #if defined(CONFIG_VNC)
  1355. "-display vnc=<display>[,<optargs>]\n"
  1356. #endif
  1357. #if defined(CONFIG_CURSES)
  1358. "-display curses[,charset=<encoding>]\n"
  1359. #endif
  1360. #if defined(CONFIG_OPENGL)
  1361. "-display egl-headless[,rendernode=<file>]\n"
  1362. #endif
  1363. "-display none\n"
  1364. " select display backend type\n"
  1365. " The default display is equivalent to\n "
  1366. #if defined(CONFIG_GTK)
  1367. "\"-display gtk\"\n"
  1368. #elif defined(CONFIG_SDL)
  1369. "\"-display sdl\"\n"
  1370. #elif defined(CONFIG_COCOA)
  1371. "\"-display cocoa\"\n"
  1372. #elif defined(CONFIG_VNC)
  1373. "\"-vnc localhost:0,to=99,id=default\"\n"
  1374. #else
  1375. "\"-display none\"\n"
  1376. #endif
  1377. , QEMU_ARCH_ALL)
  1378. STEXI
  1379. @item -display @var{type}
  1380. @findex -display
  1381. Select type of display to use. This option is a replacement for the
  1382. old style -sdl/-curses/... options. Valid values for @var{type} are
  1383. @table @option
  1384. @item sdl
  1385. Display video output via SDL (usually in a separate graphics
  1386. window; see the SDL documentation for other possibilities).
  1387. @item curses
  1388. Display video output via curses. For graphics device models which
  1389. support a text mode, QEMU can display this output using a
  1390. curses/ncurses interface. Nothing is displayed when the graphics
  1391. device is in graphical mode or if the graphics device does not support
  1392. a text mode. Generally only the VGA device models support text mode.
  1393. The font charset used by the guest can be specified with the
  1394. @code{charset} option, for example @code{charset=CP850} for IBM CP850
  1395. encoding. The default is @code{CP437}.
  1396. @item none
  1397. Do not display video output. The guest will still see an emulated
  1398. graphics card, but its output will not be displayed to the QEMU
  1399. user. This option differs from the -nographic option in that it
  1400. only affects what is done with video output; -nographic also changes
  1401. the destination of the serial and parallel port data.
  1402. @item gtk
  1403. Display video output in a GTK window. This interface provides drop-down
  1404. menus and other UI elements to configure and control the VM during
  1405. runtime.
  1406. @item vnc
  1407. Start a VNC server on display <arg>
  1408. @item egl-headless
  1409. Offload all OpenGL operations to a local DRI device. For any graphical display,
  1410. this display needs to be paired with either VNC or SPICE displays.
  1411. @item spice-app
  1412. Start QEMU as a Spice server and launch the default Spice client
  1413. application. The Spice server will redirect the serial consoles and
  1414. QEMU monitors. (Since 4.0)
  1415. @end table
  1416. ETEXI
  1417. DEF("nographic", 0, QEMU_OPTION_nographic,
  1418. "-nographic disable graphical output and redirect serial I/Os to console\n",
  1419. QEMU_ARCH_ALL)
  1420. STEXI
  1421. @item -nographic
  1422. @findex -nographic
  1423. Normally, if QEMU is compiled with graphical window support, it displays
  1424. output such as guest graphics, guest console, and the QEMU monitor in a
  1425. window. With this option, you can totally disable graphical output so
  1426. that QEMU is a simple command line application. The emulated serial port
  1427. is redirected on the console and muxed with the monitor (unless
  1428. redirected elsewhere explicitly). Therefore, you can still use QEMU to
  1429. debug a Linux kernel with a serial console. Use @key{C-a h} for help on
  1430. switching between the console and monitor.
  1431. ETEXI
  1432. DEF("curses", 0, QEMU_OPTION_curses,
  1433. "-curses shorthand for -display curses\n",
  1434. QEMU_ARCH_ALL)
  1435. STEXI
  1436. @item -curses
  1437. @findex -curses
  1438. Normally, if QEMU is compiled with graphical window support, it displays
  1439. output such as guest graphics, guest console, and the QEMU monitor in a
  1440. window. With this option, QEMU can display the VGA output when in text
  1441. mode using a curses/ncurses interface. Nothing is displayed in graphical
  1442. mode.
  1443. ETEXI
  1444. DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
  1445. "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
  1446. QEMU_ARCH_ALL)
  1447. STEXI
  1448. @item -alt-grab
  1449. @findex -alt-grab
  1450. Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
  1451. affects the special keys (for fullscreen, monitor-mode switching, etc).
  1452. ETEXI
  1453. DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
  1454. "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
  1455. QEMU_ARCH_ALL)
  1456. STEXI
  1457. @item -ctrl-grab
  1458. @findex -ctrl-grab
  1459. Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
  1460. affects the special keys (for fullscreen, monitor-mode switching, etc).
  1461. ETEXI
  1462. DEF("no-quit", 0, QEMU_OPTION_no_quit,
  1463. "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
  1464. STEXI
  1465. @item -no-quit
  1466. @findex -no-quit
  1467. Disable SDL window close capability.
  1468. ETEXI
  1469. DEF("sdl", 0, QEMU_OPTION_sdl,
  1470. "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
  1471. STEXI
  1472. @item -sdl
  1473. @findex -sdl
  1474. Enable SDL.
  1475. ETEXI
  1476. DEF("spice", HAS_ARG, QEMU_OPTION_spice,
  1477. "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
  1478. " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
  1479. " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
  1480. " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
  1481. " [,tls-ciphers=<list>]\n"
  1482. " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
  1483. " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
  1484. " [,sasl][,password=<secret>][,disable-ticketing]\n"
  1485. " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
  1486. " [,jpeg-wan-compression=[auto|never|always]]\n"
  1487. " [,zlib-glz-wan-compression=[auto|never|always]]\n"
  1488. " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
  1489. " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
  1490. " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
  1491. " [,gl=[on|off]][,rendernode=<file>]\n"
  1492. " enable spice\n"
  1493. " at least one of {port, tls-port} is mandatory\n",
  1494. QEMU_ARCH_ALL)
  1495. STEXI
  1496. @item -spice @var{option}[,@var{option}[,...]]
  1497. @findex -spice
  1498. Enable the spice remote desktop protocol. Valid options are
  1499. @table @option
  1500. @item port=<nr>
  1501. Set the TCP port spice is listening on for plaintext channels.
  1502. @item addr=<addr>
  1503. Set the IP address spice is listening on. Default is any address.
  1504. @item ipv4
  1505. @itemx ipv6
  1506. @itemx unix
  1507. Force using the specified IP version.
  1508. @item password=<secret>
  1509. Set the password you need to authenticate.
  1510. @item sasl
  1511. Require that the client use SASL to authenticate with the spice.
  1512. The exact choice of authentication method used is controlled from the
  1513. system / user's SASL configuration file for the 'qemu' service. This
  1514. is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
  1515. unprivileged user, an environment variable SASL_CONF_PATH can be used
  1516. to make it search alternate locations for the service config.
  1517. While some SASL auth methods can also provide data encryption (eg GSSAPI),
  1518. it is recommended that SASL always be combined with the 'tls' and
  1519. 'x509' settings to enable use of SSL and server certificates. This
  1520. ensures a data encryption preventing compromise of authentication
  1521. credentials.
  1522. @item disable-ticketing
  1523. Allow client connects without authentication.
  1524. @item disable-copy-paste
  1525. Disable copy paste between the client and the guest.
  1526. @item disable-agent-file-xfer
  1527. Disable spice-vdagent based file-xfer between the client and the guest.
  1528. @item tls-port=<nr>
  1529. Set the TCP port spice is listening on for encrypted channels.
  1530. @item x509-dir=<dir>
  1531. Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
  1532. @item x509-key-file=<file>
  1533. @itemx x509-key-password=<file>
  1534. @itemx x509-cert-file=<file>
  1535. @itemx x509-cacert-file=<file>
  1536. @itemx x509-dh-key-file=<file>
  1537. The x509 file names can also be configured individually.
  1538. @item tls-ciphers=<list>
  1539. Specify which ciphers to use.
  1540. @item tls-channel=[main|display|cursor|inputs|record|playback]
  1541. @itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
  1542. Force specific channel to be used with or without TLS encryption. The
  1543. options can be specified multiple times to configure multiple
  1544. channels. The special name "default" can be used to set the default
  1545. mode. For channels which are not explicitly forced into one mode the
  1546. spice client is allowed to pick tls/plaintext as he pleases.
  1547. @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
  1548. Configure image compression (lossless).
  1549. Default is auto_glz.
  1550. @item jpeg-wan-compression=[auto|never|always]
  1551. @itemx zlib-glz-wan-compression=[auto|never|always]
  1552. Configure wan image compression (lossy for slow links).
  1553. Default is auto.
  1554. @item streaming-video=[off|all|filter]
  1555. Configure video stream detection. Default is off.
  1556. @item agent-mouse=[on|off]
  1557. Enable/disable passing mouse events via vdagent. Default is on.
  1558. @item playback-compression=[on|off]
  1559. Enable/disable audio stream compression (using celt 0.5.1). Default is on.
  1560. @item seamless-migration=[on|off]
  1561. Enable/disable spice seamless migration. Default is off.
  1562. @item gl=[on|off]
  1563. Enable/disable OpenGL context. Default is off.
  1564. @item rendernode=<file>
  1565. DRM render node for OpenGL rendering. If not specified, it will pick
  1566. the first available. (Since 2.9)
  1567. @end table
  1568. ETEXI
  1569. DEF("portrait", 0, QEMU_OPTION_portrait,
  1570. "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
  1571. QEMU_ARCH_ALL)
  1572. STEXI
  1573. @item -portrait
  1574. @findex -portrait
  1575. Rotate graphical output 90 deg left (only PXA LCD).
  1576. ETEXI
  1577. DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
  1578. "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
  1579. QEMU_ARCH_ALL)
  1580. STEXI
  1581. @item -rotate @var{deg}
  1582. @findex -rotate
  1583. Rotate graphical output some deg left (only PXA LCD).
  1584. ETEXI
  1585. DEF("vga", HAS_ARG, QEMU_OPTION_vga,
  1586. "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
  1587. " select video card type\n", QEMU_ARCH_ALL)
  1588. STEXI
  1589. @item -vga @var{type}
  1590. @findex -vga
  1591. Select type of VGA card to emulate. Valid values for @var{type} are
  1592. @table @option
  1593. @item cirrus
  1594. Cirrus Logic GD5446 Video card. All Windows versions starting from
  1595. Windows 95 should recognize and use this graphic card. For optimal
  1596. performances, use 16 bit color depth in the guest and the host OS.
  1597. (This card was the default before QEMU 2.2)
  1598. @item std
  1599. Standard VGA card with Bochs VBE extensions. If your guest OS
  1600. supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
  1601. to use high resolution modes (>= 1280x1024x16) then you should use
  1602. this option. (This card is the default since QEMU 2.2)
  1603. @item vmware
  1604. VMWare SVGA-II compatible adapter. Use it if you have sufficiently
  1605. recent XFree86/XOrg server or Windows guest with a driver for this
  1606. card.
  1607. @item qxl
  1608. QXL paravirtual graphic card. It is VGA compatible (including VESA
  1609. 2.0 VBE support). Works best with qxl guest drivers installed though.
  1610. Recommended choice when using the spice protocol.
  1611. @item tcx
  1612. (sun4m only) Sun TCX framebuffer. This is the default framebuffer for
  1613. sun4m machines and offers both 8-bit and 24-bit colour depths at a
  1614. fixed resolution of 1024x768.
  1615. @item cg3
  1616. (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
  1617. for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
  1618. resolutions aimed at people wishing to run older Solaris versions.
  1619. @item virtio
  1620. Virtio VGA card.
  1621. @item none
  1622. Disable VGA card.
  1623. @end table
  1624. ETEXI
  1625. DEF("full-screen", 0, QEMU_OPTION_full_screen,
  1626. "-full-screen start in full screen\n", QEMU_ARCH_ALL)
  1627. STEXI
  1628. @item -full-screen
  1629. @findex -full-screen
  1630. Start in full screen.
  1631. ETEXI
  1632. DEF("g", 1, QEMU_OPTION_g ,
  1633. "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
  1634. QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
  1635. STEXI
  1636. @item -g @var{width}x@var{height}[x@var{depth}]
  1637. @findex -g
  1638. Set the initial graphical resolution and depth (PPC, SPARC only).
  1639. ETEXI
  1640. DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
  1641. "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
  1642. STEXI
  1643. @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
  1644. @findex -vnc
  1645. Normally, if QEMU is compiled with graphical window support, it displays
  1646. output such as guest graphics, guest console, and the QEMU monitor in a
  1647. window. With this option, you can have QEMU listen on VNC display
  1648. @var{display} and redirect the VGA display over the VNC session. It is
  1649. very useful to enable the usb tablet device when using this option
  1650. (option @option{-device usb-tablet}). When using the VNC display, you
  1651. must use the @option{-k} parameter to set the keyboard layout if you are
  1652. not using en-us. Valid syntax for the @var{display} is
  1653. @table @option
  1654. @item to=@var{L}
  1655. With this option, QEMU will try next available VNC @var{display}s, until the
  1656. number @var{L}, if the origianlly defined "-vnc @var{display}" is not
  1657. available, e.g. port 5900+@var{display} is already used by another
  1658. application. By default, to=0.
  1659. @item @var{host}:@var{d}
  1660. TCP connections will only be allowed from @var{host} on display @var{d}.
  1661. By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
  1662. be omitted in which case the server will accept connections from any host.
  1663. @item unix:@var{path}
  1664. Connections will be allowed over UNIX domain sockets where @var{path} is the
  1665. location of a unix socket to listen for connections on.
  1666. @item none
  1667. VNC is initialized but not started. The monitor @code{change} command
  1668. can be used to later start the VNC server.
  1669. @end table
  1670. Following the @var{display} value there may be one or more @var{option} flags
  1671. separated by commas. Valid options are
  1672. @table @option
  1673. @item reverse
  1674. Connect to a listening VNC client via a ``reverse'' connection. The
  1675. client is specified by the @var{display}. For reverse network
  1676. connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
  1677. is a TCP port number, not a display number.
  1678. @item websocket
  1679. Opens an additional TCP listening port dedicated to VNC Websocket connections.
  1680. If a bare @var{websocket} option is given, the Websocket port is
  1681. 5700+@var{display}. An alternative port can be specified with the
  1682. syntax @code{websocket}=@var{port}.
  1683. If @var{host} is specified connections will only be allowed from this host.
  1684. It is possible to control the websocket listen address independently, using
  1685. the syntax @code{websocket}=@var{host}:@var{port}.
  1686. If no TLS credentials are provided, the websocket connection runs in
  1687. unencrypted mode. If TLS credentials are provided, the websocket connection
  1688. requires encrypted client connections.
  1689. @item password
  1690. Require that password based authentication is used for client connections.
  1691. The password must be set separately using the @code{set_password} command in
  1692. the @ref{pcsys_monitor}. The syntax to change your password is:
  1693. @code{set_password <protocol> <password>} where <protocol> could be either
  1694. "vnc" or "spice".
  1695. If you would like to change <protocol> password expiration, you should use
  1696. @code{expire_password <protocol> <expiration-time>} where expiration time could
  1697. be one of the following options: now, never, +seconds or UNIX time of
  1698. expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
  1699. to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
  1700. date and time).
  1701. You can also use keywords "now" or "never" for the expiration time to
  1702. allow <protocol> password to expire immediately or never expire.
  1703. @item tls-creds=@var{ID}
  1704. Provides the ID of a set of TLS credentials to use to secure the
  1705. VNC server. They will apply to both the normal VNC server socket
  1706. and the websocket socket (if enabled). Setting TLS credentials
  1707. will cause the VNC server socket to enable the VeNCrypt auth
  1708. mechanism. The credentials should have been previously created
  1709. using the @option{-object tls-creds} argument.
  1710. @item tls-authz=@var{ID}
  1711. Provides the ID of the QAuthZ authorization object against which
  1712. the client's x509 distinguished name will validated. This object is
  1713. only resolved at time of use, so can be deleted and recreated on the
  1714. fly while the VNC server is active. If missing, it will default
  1715. to denying access.
  1716. @item sasl
  1717. Require that the client use SASL to authenticate with the VNC server.
  1718. The exact choice of authentication method used is controlled from the
  1719. system / user's SASL configuration file for the 'qemu' service. This
  1720. is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
  1721. unprivileged user, an environment variable SASL_CONF_PATH can be used
  1722. to make it search alternate locations for the service config.
  1723. While some SASL auth methods can also provide data encryption (eg GSSAPI),
  1724. it is recommended that SASL always be combined with the 'tls' and
  1725. 'x509' settings to enable use of SSL and server certificates. This
  1726. ensures a data encryption preventing compromise of authentication
  1727. credentials. See the @ref{vnc_security} section for details on using
  1728. SASL authentication.
  1729. @item sasl-authz=@var{ID}
  1730. Provides the ID of the QAuthZ authorization object against which
  1731. the client's SASL username will validated. This object is
  1732. only resolved at time of use, so can be deleted and recreated on the
  1733. fly while the VNC server is active. If missing, it will default
  1734. to denying access.
  1735. @item acl
  1736. Legacy method for enabling authorization of clients against the
  1737. x509 distinguished name and SASL username. It results in the creation
  1738. of two @code{authz-list} objects with IDs of @code{vnc.username} and
  1739. @code{vnc.x509dname}. The rules for these objects must be configured
  1740. with the HMP ACL commands.
  1741. This option is deprecated and should no longer be used. The new
  1742. @option{sasl-authz} and @option{tls-authz} options are a
  1743. replacement.
  1744. @item lossy
  1745. Enable lossy compression methods (gradient, JPEG, ...). If this
  1746. option is set, VNC client may receive lossy framebuffer updates
  1747. depending on its encoding settings. Enabling this option can save
  1748. a lot of bandwidth at the expense of quality.
  1749. @item non-adaptive
  1750. Disable adaptive encodings. Adaptive encodings are enabled by default.
  1751. An adaptive encoding will try to detect frequently updated screen regions,
  1752. and send updates in these regions using a lossy encoding (like JPEG).
  1753. This can be really helpful to save bandwidth when playing videos. Disabling
  1754. adaptive encodings restores the original static behavior of encodings
  1755. like Tight.
  1756. @item share=[allow-exclusive|force-shared|ignore]
  1757. Set display sharing policy. 'allow-exclusive' allows clients to ask
  1758. for exclusive access. As suggested by the rfb spec this is
  1759. implemented by dropping other connections. Connecting multiple
  1760. clients in parallel requires all clients asking for a shared session
  1761. (vncviewer: -shared switch). This is the default. 'force-shared'
  1762. disables exclusive client access. Useful for shared desktop sessions,
  1763. where you don't want someone forgetting specify -shared disconnect
  1764. everybody else. 'ignore' completely ignores the shared flag and
  1765. allows everybody connect unconditionally. Doesn't conform to the rfb
  1766. spec but is traditional QEMU behavior.
  1767. @item key-delay-ms
  1768. Set keyboard delay, for key down and key up events, in milliseconds.
  1769. Default is 10. Keyboards are low-bandwidth devices, so this slowdown
  1770. can help the device and guest to keep up and not lose events in case
  1771. events are arriving in bulk. Possible causes for the latter are flaky
  1772. network connections, or scripts for automated testing.
  1773. @item audiodev=@var{audiodev}
  1774. Use the specified @var{audiodev} when the VNC client requests audio
  1775. transmission. When not using an -audiodev argument, this option must
  1776. be omitted, otherwise is must be present and specify a valid audiodev.
  1777. @end table
  1778. ETEXI
  1779. STEXI
  1780. @end table
  1781. ETEXI
  1782. ARCHHEADING(, QEMU_ARCH_I386)
  1783. ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
  1784. STEXI
  1785. @table @option
  1786. ETEXI
  1787. DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
  1788. "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
  1789. QEMU_ARCH_I386)
  1790. STEXI
  1791. @item -win2k-hack
  1792. @findex -win2k-hack
  1793. Use it when installing Windows 2000 to avoid a disk full bug. After
  1794. Windows 2000 is installed, you no longer need this option (this option
  1795. slows down the IDE transfers).
  1796. ETEXI
  1797. DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
  1798. "-no-fd-bootchk disable boot signature checking for floppy disks\n",
  1799. QEMU_ARCH_I386)
  1800. STEXI
  1801. @item -no-fd-bootchk
  1802. @findex -no-fd-bootchk
  1803. Disable boot signature checking for floppy disks in BIOS. May
  1804. be needed to boot from old floppy disks.
  1805. ETEXI
  1806. DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
  1807. "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1808. STEXI
  1809. @item -no-acpi
  1810. @findex -no-acpi
  1811. Disable ACPI (Advanced Configuration and Power Interface) support. Use
  1812. it if your guest OS complains about ACPI problems (PC target machine
  1813. only).
  1814. ETEXI
  1815. DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
  1816. "-no-hpet disable HPET\n", QEMU_ARCH_I386)
  1817. STEXI
  1818. @item -no-hpet
  1819. @findex -no-hpet
  1820. Disable HPET support.
  1821. ETEXI
  1822. DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
  1823. "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
  1824. " ACPI table description\n", QEMU_ARCH_I386)
  1825. STEXI
  1826. @item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...]
  1827. @findex -acpitable
  1828. Add ACPI table with specified header fields and context from specified files.
  1829. For file=, take whole ACPI table from the specified files, including all
  1830. ACPI headers (possible overridden by other options).
  1831. For data=, only data
  1832. portion of the table is used, all header information is specified in the
  1833. command line.
  1834. If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
  1835. fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
  1836. to ensure the field matches required by the Microsoft SLIC spec and the ACPI
  1837. spec.
  1838. ETEXI
  1839. DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
  1840. "-smbios file=binary\n"
  1841. " load SMBIOS entry from binary file\n"
  1842. "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
  1843. " [,uefi=on|off]\n"
  1844. " specify SMBIOS type 0 fields\n"
  1845. "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1846. " [,uuid=uuid][,sku=str][,family=str]\n"
  1847. " specify SMBIOS type 1 fields\n"
  1848. "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1849. " [,asset=str][,location=str]\n"
  1850. " specify SMBIOS type 2 fields\n"
  1851. "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
  1852. " [,sku=str]\n"
  1853. " specify SMBIOS type 3 fields\n"
  1854. "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
  1855. " [,asset=str][,part=str]\n"
  1856. " specify SMBIOS type 4 fields\n"
  1857. "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
  1858. " [,asset=str][,part=str][,speed=%d]\n"
  1859. " specify SMBIOS type 17 fields\n",
  1860. QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1861. STEXI
  1862. @item -smbios file=@var{binary}
  1863. @findex -smbios
  1864. Load SMBIOS entry from binary file.
  1865. @item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
  1866. Specify SMBIOS type 0 fields
  1867. @item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}]
  1868. Specify SMBIOS type 1 fields
  1869. @item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}]
  1870. Specify SMBIOS type 2 fields
  1871. @item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
  1872. Specify SMBIOS type 3 fields
  1873. @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
  1874. Specify SMBIOS type 4 fields
  1875. @item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}]
  1876. Specify SMBIOS type 17 fields
  1877. ETEXI
  1878. STEXI
  1879. @end table
  1880. ETEXI
  1881. DEFHEADING()
  1882. DEFHEADING(Network options:)
  1883. STEXI
  1884. @table @option
  1885. ETEXI
  1886. DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
  1887. #ifdef CONFIG_SLIRP
  1888. "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
  1889. " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
  1890. " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
  1891. " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
  1892. " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
  1893. #ifndef _WIN32
  1894. "[,smb=dir[,smbserver=addr]]\n"
  1895. #endif
  1896. " configure a user mode network backend with ID 'str',\n"
  1897. " its DHCP server and optional services\n"
  1898. #endif
  1899. #ifdef _WIN32
  1900. "-netdev tap,id=str,ifname=name\n"
  1901. " configure a host TAP network backend with ID 'str'\n"
  1902. #else
  1903. "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
  1904. " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
  1905. " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
  1906. " [,poll-us=n]\n"
  1907. " configure a host TAP network backend with ID 'str'\n"
  1908. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1909. " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
  1910. " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
  1911. " to deconfigure it\n"
  1912. " use '[down]script=no' to disable script execution\n"
  1913. " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
  1914. " configure it\n"
  1915. " use 'fd=h' to connect to an already opened TAP interface\n"
  1916. " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
  1917. " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
  1918. " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
  1919. " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
  1920. " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
  1921. " use vhost=on to enable experimental in kernel accelerator\n"
  1922. " (only has effect for virtio guests which use MSIX)\n"
  1923. " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
  1924. " use 'vhostfd=h' to connect to an already opened vhost net device\n"
  1925. " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
  1926. " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
  1927. " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
  1928. " spent on busy polling for vhost net\n"
  1929. "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
  1930. " configure a host TAP network backend with ID 'str' that is\n"
  1931. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1932. " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
  1933. #endif
  1934. #ifdef __linux__
  1935. "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
  1936. " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
  1937. " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
  1938. " [,rxcookie=rxcookie][,offset=offset]\n"
  1939. " configure a network backend with ID 'str' connected to\n"
  1940. " an Ethernet over L2TPv3 pseudowire.\n"
  1941. " Linux kernel 3.3+ as well as most routers can talk\n"
  1942. " L2TPv3. This transport allows connecting a VM to a VM,\n"
  1943. " VM to a router and even VM to Host. It is a nearly-universal\n"
  1944. " standard (RFC3391). Note - this implementation uses static\n"
  1945. " pre-configured tunnels (same as the Linux kernel).\n"
  1946. " use 'src=' to specify source address\n"
  1947. " use 'dst=' to specify destination address\n"
  1948. " use 'udp=on' to specify udp encapsulation\n"
  1949. " use 'srcport=' to specify source udp port\n"
  1950. " use 'dstport=' to specify destination udp port\n"
  1951. " use 'ipv6=on' to force v6\n"
  1952. " L2TPv3 uses cookies to prevent misconfiguration as\n"
  1953. " well as a weak security measure\n"
  1954. " use 'rxcookie=0x012345678' to specify a rxcookie\n"
  1955. " use 'txcookie=0x012345678' to specify a txcookie\n"
  1956. " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
  1957. " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
  1958. " use 'pincounter=on' to work around broken counter handling in peer\n"
  1959. " use 'offset=X' to add an extra offset between header and data\n"
  1960. #endif
  1961. "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
  1962. " configure a network backend to connect to another network\n"
  1963. " using a socket connection\n"
  1964. "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
  1965. " configure a network backend to connect to a multicast maddr and port\n"
  1966. " use 'localaddr=addr' to specify the host address to send packets from\n"
  1967. "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
  1968. " configure a network backend to connect to another network\n"
  1969. " using an UDP tunnel\n"
  1970. #ifdef CONFIG_VDE
  1971. "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
  1972. " configure a network backend to connect to port 'n' of a vde switch\n"
  1973. " running on host and listening for incoming connections on 'socketpath'.\n"
  1974. " Use group 'groupname' and mode 'octalmode' to change default\n"
  1975. " ownership and permissions for communication port.\n"
  1976. #endif
  1977. #ifdef CONFIG_NETMAP
  1978. "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
  1979. " attach to the existing netmap-enabled network interface 'name', or to a\n"
  1980. " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
  1981. " netmap device, defaults to '/dev/netmap')\n"
  1982. #endif
  1983. #ifdef CONFIG_POSIX
  1984. "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
  1985. " configure a vhost-user network, backed by a chardev 'dev'\n"
  1986. #endif
  1987. "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
  1988. " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
  1989. DEF("nic", HAS_ARG, QEMU_OPTION_nic,
  1990. "-nic [tap|bridge|"
  1991. #ifdef CONFIG_SLIRP
  1992. "user|"
  1993. #endif
  1994. #ifdef __linux__
  1995. "l2tpv3|"
  1996. #endif
  1997. #ifdef CONFIG_VDE
  1998. "vde|"
  1999. #endif
  2000. #ifdef CONFIG_NETMAP
  2001. "netmap|"
  2002. #endif
  2003. #ifdef CONFIG_POSIX
  2004. "vhost-user|"
  2005. #endif
  2006. "socket][,option][,...][mac=macaddr]\n"
  2007. " initialize an on-board / default host NIC (using MAC address\n"
  2008. " macaddr) and connect it to the given host network backend\n"
  2009. "-nic none use it alone to have zero network devices (the default is to\n"
  2010. " provided a 'user' network connection)\n",
  2011. QEMU_ARCH_ALL)
  2012. DEF("net", HAS_ARG, QEMU_OPTION_net,
  2013. "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
  2014. " configure or create an on-board (or machine default) NIC and\n"
  2015. " connect it to hub 0 (please use -nic unless you need a hub)\n"
  2016. "-net ["
  2017. #ifdef CONFIG_SLIRP
  2018. "user|"
  2019. #endif
  2020. "tap|"
  2021. "bridge|"
  2022. #ifdef CONFIG_VDE
  2023. "vde|"
  2024. #endif
  2025. #ifdef CONFIG_NETMAP
  2026. "netmap|"
  2027. #endif
  2028. "socket][,option][,option][,...]\n"
  2029. " old way to initialize a host network interface\n"
  2030. " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
  2031. STEXI
  2032. @item -nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]
  2033. @findex -nic
  2034. This option is a shortcut for configuring both the on-board (default) guest
  2035. NIC hardware and the host network backend in one go. The host backend options
  2036. are the same as with the corresponding @option{-netdev} options below.
  2037. The guest NIC model can be set with @option{model=@var{modelname}}.
  2038. Use @option{model=help} to list the available device types.
  2039. The hardware MAC address can be set with @option{mac=@var{macaddr}}.
  2040. The following two example do exactly the same, to show how @option{-nic} can
  2041. be used to shorten the command line length (note that the e1000 is the default
  2042. on i386, so the @option{model=e1000} parameter could even be omitted here, too):
  2043. @example
  2044. @value{qemu_system} -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
  2045. @value{qemu_system} -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
  2046. @end example
  2047. @item -nic none
  2048. Indicate that no network devices should be configured. It is used to override
  2049. the default configuration (default NIC with ``user'' host network backend)
  2050. which is activated if no other networking options are provided.
  2051. @item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
  2052. @findex -netdev
  2053. Configure user mode host network backend which requires no administrator
  2054. privilege to run. Valid options are:
  2055. @table @option
  2056. @item id=@var{id}
  2057. Assign symbolic name for use in monitor commands.
  2058. @item ipv4=on|off and ipv6=on|off
  2059. Specify that either IPv4 or IPv6 must be enabled. If neither is specified
  2060. both protocols are enabled.
  2061. @item net=@var{addr}[/@var{mask}]
  2062. Set IP network address the guest will see. Optionally specify the netmask,
  2063. either in the form a.b.c.d or as number of valid top-most bits. Default is
  2064. 10.0.2.0/24.
  2065. @item host=@var{addr}
  2066. Specify the guest-visible address of the host. Default is the 2nd IP in the
  2067. guest network, i.e. x.x.x.2.
  2068. @item ipv6-net=@var{addr}[/@var{int}]
  2069. Set IPv6 network address the guest will see (default is fec0::/64). The
  2070. network prefix is given in the usual hexadecimal IPv6 address
  2071. notation. The prefix size is optional, and is given as the number of
  2072. valid top-most bits (default is 64).
  2073. @item ipv6-host=@var{addr}
  2074. Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
  2075. the guest network, i.e. xxxx::2.
  2076. @item restrict=on|off
  2077. If this option is enabled, the guest will be isolated, i.e. it will not be
  2078. able to contact the host and no guest IP packets will be routed over the host
  2079. to the outside. This option does not affect any explicitly set forwarding rules.
  2080. @item hostname=@var{name}
  2081. Specifies the client hostname reported by the built-in DHCP server.
  2082. @item dhcpstart=@var{addr}
  2083. Specify the first of the 16 IPs the built-in DHCP server can assign. Default
  2084. is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
  2085. @item dns=@var{addr}
  2086. Specify the guest-visible address of the virtual nameserver. The address must
  2087. be different from the host address. Default is the 3rd IP in the guest network,
  2088. i.e. x.x.x.3.
  2089. @item ipv6-dns=@var{addr}
  2090. Specify the guest-visible address of the IPv6 virtual nameserver. The address
  2091. must be different from the host address. Default is the 3rd IP in the guest
  2092. network, i.e. xxxx::3.
  2093. @item dnssearch=@var{domain}
  2094. Provides an entry for the domain-search list sent by the built-in
  2095. DHCP server. More than one domain suffix can be transmitted by specifying
  2096. this option multiple times. If supported, this will cause the guest to
  2097. automatically try to append the given domain suffix(es) in case a domain name
  2098. can not be resolved.
  2099. Example:
  2100. @example
  2101. @value{qemu_system} -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
  2102. @end example
  2103. @item domainname=@var{domain}
  2104. Specifies the client domain name reported by the built-in DHCP server.
  2105. @item tftp=@var{dir}
  2106. When using the user mode network stack, activate a built-in TFTP
  2107. server. The files in @var{dir} will be exposed as the root of a TFTP server.
  2108. The TFTP client on the guest must be configured in binary mode (use the command
  2109. @code{bin} of the Unix TFTP client).
  2110. @item tftp-server-name=@var{name}
  2111. In BOOTP reply, broadcast @var{name} as the "TFTP server name" (RFC2132 option
  2112. 66). This can be used to advise the guest to load boot files or configurations
  2113. from a different server than the host address.
  2114. @item bootfile=@var{file}
  2115. When using the user mode network stack, broadcast @var{file} as the BOOTP
  2116. filename. In conjunction with @option{tftp}, this can be used to network boot
  2117. a guest from a local directory.
  2118. Example (using pxelinux):
  2119. @example
  2120. @value{qemu_system} -hda linux.img -boot n -device e1000,netdev=n1 \
  2121. -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
  2122. @end example
  2123. @item smb=@var{dir}[,smbserver=@var{addr}]
  2124. When using the user mode network stack, activate a built-in SMB
  2125. server so that Windows OSes can access to the host files in @file{@var{dir}}
  2126. transparently. The IP address of the SMB server can be set to @var{addr}. By
  2127. default the 4th IP in the guest network is used, i.e. x.x.x.4.
  2128. In the guest Windows OS, the line:
  2129. @example
  2130. 10.0.2.4 smbserver
  2131. @end example
  2132. must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
  2133. or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
  2134. Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
  2135. Note that a SAMBA server must be installed on the host OS.
  2136. @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
  2137. Redirect incoming TCP or UDP connections to the host port @var{hostport} to
  2138. the guest IP address @var{guestaddr} on guest port @var{guestport}. If
  2139. @var{guestaddr} is not specified, its value is x.x.x.15 (default first address
  2140. given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
  2141. be bound to a specific host interface. If no connection type is set, TCP is
  2142. used. This option can be given multiple times.
  2143. For example, to redirect host X11 connection from screen 1 to guest
  2144. screen 0, use the following:
  2145. @example
  2146. # on the host
  2147. @value{qemu_system} -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
  2148. # this host xterm should open in the guest X11 server
  2149. xterm -display :1
  2150. @end example
  2151. To redirect telnet connections from host port 5555 to telnet port on
  2152. the guest, use the following:
  2153. @example
  2154. # on the host
  2155. @value{qemu_system} -nic user,hostfwd=tcp::5555-:23
  2156. telnet localhost 5555
  2157. @end example
  2158. Then when you use on the host @code{telnet localhost 5555}, you
  2159. connect to the guest telnet server.
  2160. @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
  2161. @itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
  2162. Forward guest TCP connections to the IP address @var{server} on port @var{port}
  2163. to the character device @var{dev} or to a program executed by @var{cmd:command}
  2164. which gets spawned for each connection. This option can be given multiple times.
  2165. You can either use a chardev directly and have that one used throughout QEMU's
  2166. lifetime, like in the following example:
  2167. @example
  2168. # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
  2169. # the guest accesses it
  2170. @value{qemu_system} -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
  2171. @end example
  2172. Or you can execute a command on every TCP connection established by the guest,
  2173. so that QEMU behaves similar to an inetd process for that virtual server:
  2174. @example
  2175. # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
  2176. # and connect the TCP stream to its stdin/stdout
  2177. @value{qemu_system} -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
  2178. @end example
  2179. @end table
  2180. @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
  2181. Configure a host TAP network backend with ID @var{id}.
  2182. Use the network script @var{file} to configure it and the network script
  2183. @var{dfile} to deconfigure it. If @var{name} is not provided, the OS
  2184. automatically provides one. The default network configure script is
  2185. @file{/etc/qemu-ifup} and the default network deconfigure script is
  2186. @file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
  2187. to disable script execution.
  2188. If running QEMU as an unprivileged user, use the network helper
  2189. @var{helper} to configure the TAP interface and attach it to the bridge.
  2190. The default network helper executable is @file{/path/to/qemu-bridge-helper}
  2191. and the default bridge device is @file{br0}.
  2192. @option{fd}=@var{h} can be used to specify the handle of an already
  2193. opened host TAP interface.
  2194. Examples:
  2195. @example
  2196. #launch a QEMU instance with the default network script
  2197. @value{qemu_system} linux.img -nic tap
  2198. @end example
  2199. @example
  2200. #launch a QEMU instance with two NICs, each one connected
  2201. #to a TAP device
  2202. @value{qemu_system} linux.img \
  2203. -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \
  2204. -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
  2205. @end example
  2206. @example
  2207. #launch a QEMU instance with the default network helper to
  2208. #connect a TAP device to bridge br0
  2209. @value{qemu_system} linux.img -device virtio-net-pci,netdev=n1 \
  2210. -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
  2211. @end example
  2212. @item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
  2213. Connect a host TAP network interface to a host bridge device.
  2214. Use the network helper @var{helper} to configure the TAP interface and
  2215. attach it to the bridge. The default network helper executable is
  2216. @file{/path/to/qemu-bridge-helper} and the default bridge
  2217. device is @file{br0}.
  2218. Examples:
  2219. @example
  2220. #launch a QEMU instance with the default network helper to
  2221. #connect a TAP device to bridge br0
  2222. @value{qemu_system} linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
  2223. @end example
  2224. @example
  2225. #launch a QEMU instance with the default network helper to
  2226. #connect a TAP device to bridge qemubr0
  2227. @value{qemu_system} linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
  2228. @end example
  2229. @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
  2230. This host network backend can be used to connect the guest's network to
  2231. another QEMU virtual machine using a TCP socket connection. If @option{listen}
  2232. is specified, QEMU waits for incoming connections on @var{port}
  2233. (@var{host} is optional). @option{connect} is used to connect to
  2234. another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
  2235. specifies an already opened TCP socket.
  2236. Example:
  2237. @example
  2238. # launch a first QEMU instance
  2239. @value{qemu_system} linux.img \
  2240. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2241. -netdev socket,id=n1,listen=:1234
  2242. # connect the network of this instance to the network of the first instance
  2243. @value{qemu_system} linux.img \
  2244. -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
  2245. -netdev socket,id=n2,connect=127.0.0.1:1234
  2246. @end example
  2247. @item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
  2248. Configure a socket host network backend to share the guest's network traffic
  2249. with another QEMU virtual machines using a UDP multicast socket, effectively
  2250. making a bus for every QEMU with same multicast address @var{maddr} and @var{port}.
  2251. NOTES:
  2252. @enumerate
  2253. @item
  2254. Several QEMU can be running on different hosts and share same bus (assuming
  2255. correct multicast setup for these hosts).
  2256. @item
  2257. mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
  2258. @url{http://user-mode-linux.sf.net}.
  2259. @item
  2260. Use @option{fd=h} to specify an already opened UDP multicast socket.
  2261. @end enumerate
  2262. Example:
  2263. @example
  2264. # launch one QEMU instance
  2265. @value{qemu_system} linux.img \
  2266. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2267. -netdev socket,id=n1,mcast=230.0.0.1:1234
  2268. # launch another QEMU instance on same "bus"
  2269. @value{qemu_system} linux.img \
  2270. -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
  2271. -netdev socket,id=n2,mcast=230.0.0.1:1234
  2272. # launch yet another QEMU instance on same "bus"
  2273. @value{qemu_system} linux.img \
  2274. -device e1000,netdev=n3,mac=52:54:00:12:34:58 \
  2275. -netdev socket,id=n3,mcast=230.0.0.1:1234
  2276. @end example
  2277. Example (User Mode Linux compat.):
  2278. @example
  2279. # launch QEMU instance (note mcast address selected is UML's default)
  2280. @value{qemu_system} linux.img \
  2281. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2282. -netdev socket,id=n1,mcast=239.192.168.1:1102
  2283. # launch UML
  2284. /path/to/linux ubd0=/path/to/root_fs eth0=mcast
  2285. @end example
  2286. Example (send packets from host's 1.2.3.4):
  2287. @example
  2288. @value{qemu_system} linux.img \
  2289. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2290. -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
  2291. @end example
  2292. @item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
  2293. Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3391) is a
  2294. popular protocol to transport Ethernet (and other Layer 2) data frames between
  2295. two systems. It is present in routers, firewalls and the Linux kernel
  2296. (from version 3.3 onwards).
  2297. This transport allows a VM to communicate to another VM, router or firewall directly.
  2298. @table @option
  2299. @item src=@var{srcaddr}
  2300. source address (mandatory)
  2301. @item dst=@var{dstaddr}
  2302. destination address (mandatory)
  2303. @item udp
  2304. select udp encapsulation (default is ip).
  2305. @item srcport=@var{srcport}
  2306. source udp port.
  2307. @item dstport=@var{dstport}
  2308. destination udp port.
  2309. @item ipv6
  2310. force v6, otherwise defaults to v4.
  2311. @item rxcookie=@var{rxcookie}
  2312. @itemx txcookie=@var{txcookie}
  2313. Cookies are a weak form of security in the l2tpv3 specification.
  2314. Their function is mostly to prevent misconfiguration. By default they are 32
  2315. bit.
  2316. @item cookie64
  2317. Set cookie size to 64 bit instead of the default 32
  2318. @item counter=off
  2319. Force a 'cut-down' L2TPv3 with no counter as in
  2320. draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
  2321. @item pincounter=on
  2322. Work around broken counter handling in peer. This may also help on
  2323. networks which have packet reorder.
  2324. @item offset=@var{offset}
  2325. Add an extra offset between header and data
  2326. @end table
  2327. For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
  2328. on the remote Linux host 1.2.3.4:
  2329. @example
  2330. # Setup tunnel on linux host using raw ip as encapsulation
  2331. # on 1.2.3.4
  2332. ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
  2333. encap udp udp_sport 16384 udp_dport 16384
  2334. ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
  2335. 0xFFFFFFFF peer_session_id 0xFFFFFFFF
  2336. ifconfig vmtunnel0 mtu 1500
  2337. ifconfig vmtunnel0 up
  2338. brctl addif br-lan vmtunnel0
  2339. # on 4.3.2.1
  2340. # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
  2341. @value{qemu_system} linux.img -device e1000,netdev=n1 \
  2342. -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
  2343. @end example
  2344. @item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
  2345. Configure VDE backend to connect to PORT @var{n} of a vde switch running on host and
  2346. listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
  2347. and MODE @var{octalmode} to change default ownership and permissions for
  2348. communication port. This option is only available if QEMU has been compiled
  2349. with vde support enabled.
  2350. Example:
  2351. @example
  2352. # launch vde switch
  2353. vde_switch -F -sock /tmp/myswitch
  2354. # launch QEMU instance
  2355. @value{qemu_system} linux.img -nic vde,sock=/tmp/myswitch
  2356. @end example
  2357. @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
  2358. Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
  2359. be a unix domain socket backed one. The vhost-user uses a specifically defined
  2360. protocol to pass vhost ioctl replacement messages to an application on the other
  2361. end of the socket. On non-MSIX guests, the feature can be forced with
  2362. @var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
  2363. be created for multiqueue vhost-user.
  2364. Example:
  2365. @example
  2366. qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
  2367. -numa node,memdev=mem \
  2368. -chardev socket,id=chr0,path=/path/to/socket \
  2369. -netdev type=vhost-user,id=net0,chardev=chr0 \
  2370. -device virtio-net-pci,netdev=net0
  2371. @end example
  2372. @item -netdev hubport,id=@var{id},hubid=@var{hubid}[,netdev=@var{nd}]
  2373. Create a hub port on the emulated hub with ID @var{hubid}.
  2374. The hubport netdev lets you connect a NIC to a QEMU emulated hub instead of a
  2375. single netdev. Alternatively, you can also connect the hubport to another
  2376. netdev with ID @var{nd} by using the @option{netdev=@var{nd}} option.
  2377. @item -net nic[,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
  2378. @findex -net
  2379. Legacy option to configure or create an on-board (or machine default) Network
  2380. Interface Card(NIC) and connect it either to the emulated hub with ID 0 (i.e.
  2381. the default hub), or to the netdev @var{nd}.
  2382. The NIC is an e1000 by default on the PC target. Optionally, the MAC address
  2383. can be changed to @var{mac}, the device address set to @var{addr} (PCI cards
  2384. only), and a @var{name} can be assigned for use in monitor commands.
  2385. Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
  2386. that the card should have; this option currently only affects virtio cards; set
  2387. @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
  2388. NIC is created. QEMU can emulate several different models of network card.
  2389. Use @code{-net nic,model=help} for a list of available devices for your target.
  2390. @item -net user|tap|bridge|socket|l2tpv3|vde[,...][,name=@var{name}]
  2391. Configure a host network backend (with the options corresponding to the same
  2392. @option{-netdev} option) and connect it to the emulated hub 0 (the default
  2393. hub). Use @var{name} to specify the name of the hub port.
  2394. ETEXI
  2395. STEXI
  2396. @end table
  2397. ETEXI
  2398. DEFHEADING()
  2399. DEFHEADING(Character device options:)
  2400. DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
  2401. "-chardev help\n"
  2402. "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2403. "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
  2404. " [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n"
  2405. " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
  2406. "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n"
  2407. " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
  2408. "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
  2409. " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
  2410. " [,logfile=PATH][,logappend=on|off]\n"
  2411. "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2412. "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
  2413. " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2414. "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
  2415. "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2416. "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2417. #ifdef _WIN32
  2418. "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2419. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2420. #else
  2421. "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2422. "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
  2423. #endif
  2424. #ifdef CONFIG_BRLAPI
  2425. "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2426. #endif
  2427. #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
  2428. || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
  2429. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2430. "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2431. #endif
  2432. #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
  2433. "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2434. "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2435. #endif
  2436. #if defined(CONFIG_SPICE)
  2437. "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  2438. "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  2439. #endif
  2440. , QEMU_ARCH_ALL
  2441. )
  2442. STEXI
  2443. The general form of a character device option is:
  2444. @table @option
  2445. @item -chardev @var{backend},id=@var{id}[,mux=on|off][,@var{options}]
  2446. @findex -chardev
  2447. Backend is one of:
  2448. @option{null},
  2449. @option{socket},
  2450. @option{udp},
  2451. @option{msmouse},
  2452. @option{vc},
  2453. @option{ringbuf},
  2454. @option{file},
  2455. @option{pipe},
  2456. @option{console},
  2457. @option{serial},
  2458. @option{pty},
  2459. @option{stdio},
  2460. @option{braille},
  2461. @option{tty},
  2462. @option{parallel},
  2463. @option{parport},
  2464. @option{spicevmc},
  2465. @option{spiceport}.
  2466. The specific backend will determine the applicable options.
  2467. Use @code{-chardev help} to print all available chardev backend types.
  2468. All devices must have an id, which can be any string up to 127 characters long.
  2469. It is used to uniquely identify this device in other command line directives.
  2470. A character device may be used in multiplexing mode by multiple front-ends.
  2471. Specify @option{mux=on} to enable this mode.
  2472. A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
  2473. backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
  2474. If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
  2475. create a multiplexer with your specified ID, and you can then configure multiple
  2476. front ends to use that chardev ID for their input/output. Up to four different
  2477. front ends can be connected to a single multiplexed chardev. (Without
  2478. multiplexing enabled, a chardev can only be used by a single front end.)
  2479. For instance you could use this to allow a single stdio chardev to be used by
  2480. two serial ports and the QEMU monitor:
  2481. @example
  2482. -chardev stdio,mux=on,id=char0 \
  2483. -mon chardev=char0,mode=readline \
  2484. -serial chardev:char0 \
  2485. -serial chardev:char0
  2486. @end example
  2487. You can have more than one multiplexer in a system configuration; for instance
  2488. you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
  2489. multiplexed between the QEMU monitor and a parallel port:
  2490. @example
  2491. -chardev stdio,mux=on,id=char0 \
  2492. -mon chardev=char0,mode=readline \
  2493. -parallel chardev:char0 \
  2494. -chardev tcp,...,mux=on,id=char1 \
  2495. -serial chardev:char1 \
  2496. -serial chardev:char1
  2497. @end example
  2498. When you're using a multiplexed character device, some escape sequences are
  2499. interpreted in the input. @xref{mux_keys, Keys in the character backend
  2500. multiplexer}.
  2501. Note that some other command line options may implicitly create multiplexed
  2502. character backends; for instance @option{-serial mon:stdio} creates a
  2503. multiplexed stdio backend connected to the serial port and the QEMU monitor,
  2504. and @option{-nographic} also multiplexes the console and the monitor to
  2505. stdio.
  2506. There is currently no support for multiplexing in the other direction
  2507. (where a single QEMU front end takes input and output from multiple chardevs).
  2508. Every backend supports the @option{logfile} option, which supplies the path
  2509. to a file to record all data transmitted via the backend. The @option{logappend}
  2510. option controls whether the log file will be truncated or appended to when
  2511. opened.
  2512. @end table
  2513. The available backends are:
  2514. @table @option
  2515. @item -chardev null,id=@var{id}
  2516. A void device. This device will not emit any data, and will drop any data it
  2517. receives. The null backend does not take any options.
  2518. @item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,websocket][,reconnect=@var{seconds}][,tls-creds=@var{id}][,tls-authz=@var{id}]
  2519. Create a two-way stream socket, which can be either a TCP or a unix socket. A
  2520. unix socket will be created if @option{path} is specified. Behaviour is
  2521. undefined if TCP options are specified for a unix socket.
  2522. @option{server} specifies that the socket shall be a listening socket.
  2523. @option{nowait} specifies that QEMU should not block waiting for a client to
  2524. connect to a listening socket.
  2525. @option{telnet} specifies that traffic on the socket should interpret telnet
  2526. escape sequences.
  2527. @option{websocket} specifies that the socket uses WebSocket protocol for
  2528. communication.
  2529. @option{reconnect} sets the timeout for reconnecting on non-server sockets when
  2530. the remote end goes away. qemu will delay this many seconds and then attempt
  2531. to reconnect. Zero disables reconnecting, and is the default.
  2532. @option{tls-creds} requests enablement of the TLS protocol for encryption,
  2533. and specifies the id of the TLS credentials to use for the handshake. The
  2534. credentials must be previously created with the @option{-object tls-creds}
  2535. argument.
  2536. @option{tls-auth} provides the ID of the QAuthZ authorization object against
  2537. which the client's x509 distinguished name will be validated. This object is
  2538. only resolved at time of use, so can be deleted and recreated on the fly
  2539. while the chardev server is active. If missing, it will default to denying
  2540. access.
  2541. TCP and unix socket options are given below:
  2542. @table @option
  2543. @item TCP options: port=@var{port}[,host=@var{host}][,to=@var{to}][,ipv4][,ipv6][,nodelay]
  2544. @option{host} for a listening socket specifies the local address to be bound.
  2545. For a connecting socket species the remote host to connect to. @option{host} is
  2546. optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
  2547. @option{port} for a listening socket specifies the local port to be bound. For a
  2548. connecting socket specifies the port on the remote host to connect to.
  2549. @option{port} can be given as either a port number or a service name.
  2550. @option{port} is required.
  2551. @option{to} is only relevant to listening sockets. If it is specified, and
  2552. @option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
  2553. to and including @option{to} until it succeeds. @option{to} must be specified
  2554. as a port number.
  2555. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
  2556. If neither is specified the socket may use either protocol.
  2557. @option{nodelay} disables the Nagle algorithm.
  2558. @item unix options: path=@var{path}
  2559. @option{path} specifies the local path of the unix socket. @option{path} is
  2560. required.
  2561. @end table
  2562. @item -chardev udp,id=@var{id}[,host=@var{host}],port=@var{port}[,localaddr=@var{localaddr}][,localport=@var{localport}][,ipv4][,ipv6]
  2563. Sends all traffic from the guest to a remote host over UDP.
  2564. @option{host} specifies the remote host to connect to. If not specified it
  2565. defaults to @code{localhost}.
  2566. @option{port} specifies the port on the remote host to connect to. @option{port}
  2567. is required.
  2568. @option{localaddr} specifies the local address to bind to. If not specified it
  2569. defaults to @code{0.0.0.0}.
  2570. @option{localport} specifies the local port to bind to. If not specified any
  2571. available local port will be used.
  2572. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
  2573. If neither is specified the device may use either protocol.
  2574. @item -chardev msmouse,id=@var{id}
  2575. Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
  2576. take any options.
  2577. @item -chardev vc,id=@var{id}[[,width=@var{width}][,height=@var{height}]][[,cols=@var{cols}][,rows=@var{rows}]]
  2578. Connect to a QEMU text console. @option{vc} may optionally be given a specific
  2579. size.
  2580. @option{width} and @option{height} specify the width and height respectively of
  2581. the console, in pixels.
  2582. @option{cols} and @option{rows} specify that the console be sized to fit a text
  2583. console with the given dimensions.
  2584. @item -chardev ringbuf,id=@var{id}[,size=@var{size}]
  2585. Create a ring buffer with fixed size @option{size}.
  2586. @var{size} must be a power of two and defaults to @code{64K}.
  2587. @item -chardev file,id=@var{id},path=@var{path}
  2588. Log all traffic received from the guest to a file.
  2589. @option{path} specifies the path of the file to be opened. This file will be
  2590. created if it does not already exist, and overwritten if it does. @option{path}
  2591. is required.
  2592. @item -chardev pipe,id=@var{id},path=@var{path}
  2593. Create a two-way connection to the guest. The behaviour differs slightly between
  2594. Windows hosts and other hosts:
  2595. On Windows, a single duplex pipe will be created at
  2596. @file{\\.pipe\@option{path}}.
  2597. On other hosts, 2 pipes will be created called @file{@option{path}.in} and
  2598. @file{@option{path}.out}. Data written to @file{@option{path}.in} will be
  2599. received by the guest. Data written by the guest can be read from
  2600. @file{@option{path}.out}. QEMU will not create these fifos, and requires them to
  2601. be present.
  2602. @option{path} forms part of the pipe path as described above. @option{path} is
  2603. required.
  2604. @item -chardev console,id=@var{id}
  2605. Send traffic from the guest to QEMU's standard output. @option{console} does not
  2606. take any options.
  2607. @option{console} is only available on Windows hosts.
  2608. @item -chardev serial,id=@var{id},path=@option{path}
  2609. Send traffic from the guest to a serial device on the host.
  2610. On Unix hosts serial will actually accept any tty device,
  2611. not only serial lines.
  2612. @option{path} specifies the name of the serial device to open.
  2613. @item -chardev pty,id=@var{id}
  2614. Create a new pseudo-terminal on the host and connect to it. @option{pty} does
  2615. not take any options.
  2616. @option{pty} is not available on Windows hosts.
  2617. @item -chardev stdio,id=@var{id}[,signal=on|off]
  2618. Connect to standard input and standard output of the QEMU process.
  2619. @option{signal} controls if signals are enabled on the terminal, that includes
  2620. exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
  2621. default, use @option{signal=off} to disable it.
  2622. @item -chardev braille,id=@var{id}
  2623. Connect to a local BrlAPI server. @option{braille} does not take any options.
  2624. @item -chardev tty,id=@var{id},path=@var{path}
  2625. @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
  2626. DragonFlyBSD hosts. It is an alias for @option{serial}.
  2627. @option{path} specifies the path to the tty. @option{path} is required.
  2628. @item -chardev parallel,id=@var{id},path=@var{path}
  2629. @itemx -chardev parport,id=@var{id},path=@var{path}
  2630. @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
  2631. Connect to a local parallel port.
  2632. @option{path} specifies the path to the parallel port device. @option{path} is
  2633. required.
  2634. @item -chardev spicevmc,id=@var{id},debug=@var{debug},name=@var{name}
  2635. @option{spicevmc} is only available when spice support is built in.
  2636. @option{debug} debug level for spicevmc
  2637. @option{name} name of spice channel to connect to
  2638. Connect to a spice virtual machine channel, such as vdiport.
  2639. @item -chardev spiceport,id=@var{id},debug=@var{debug},name=@var{name}
  2640. @option{spiceport} is only available when spice support is built in.
  2641. @option{debug} debug level for spicevmc
  2642. @option{name} name of spice port to connect to
  2643. Connect to a spice port, allowing a Spice client to handle the traffic
  2644. identified by a name (preferably a fqdn).
  2645. ETEXI
  2646. STEXI
  2647. @end table
  2648. ETEXI
  2649. DEFHEADING()
  2650. DEFHEADING(Bluetooth(R) options:)
  2651. STEXI
  2652. @table @option
  2653. ETEXI
  2654. DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
  2655. "-bt hci,null dumb bluetooth HCI - doesn't respond to commands\n" \
  2656. "-bt hci,host[:id]\n" \
  2657. " use host's HCI with the given name\n" \
  2658. "-bt hci[,vlan=n]\n" \
  2659. " emulate a standard HCI in virtual scatternet 'n'\n" \
  2660. "-bt vhci[,vlan=n]\n" \
  2661. " add host computer to virtual scatternet 'n' using VHCI\n" \
  2662. "-bt device:dev[,vlan=n]\n" \
  2663. " emulate a bluetooth device 'dev' in scatternet 'n'\n",
  2664. QEMU_ARCH_ALL)
  2665. STEXI
  2666. @item -bt hci[...]
  2667. @findex -bt
  2668. Defines the function of the corresponding Bluetooth HCI. -bt options
  2669. are matched with the HCIs present in the chosen machine type. For
  2670. example when emulating a machine with only one HCI built into it, only
  2671. the first @code{-bt hci[...]} option is valid and defines the HCI's
  2672. logic. The Transport Layer is decided by the machine type. Currently
  2673. the machines @code{n800} and @code{n810} have one HCI and all other
  2674. machines have none.
  2675. Note: This option and the whole bluetooth subsystem is considered as deprecated.
  2676. If you still use it, please send a mail to @email{qemu-devel@@nongnu.org} where
  2677. you describe your usecase.
  2678. @anchor{bt-hcis}
  2679. The following three types are recognized:
  2680. @table @option
  2681. @item -bt hci,null
  2682. (default) The corresponding Bluetooth HCI assumes no internal logic
  2683. and will not respond to any HCI commands or emit events.
  2684. @item -bt hci,host[:@var{id}]
  2685. (@code{bluez} only) The corresponding HCI passes commands / events
  2686. to / from the physical HCI identified by the name @var{id} (default:
  2687. @code{hci0}) on the computer running QEMU. Only available on @code{bluez}
  2688. capable systems like Linux.
  2689. @item -bt hci[,vlan=@var{n}]
  2690. Add a virtual, standard HCI that will participate in the Bluetooth
  2691. scatternet @var{n} (default @code{0}). Similarly to @option{-net}
  2692. VLANs, devices inside a bluetooth network @var{n} can only communicate
  2693. with other devices in the same network (scatternet).
  2694. @end table
  2695. @item -bt vhci[,vlan=@var{n}]
  2696. (Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
  2697. to the host bluetooth stack instead of to the emulated target. This
  2698. allows the host and target machines to participate in a common scatternet
  2699. and communicate. Requires the Linux @code{vhci} driver installed. Can
  2700. be used as following:
  2701. @example
  2702. @value{qemu_system} [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
  2703. @end example
  2704. @item -bt device:@var{dev}[,vlan=@var{n}]
  2705. Emulate a bluetooth device @var{dev} and place it in network @var{n}
  2706. (default @code{0}). QEMU can only emulate one type of bluetooth devices
  2707. currently:
  2708. @table @option
  2709. @item keyboard
  2710. Virtual wireless keyboard implementing the HIDP bluetooth profile.
  2711. @end table
  2712. ETEXI
  2713. STEXI
  2714. @end table
  2715. ETEXI
  2716. DEFHEADING()
  2717. #ifdef CONFIG_TPM
  2718. DEFHEADING(TPM device options:)
  2719. DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
  2720. "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
  2721. " use path to provide path to a character device; default is /dev/tpm0\n"
  2722. " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
  2723. " not provided it will be searched for in /sys/class/misc/tpm?/device\n"
  2724. "-tpmdev emulator,id=id,chardev=dev\n"
  2725. " configure the TPM device using chardev backend\n",
  2726. QEMU_ARCH_ALL)
  2727. STEXI
  2728. The general form of a TPM device option is:
  2729. @table @option
  2730. @item -tpmdev @var{backend},id=@var{id}[,@var{options}]
  2731. @findex -tpmdev
  2732. The specific backend type will determine the applicable options.
  2733. The @code{-tpmdev} option creates the TPM backend and requires a
  2734. @code{-device} option that specifies the TPM frontend interface model.
  2735. Use @code{-tpmdev help} to print all available TPM backend types.
  2736. @end table
  2737. The available backends are:
  2738. @table @option
  2739. @item -tpmdev passthrough,id=@var{id},path=@var{path},cancel-path=@var{cancel-path}
  2740. (Linux-host only) Enable access to the host's TPM using the passthrough
  2741. driver.
  2742. @option{path} specifies the path to the host's TPM device, i.e., on
  2743. a Linux host this would be @code{/dev/tpm0}.
  2744. @option{path} is optional and by default @code{/dev/tpm0} is used.
  2745. @option{cancel-path} specifies the path to the host TPM device's sysfs
  2746. entry allowing for cancellation of an ongoing TPM command.
  2747. @option{cancel-path} is optional and by default QEMU will search for the
  2748. sysfs entry to use.
  2749. Some notes about using the host's TPM with the passthrough driver:
  2750. The TPM device accessed by the passthrough driver must not be
  2751. used by any other application on the host.
  2752. Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
  2753. the VM's firmware (BIOS/UEFI) will not be able to initialize the
  2754. TPM again and may therefore not show a TPM-specific menu that would
  2755. otherwise allow the user to configure the TPM, e.g., allow the user to
  2756. enable/disable or activate/deactivate the TPM.
  2757. Further, if TPM ownership is released from within a VM then the host's TPM
  2758. will get disabled and deactivated. To enable and activate the
  2759. TPM again afterwards, the host has to be rebooted and the user is
  2760. required to enter the firmware's menu to enable and activate the TPM.
  2761. If the TPM is left disabled and/or deactivated most TPM commands will fail.
  2762. To create a passthrough TPM use the following two options:
  2763. @example
  2764. -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
  2765. @end example
  2766. Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
  2767. @code{tpmdev=tpm0} in the device option.
  2768. @item -tpmdev emulator,id=@var{id},chardev=@var{dev}
  2769. (Linux-host only) Enable access to a TPM emulator using Unix domain socket based
  2770. chardev backend.
  2771. @option{chardev} specifies the unique ID of a character device backend that provides connection to the software TPM server.
  2772. To create a TPM emulator backend device with chardev socket backend:
  2773. @example
  2774. -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
  2775. @end example
  2776. ETEXI
  2777. STEXI
  2778. @end table
  2779. ETEXI
  2780. DEFHEADING()
  2781. #endif
  2782. DEFHEADING(Linux/Multiboot boot specific:)
  2783. STEXI
  2784. When using these options, you can use a given Linux or Multiboot
  2785. kernel without installing it in the disk image. It can be useful
  2786. for easier testing of various kernels.
  2787. @table @option
  2788. ETEXI
  2789. DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
  2790. "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
  2791. STEXI
  2792. @item -kernel @var{bzImage}
  2793. @findex -kernel
  2794. Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
  2795. or in multiboot format.
  2796. ETEXI
  2797. DEF("append", HAS_ARG, QEMU_OPTION_append, \
  2798. "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
  2799. STEXI
  2800. @item -append @var{cmdline}
  2801. @findex -append
  2802. Use @var{cmdline} as kernel command line
  2803. ETEXI
  2804. DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
  2805. "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
  2806. STEXI
  2807. @item -initrd @var{file}
  2808. @findex -initrd
  2809. Use @var{file} as initial ram disk.
  2810. @item -initrd "@var{file1} arg=foo,@var{file2}"
  2811. This syntax is only available with multiboot.
  2812. Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
  2813. first module.
  2814. ETEXI
  2815. DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
  2816. "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
  2817. STEXI
  2818. @item -dtb @var{file}
  2819. @findex -dtb
  2820. Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
  2821. on boot.
  2822. ETEXI
  2823. STEXI
  2824. @end table
  2825. ETEXI
  2826. DEFHEADING()
  2827. DEFHEADING(Debug/Expert options:)
  2828. STEXI
  2829. @table @option
  2830. ETEXI
  2831. DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
  2832. "-fw_cfg [name=]<name>,file=<file>\n"
  2833. " add named fw_cfg entry with contents from file\n"
  2834. "-fw_cfg [name=]<name>,string=<str>\n"
  2835. " add named fw_cfg entry with contents from string\n",
  2836. QEMU_ARCH_ALL)
  2837. STEXI
  2838. @item -fw_cfg [name=]@var{name},file=@var{file}
  2839. @findex -fw_cfg
  2840. Add named fw_cfg entry with contents from file @var{file}.
  2841. @item -fw_cfg [name=]@var{name},string=@var{str}
  2842. Add named fw_cfg entry with contents from string @var{str}.
  2843. The terminating NUL character of the contents of @var{str} will not be
  2844. included as part of the fw_cfg item data. To insert contents with
  2845. embedded NUL characters, you have to use the @var{file} parameter.
  2846. The fw_cfg entries are passed by QEMU through to the guest.
  2847. Example:
  2848. @example
  2849. -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
  2850. @end example
  2851. creates an fw_cfg entry named opt/com.mycompany/blob with contents
  2852. from ./my_blob.bin.
  2853. ETEXI
  2854. DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
  2855. "-serial dev redirect the serial port to char device 'dev'\n",
  2856. QEMU_ARCH_ALL)
  2857. STEXI
  2858. @item -serial @var{dev}
  2859. @findex -serial
  2860. Redirect the virtual serial port to host character device
  2861. @var{dev}. The default device is @code{vc} in graphical mode and
  2862. @code{stdio} in non graphical mode.
  2863. This option can be used several times to simulate up to 4 serial
  2864. ports.
  2865. Use @code{-serial none} to disable all serial ports.
  2866. Available character devices are:
  2867. @table @option
  2868. @item vc[:@var{W}x@var{H}]
  2869. Virtual console. Optionally, a width and height can be given in pixel with
  2870. @example
  2871. vc:800x600
  2872. @end example
  2873. It is also possible to specify width or height in characters:
  2874. @example
  2875. vc:80Cx24C
  2876. @end example
  2877. @item pty
  2878. [Linux only] Pseudo TTY (a new PTY is automatically allocated)
  2879. @item none
  2880. No device is allocated.
  2881. @item null
  2882. void device
  2883. @item chardev:@var{id}
  2884. Use a named character device defined with the @code{-chardev} option.
  2885. @item /dev/XXX
  2886. [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
  2887. parameters are set according to the emulated ones.
  2888. @item /dev/parport@var{N}
  2889. [Linux only, parallel port only] Use host parallel port
  2890. @var{N}. Currently SPP and EPP parallel port features can be used.
  2891. @item file:@var{filename}
  2892. Write output to @var{filename}. No character can be read.
  2893. @item stdio
  2894. [Unix only] standard input/output
  2895. @item pipe:@var{filename}
  2896. name pipe @var{filename}
  2897. @item COM@var{n}
  2898. [Windows only] Use host serial port @var{n}
  2899. @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
  2900. This implements UDP Net Console.
  2901. When @var{remote_host} or @var{src_ip} are not specified
  2902. they default to @code{0.0.0.0}.
  2903. When not using a specified @var{src_port} a random port is automatically chosen.
  2904. If you just want a simple readonly console you can use @code{netcat} or
  2905. @code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
  2906. @code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
  2907. will appear in the netconsole session.
  2908. If you plan to send characters back via netconsole or you want to stop
  2909. and start QEMU a lot of times, you should have QEMU use the same
  2910. source port each time by using something like @code{-serial
  2911. udp::4555@@:4556} to QEMU. Another approach is to use a patched
  2912. version of netcat which can listen to a TCP port and send and receive
  2913. characters via udp. If you have a patched version of netcat which
  2914. activates telnet remote echo and single char transfer, then you can
  2915. use the following options to set up a netcat redirector to allow
  2916. telnet on port 5555 to access the QEMU port.
  2917. @table @code
  2918. @item QEMU Options:
  2919. -serial udp::4555@@:4556
  2920. @item netcat options:
  2921. -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
  2922. @item telnet options:
  2923. localhost 5555
  2924. @end table
  2925. @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
  2926. The TCP Net Console has two modes of operation. It can send the serial
  2927. I/O to a location or wait for a connection from a location. By default
  2928. the TCP Net Console is sent to @var{host} at the @var{port}. If you use
  2929. the @var{server} option QEMU will wait for a client socket application
  2930. to connect to the port before continuing, unless the @code{nowait}
  2931. option was specified. The @code{nodelay} option disables the Nagle buffering
  2932. algorithm. The @code{reconnect} option only applies if @var{noserver} is
  2933. set, if the connection goes down it will attempt to reconnect at the
  2934. given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only
  2935. one TCP connection at a time is accepted. You can use @code{telnet} to
  2936. connect to the corresponding character device.
  2937. @table @code
  2938. @item Example to send tcp console to 192.168.0.2 port 4444
  2939. -serial tcp:192.168.0.2:4444
  2940. @item Example to listen and wait on port 4444 for connection
  2941. -serial tcp::4444,server
  2942. @item Example to not wait and listen on ip 192.168.0.100 port 4444
  2943. -serial tcp:192.168.0.100:4444,server,nowait
  2944. @end table
  2945. @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
  2946. The telnet protocol is used instead of raw tcp sockets. The options
  2947. work the same as if you had specified @code{-serial tcp}. The
  2948. difference is that the port acts like a telnet server or client using
  2949. telnet option negotiation. This will also allow you to send the
  2950. MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
  2951. sequence. Typically in unix telnet you do it with Control-] and then
  2952. type "send break" followed by pressing the enter key.
  2953. @item websocket:@var{host}:@var{port},server[,nowait][,nodelay]
  2954. The WebSocket protocol is used instead of raw tcp socket. The port acts as
  2955. a WebSocket server. Client mode is not supported.
  2956. @item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
  2957. A unix domain socket is used instead of a tcp socket. The option works the
  2958. same as if you had specified @code{-serial tcp} except the unix domain socket
  2959. @var{path} is used for connections.
  2960. @item mon:@var{dev_string}
  2961. This is a special option to allow the monitor to be multiplexed onto
  2962. another serial port. The monitor is accessed with key sequence of
  2963. @key{Control-a} and then pressing @key{c}.
  2964. @var{dev_string} should be any one of the serial devices specified
  2965. above. An example to multiplex the monitor onto a telnet server
  2966. listening on port 4444 would be:
  2967. @table @code
  2968. @item -serial mon:telnet::4444,server,nowait
  2969. @end table
  2970. When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
  2971. QEMU any more but will be passed to the guest instead.
  2972. @item braille
  2973. Braille device. This will use BrlAPI to display the braille output on a real
  2974. or fake device.
  2975. @item msmouse
  2976. Three button serial mouse. Configure the guest to use Microsoft protocol.
  2977. @end table
  2978. ETEXI
  2979. DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
  2980. "-parallel dev redirect the parallel port to char device 'dev'\n",
  2981. QEMU_ARCH_ALL)
  2982. STEXI
  2983. @item -parallel @var{dev}
  2984. @findex -parallel
  2985. Redirect the virtual parallel port to host device @var{dev} (same
  2986. devices as the serial port). On Linux hosts, @file{/dev/parportN} can
  2987. be used to use hardware devices connected on the corresponding host
  2988. parallel port.
  2989. This option can be used several times to simulate up to 3 parallel
  2990. ports.
  2991. Use @code{-parallel none} to disable all parallel ports.
  2992. ETEXI
  2993. DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
  2994. "-monitor dev redirect the monitor to char device 'dev'\n",
  2995. QEMU_ARCH_ALL)
  2996. STEXI
  2997. @item -monitor @var{dev}
  2998. @findex -monitor
  2999. Redirect the monitor to host device @var{dev} (same devices as the
  3000. serial port).
  3001. The default device is @code{vc} in graphical mode and @code{stdio} in
  3002. non graphical mode.
  3003. Use @code{-monitor none} to disable the default monitor.
  3004. ETEXI
  3005. DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
  3006. "-qmp dev like -monitor but opens in 'control' mode\n",
  3007. QEMU_ARCH_ALL)
  3008. STEXI
  3009. @item -qmp @var{dev}
  3010. @findex -qmp
  3011. Like -monitor but opens in 'control' mode.
  3012. ETEXI
  3013. DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
  3014. "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
  3015. QEMU_ARCH_ALL)
  3016. STEXI
  3017. @item -qmp-pretty @var{dev}
  3018. @findex -qmp-pretty
  3019. Like -qmp but uses pretty JSON formatting.
  3020. ETEXI
  3021. DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
  3022. "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
  3023. STEXI
  3024. @item -mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]
  3025. @findex -mon
  3026. Setup monitor on chardev @var{name}. @code{pretty} turns on JSON pretty printing
  3027. easing human reading and debugging.
  3028. ETEXI
  3029. DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
  3030. "-debugcon dev redirect the debug console to char device 'dev'\n",
  3031. QEMU_ARCH_ALL)
  3032. STEXI
  3033. @item -debugcon @var{dev}
  3034. @findex -debugcon
  3035. Redirect the debug console to host device @var{dev} (same devices as the
  3036. serial port). The debug console is an I/O port which is typically port
  3037. 0xe9; writing to that I/O port sends output to this device.
  3038. The default device is @code{vc} in graphical mode and @code{stdio} in
  3039. non graphical mode.
  3040. ETEXI
  3041. DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
  3042. "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
  3043. STEXI
  3044. @item -pidfile @var{file}
  3045. @findex -pidfile
  3046. Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
  3047. from a script.
  3048. ETEXI
  3049. DEF("singlestep", 0, QEMU_OPTION_singlestep, \
  3050. "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
  3051. STEXI
  3052. @item -singlestep
  3053. @findex -singlestep
  3054. Run the emulation in single step mode.
  3055. ETEXI
  3056. DEF("preconfig", 0, QEMU_OPTION_preconfig, \
  3057. "--preconfig pause QEMU before machine is initialized (experimental)\n",
  3058. QEMU_ARCH_ALL)
  3059. STEXI
  3060. @item --preconfig
  3061. @findex --preconfig
  3062. Pause QEMU for interactive configuration before the machine is created,
  3063. which allows querying and configuring properties that will affect
  3064. machine initialization. Use QMP command 'x-exit-preconfig' to exit
  3065. the preconfig state and move to the next state (i.e. run guest if -S
  3066. isn't used or pause the second time if -S is used). This option is
  3067. experimental.
  3068. ETEXI
  3069. DEF("S", 0, QEMU_OPTION_S, \
  3070. "-S freeze CPU at startup (use 'c' to start execution)\n",
  3071. QEMU_ARCH_ALL)
  3072. STEXI
  3073. @item -S
  3074. @findex -S
  3075. Do not start CPU at startup (you must type 'c' in the monitor).
  3076. ETEXI
  3077. DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
  3078. "-realtime [mlock=on|off]\n"
  3079. " run qemu with realtime features\n"
  3080. " mlock=on|off controls mlock support (default: on)\n",
  3081. QEMU_ARCH_ALL)
  3082. STEXI
  3083. @item -realtime mlock=on|off
  3084. @findex -realtime
  3085. Run qemu with realtime features.
  3086. mlocking qemu and guest memory can be enabled via @option{mlock=on}
  3087. (enabled by default).
  3088. ETEXI
  3089. DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
  3090. "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
  3091. " run qemu with overcommit hints\n"
  3092. " mem-lock=on|off controls memory lock support (default: off)\n"
  3093. " cpu-pm=on|off controls cpu power management (default: off)\n",
  3094. QEMU_ARCH_ALL)
  3095. STEXI
  3096. @item -overcommit mem-lock=on|off
  3097. @item -overcommit cpu-pm=on|off
  3098. @findex -overcommit
  3099. Run qemu with hints about host resource overcommit. The default is
  3100. to assume that host overcommits all resources.
  3101. Locking qemu and guest memory can be enabled via @option{mem-lock=on} (disabled
  3102. by default). This works when host memory is not overcommitted and reduces the
  3103. worst-case latency for guest. This is equivalent to @option{realtime}.
  3104. Guest ability to manage power state of host cpus (increasing latency for other
  3105. processes on the same host cpu, but decreasing latency for guest) can be
  3106. enabled via @option{cpu-pm=on} (disabled by default). This works best when
  3107. host CPU is not overcommitted. When used, host estimates of CPU cycle and power
  3108. utilization will be incorrect, not taking into account guest idle time.
  3109. ETEXI
  3110. DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
  3111. "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
  3112. STEXI
  3113. @item -gdb @var{dev}
  3114. @findex -gdb
  3115. Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
  3116. connections will likely be TCP-based, but also UDP, pseudo TTY, or even
  3117. stdio are reasonable use case. The latter is allowing to start QEMU from
  3118. within gdb and establish the connection via a pipe:
  3119. @example
  3120. (gdb) target remote | exec @value{qemu_system} -gdb stdio ...
  3121. @end example
  3122. ETEXI
  3123. DEF("s", 0, QEMU_OPTION_s, \
  3124. "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
  3125. QEMU_ARCH_ALL)
  3126. STEXI
  3127. @item -s
  3128. @findex -s
  3129. Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
  3130. (@pxref{gdb_usage}).
  3131. ETEXI
  3132. DEF("d", HAS_ARG, QEMU_OPTION_d, \
  3133. "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
  3134. QEMU_ARCH_ALL)
  3135. STEXI
  3136. @item -d @var{item1}[,...]
  3137. @findex -d
  3138. Enable logging of specified items. Use '-d help' for a list of log items.
  3139. ETEXI
  3140. DEF("D", HAS_ARG, QEMU_OPTION_D, \
  3141. "-D logfile output log to logfile (default stderr)\n",
  3142. QEMU_ARCH_ALL)
  3143. STEXI
  3144. @item -D @var{logfile}
  3145. @findex -D
  3146. Output log in @var{logfile} instead of to stderr
  3147. ETEXI
  3148. DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
  3149. "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
  3150. QEMU_ARCH_ALL)
  3151. STEXI
  3152. @item -dfilter @var{range1}[,...]
  3153. @findex -dfilter
  3154. Filter debug output to that relevant to a range of target addresses. The filter
  3155. spec can be either @var{start}+@var{size}, @var{start}-@var{size} or
  3156. @var{start}..@var{end} where @var{start} @var{end} and @var{size} are the
  3157. addresses and sizes required. For example:
  3158. @example
  3159. -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
  3160. @end example
  3161. Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
  3162. the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
  3163. block starting at 0xffffffc00005f000.
  3164. ETEXI
  3165. DEF("seed", HAS_ARG, QEMU_OPTION_seed, \
  3166. "-seed number seed the pseudo-random number generator\n",
  3167. QEMU_ARCH_ALL)
  3168. STEXI
  3169. @item -seed @var{number}
  3170. @findex -seed
  3171. Force the guest to use a deterministic pseudo-random number generator, seeded
  3172. with @var{number}. This does not affect crypto routines within the host.
  3173. ETEXI
  3174. DEF("L", HAS_ARG, QEMU_OPTION_L, \
  3175. "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
  3176. QEMU_ARCH_ALL)
  3177. STEXI
  3178. @item -L @var{path}
  3179. @findex -L
  3180. Set the directory for the BIOS, VGA BIOS and keymaps.
  3181. To list all the data directories, use @code{-L help}.
  3182. ETEXI
  3183. DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
  3184. "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
  3185. STEXI
  3186. @item -bios @var{file}
  3187. @findex -bios
  3188. Set the filename for the BIOS.
  3189. ETEXI
  3190. DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
  3191. "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
  3192. STEXI
  3193. @item -enable-kvm
  3194. @findex -enable-kvm
  3195. Enable KVM full virtualization support. This option is only available
  3196. if KVM support is enabled when compiling.
  3197. ETEXI
  3198. DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
  3199. "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
  3200. DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
  3201. "-xen-attach attach to existing xen domain\n"
  3202. " libxl will use this when starting QEMU\n",
  3203. QEMU_ARCH_ALL)
  3204. DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
  3205. "-xen-domid-restrict restrict set of available xen operations\n"
  3206. " to specified domain id. (Does not affect\n"
  3207. " xenpv machine type).\n",
  3208. QEMU_ARCH_ALL)
  3209. STEXI
  3210. @item -xen-domid @var{id}
  3211. @findex -xen-domid
  3212. Specify xen guest domain @var{id} (XEN only).
  3213. @item -xen-attach
  3214. @findex -xen-attach
  3215. Attach to existing xen domain.
  3216. libxl will use this when starting QEMU (XEN only).
  3217. @findex -xen-domid-restrict
  3218. Restrict set of available xen operations to specified domain id (XEN only).
  3219. ETEXI
  3220. DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
  3221. "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
  3222. STEXI
  3223. @item -no-reboot
  3224. @findex -no-reboot
  3225. Exit instead of rebooting.
  3226. ETEXI
  3227. DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
  3228. "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
  3229. STEXI
  3230. @item -no-shutdown
  3231. @findex -no-shutdown
  3232. Don't exit QEMU on guest shutdown, but instead only stop the emulation.
  3233. This allows for instance switching to monitor to commit changes to the
  3234. disk image.
  3235. ETEXI
  3236. DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
  3237. "-loadvm [tag|id]\n" \
  3238. " start right away with a saved state (loadvm in monitor)\n",
  3239. QEMU_ARCH_ALL)
  3240. STEXI
  3241. @item -loadvm @var{file}
  3242. @findex -loadvm
  3243. Start right away with a saved state (@code{loadvm} in monitor)
  3244. ETEXI
  3245. #ifndef _WIN32
  3246. DEF("daemonize", 0, QEMU_OPTION_daemonize, \
  3247. "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
  3248. #endif
  3249. STEXI
  3250. @item -daemonize
  3251. @findex -daemonize
  3252. Daemonize the QEMU process after initialization. QEMU will not detach from
  3253. standard IO until it is ready to receive connections on any of its devices.
  3254. This option is a useful way for external programs to launch QEMU without having
  3255. to cope with initialization race conditions.
  3256. ETEXI
  3257. DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
  3258. "-option-rom rom load a file, rom, into the option ROM space\n",
  3259. QEMU_ARCH_ALL)
  3260. STEXI
  3261. @item -option-rom @var{file}
  3262. @findex -option-rom
  3263. Load the contents of @var{file} as an option ROM.
  3264. This option is useful to load things like EtherBoot.
  3265. ETEXI
  3266. DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
  3267. "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
  3268. " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
  3269. QEMU_ARCH_ALL)
  3270. STEXI
  3271. @item -rtc [base=utc|localtime|@var{datetime}][,clock=host|rt|vm][,driftfix=none|slew]
  3272. @findex -rtc
  3273. Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
  3274. UTC or local time, respectively. @code{localtime} is required for correct date in
  3275. MS-DOS or Windows. To start at a specific point in time, provide @var{datetime} in the
  3276. format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
  3277. By default the RTC is driven by the host system time. This allows using of the
  3278. RTC as accurate reference clock inside the guest, specifically if the host
  3279. time is smoothly following an accurate external reference clock, e.g. via NTP.
  3280. If you want to isolate the guest time from the host, you can set @option{clock}
  3281. to @code{rt} instead, which provides a host monotonic clock if host support it.
  3282. To even prevent the RTC from progressing during suspension, you can set @option{clock}
  3283. to @code{vm} (virtual clock). @samp{clock=vm} is recommended especially in
  3284. icount mode in order to preserve determinism; however, note that in icount mode
  3285. the speed of the virtual clock is variable and can in general differ from the
  3286. host clock.
  3287. Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
  3288. specifically with Windows' ACPI HAL. This option will try to figure out how
  3289. many timer interrupts were not processed by the Windows guest and will
  3290. re-inject them.
  3291. ETEXI
  3292. DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
  3293. "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
  3294. " enable virtual instruction counter with 2^N clock ticks per\n" \
  3295. " instruction, enable aligning the host and virtual clocks\n" \
  3296. " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
  3297. STEXI
  3298. @item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
  3299. @findex -icount
  3300. Enable virtual instruction counter. The virtual cpu will execute one
  3301. instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
  3302. then the virtual cpu speed will be automatically adjusted to keep virtual
  3303. time within a few seconds of real time.
  3304. When the virtual cpu is sleeping, the virtual time will advance at default
  3305. speed unless @option{sleep=on|off} is specified.
  3306. With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
  3307. instantly whenever the virtual cpu goes to sleep mode and will not advance
  3308. if no timer is enabled. This behavior give deterministic execution times from
  3309. the guest point of view.
  3310. Note that while this option can give deterministic behavior, it does not
  3311. provide cycle accurate emulation. Modern CPUs contain superscalar out of
  3312. order cores with complex cache hierarchies. The number of instructions
  3313. executed often has little or no correlation with actual performance.
  3314. @option{align=on} will activate the delay algorithm which will try
  3315. to synchronise the host clock and the virtual clock. The goal is to
  3316. have a guest running at the real frequency imposed by the shift option.
  3317. Whenever the guest clock is behind the host clock and if
  3318. @option{align=on} is specified then we print a message to the user
  3319. to inform about the delay.
  3320. Currently this option does not work when @option{shift} is @code{auto}.
  3321. Note: The sync algorithm will work for those shift values for which
  3322. the guest clock runs ahead of the host clock. Typically this happens
  3323. when the shift value is high (how high depends on the host machine).
  3324. When @option{rr} option is specified deterministic record/replay is enabled.
  3325. Replay log is written into @var{filename} file in record mode and
  3326. read from this file in replay mode.
  3327. Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
  3328. at the start of execution recording. In replay mode this option is used
  3329. to load the initial VM state.
  3330. ETEXI
  3331. DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
  3332. "-watchdog model\n" \
  3333. " enable virtual hardware watchdog [default=none]\n",
  3334. QEMU_ARCH_ALL)
  3335. STEXI
  3336. @item -watchdog @var{model}
  3337. @findex -watchdog
  3338. Create a virtual hardware watchdog device. Once enabled (by a guest
  3339. action), the watchdog must be periodically polled by an agent inside
  3340. the guest or else the guest will be restarted. Choose a model for
  3341. which your guest has drivers.
  3342. The @var{model} is the model of hardware watchdog to emulate. Use
  3343. @code{-watchdog help} to list available hardware models. Only one
  3344. watchdog can be enabled for a guest.
  3345. The following models may be available:
  3346. @table @option
  3347. @item ib700
  3348. iBASE 700 is a very simple ISA watchdog with a single timer.
  3349. @item i6300esb
  3350. Intel 6300ESB I/O controller hub is a much more featureful PCI-based
  3351. dual-timer watchdog.
  3352. @item diag288
  3353. A virtual watchdog for s390x backed by the diagnose 288 hypercall
  3354. (currently KVM only).
  3355. @end table
  3356. ETEXI
  3357. DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
  3358. "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
  3359. " action when watchdog fires [default=reset]\n",
  3360. QEMU_ARCH_ALL)
  3361. STEXI
  3362. @item -watchdog-action @var{action}
  3363. @findex -watchdog-action
  3364. The @var{action} controls what QEMU will do when the watchdog timer
  3365. expires.
  3366. The default is
  3367. @code{reset} (forcefully reset the guest).
  3368. Other possible actions are:
  3369. @code{shutdown} (attempt to gracefully shutdown the guest),
  3370. @code{poweroff} (forcefully poweroff the guest),
  3371. @code{inject-nmi} (inject a NMI into the guest),
  3372. @code{pause} (pause the guest),
  3373. @code{debug} (print a debug message and continue), or
  3374. @code{none} (do nothing).
  3375. Note that the @code{shutdown} action requires that the guest responds
  3376. to ACPI signals, which it may not be able to do in the sort of
  3377. situations where the watchdog would have expired, and thus
  3378. @code{-watchdog-action shutdown} is not recommended for production use.
  3379. Examples:
  3380. @table @code
  3381. @item -watchdog i6300esb -watchdog-action pause
  3382. @itemx -watchdog ib700
  3383. @end table
  3384. ETEXI
  3385. DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
  3386. "-echr chr set terminal escape character instead of ctrl-a\n",
  3387. QEMU_ARCH_ALL)
  3388. STEXI
  3389. @item -echr @var{numeric_ascii_value}
  3390. @findex -echr
  3391. Change the escape character used for switching to the monitor when using
  3392. monitor and serial sharing. The default is @code{0x01} when using the
  3393. @code{-nographic} option. @code{0x01} is equal to pressing
  3394. @code{Control-a}. You can select a different character from the ascii
  3395. control keys where 1 through 26 map to Control-a through Control-z. For
  3396. instance you could use the either of the following to change the escape
  3397. character to Control-t.
  3398. @table @code
  3399. @item -echr 0x14
  3400. @itemx -echr 20
  3401. @end table
  3402. ETEXI
  3403. DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
  3404. "-show-cursor show cursor\n", QEMU_ARCH_ALL)
  3405. STEXI
  3406. @item -show-cursor
  3407. @findex -show-cursor
  3408. Show cursor.
  3409. ETEXI
  3410. DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
  3411. "-tb-size n set TB size\n", QEMU_ARCH_ALL)
  3412. STEXI
  3413. @item -tb-size @var{n}
  3414. @findex -tb-size
  3415. Set TB size.
  3416. ETEXI
  3417. DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
  3418. "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
  3419. "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
  3420. "-incoming unix:socketpath\n" \
  3421. " prepare for incoming migration, listen on\n" \
  3422. " specified protocol and socket address\n" \
  3423. "-incoming fd:fd\n" \
  3424. "-incoming exec:cmdline\n" \
  3425. " accept incoming migration on given file descriptor\n" \
  3426. " or from given external command\n" \
  3427. "-incoming defer\n" \
  3428. " wait for the URI to be specified via migrate_incoming\n",
  3429. QEMU_ARCH_ALL)
  3430. STEXI
  3431. @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
  3432. @itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
  3433. @findex -incoming
  3434. Prepare for incoming migration, listen on a given tcp port.
  3435. @item -incoming unix:@var{socketpath}
  3436. Prepare for incoming migration, listen on a given unix socket.
  3437. @item -incoming fd:@var{fd}
  3438. Accept incoming migration from a given filedescriptor.
  3439. @item -incoming exec:@var{cmdline}
  3440. Accept incoming migration as an output from specified external command.
  3441. @item -incoming defer
  3442. Wait for the URI to be specified via migrate_incoming. The monitor can
  3443. be used to change settings (such as migration parameters) prior to issuing
  3444. the migrate_incoming to allow the migration to begin.
  3445. ETEXI
  3446. DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
  3447. "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
  3448. STEXI
  3449. @item -only-migratable
  3450. @findex -only-migratable
  3451. Only allow migratable devices. Devices will not be allowed to enter an
  3452. unmigratable state.
  3453. ETEXI
  3454. DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
  3455. "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
  3456. STEXI
  3457. @item -nodefaults
  3458. @findex -nodefaults
  3459. Don't create default devices. Normally, QEMU sets the default devices like serial
  3460. port, parallel port, virtual console, monitor device, VGA adapter, floppy and
  3461. CD-ROM drive and others. The @code{-nodefaults} option will disable all those
  3462. default devices.
  3463. ETEXI
  3464. #ifndef _WIN32
  3465. DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
  3466. "-chroot dir chroot to dir just before starting the VM\n",
  3467. QEMU_ARCH_ALL)
  3468. #endif
  3469. STEXI
  3470. @item -chroot @var{dir}
  3471. @findex -chroot
  3472. Immediately before starting guest execution, chroot to the specified
  3473. directory. Especially useful in combination with -runas.
  3474. ETEXI
  3475. #ifndef _WIN32
  3476. DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
  3477. "-runas user change to user id user just before starting the VM\n" \
  3478. " user can be numeric uid:gid instead\n",
  3479. QEMU_ARCH_ALL)
  3480. #endif
  3481. STEXI
  3482. @item -runas @var{user}
  3483. @findex -runas
  3484. Immediately before starting guest execution, drop root privileges, switching
  3485. to the specified user.
  3486. ETEXI
  3487. DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
  3488. "-prom-env variable=value\n"
  3489. " set OpenBIOS nvram variables\n",
  3490. QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
  3491. STEXI
  3492. @item -prom-env @var{variable}=@var{value}
  3493. @findex -prom-env
  3494. Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
  3495. ETEXI
  3496. DEF("semihosting", 0, QEMU_OPTION_semihosting,
  3497. "-semihosting semihosting mode\n",
  3498. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3499. QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
  3500. STEXI
  3501. @item -semihosting
  3502. @findex -semihosting
  3503. Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only).
  3504. ETEXI
  3505. DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
  3506. "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \
  3507. " semihosting configuration\n",
  3508. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3509. QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
  3510. STEXI
  3511. @item -semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]
  3512. @findex -semihosting-config
  3513. Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II only).
  3514. @table @option
  3515. @item target=@code{native|gdb|auto}
  3516. Defines where the semihosting calls will be addressed, to QEMU (@code{native})
  3517. or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
  3518. during debug sessions and @code{native} otherwise.
  3519. @item chardev=@var{str1}
  3520. Send the output to a chardev backend output for native or auto output when not in gdb
  3521. @item arg=@var{str1},arg=@var{str2},...
  3522. Allows the user to pass input arguments, and can be used multiple times to build
  3523. up a list. The old-style @code{-kernel}/@code{-append} method of passing a
  3524. command line is still supported for backward compatibility. If both the
  3525. @code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
  3526. specified, the former is passed to semihosting as it always takes precedence.
  3527. @end table
  3528. ETEXI
  3529. DEF("old-param", 0, QEMU_OPTION_old_param,
  3530. "-old-param old param mode\n", QEMU_ARCH_ARM)
  3531. STEXI
  3532. @item -old-param
  3533. @findex -old-param (ARM)
  3534. Old param mode (ARM only).
  3535. ETEXI
  3536. DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
  3537. "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
  3538. " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
  3539. " Enable seccomp mode 2 system call filter (default 'off').\n" \
  3540. " use 'obsolete' to allow obsolete system calls that are provided\n" \
  3541. " by the kernel, but typically no longer used by modern\n" \
  3542. " C library implementations.\n" \
  3543. " use 'elevateprivileges' to allow or deny QEMU process to elevate\n" \
  3544. " its privileges by blacklisting all set*uid|gid system calls.\n" \
  3545. " The value 'children' will deny set*uid|gid system calls for\n" \
  3546. " main QEMU process but will allow forks and execves to run unprivileged\n" \
  3547. " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
  3548. " blacklisting *fork and execve\n" \
  3549. " use 'resourcecontrol' to disable process affinity and schedular priority\n",
  3550. QEMU_ARCH_ALL)
  3551. STEXI
  3552. @item -sandbox @var{arg}[,obsolete=@var{string}][,elevateprivileges=@var{string}][,spawn=@var{string}][,resourcecontrol=@var{string}]
  3553. @findex -sandbox
  3554. Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
  3555. disable it. The default is 'off'.
  3556. @table @option
  3557. @item obsolete=@var{string}
  3558. Enable Obsolete system calls
  3559. @item elevateprivileges=@var{string}
  3560. Disable set*uid|gid system calls
  3561. @item spawn=@var{string}
  3562. Disable *fork and execve
  3563. @item resourcecontrol=@var{string}
  3564. Disable process affinity and schedular priority
  3565. @end table
  3566. ETEXI
  3567. DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
  3568. "-readconfig <file>\n", QEMU_ARCH_ALL)
  3569. STEXI
  3570. @item -readconfig @var{file}
  3571. @findex -readconfig
  3572. Read device configuration from @var{file}. This approach is useful when you want to spawn
  3573. QEMU process with many command line options but you don't want to exceed the command line
  3574. character limit.
  3575. ETEXI
  3576. DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
  3577. "-writeconfig <file>\n"
  3578. " read/write config file\n", QEMU_ARCH_ALL)
  3579. STEXI
  3580. @item -writeconfig @var{file}
  3581. @findex -writeconfig
  3582. Write device configuration to @var{file}. The @var{file} can be either filename to save
  3583. command line and device configuration into file or dash @code{-}) character to print the
  3584. output to stdout. This can be later used as input file for @code{-readconfig} option.
  3585. ETEXI
  3586. DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
  3587. "-no-user-config\n"
  3588. " do not load default user-provided config files at startup\n",
  3589. QEMU_ARCH_ALL)
  3590. STEXI
  3591. @item -no-user-config
  3592. @findex -no-user-config
  3593. The @code{-no-user-config} option makes QEMU not load any of the user-provided
  3594. config files on @var{sysconfdir}.
  3595. ETEXI
  3596. DEF("trace", HAS_ARG, QEMU_OPTION_trace,
  3597. "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
  3598. " specify tracing options\n",
  3599. QEMU_ARCH_ALL)
  3600. STEXI
  3601. HXCOMM This line is not accurate, as some sub-options are backend-specific but
  3602. HXCOMM HX does not support conditional compilation of text.
  3603. @item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
  3604. @findex -trace
  3605. @include qemu-option-trace.texi
  3606. ETEXI
  3607. DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
  3608. "-plugin [file=]<file>[,arg=<string>]\n"
  3609. " load a plugin\n",
  3610. QEMU_ARCH_ALL)
  3611. STEXI
  3612. @item -plugin file=@var{file}[,arg=@var{string}]
  3613. @findex -plugin
  3614. Load a plugin.
  3615. @table @option
  3616. @item file=@var{file}
  3617. Load the given plugin from a shared library file.
  3618. @item arg=@var{string}
  3619. Argument string passed to the plugin. (Can be given multiple times.)
  3620. @end table
  3621. ETEXI
  3622. HXCOMM Internal use
  3623. DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
  3624. DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
  3625. #ifdef __linux__
  3626. DEF("enable-fips", 0, QEMU_OPTION_enablefips,
  3627. "-enable-fips enable FIPS 140-2 compliance\n",
  3628. QEMU_ARCH_ALL)
  3629. #endif
  3630. STEXI
  3631. @item -enable-fips
  3632. @findex -enable-fips
  3633. Enable FIPS 140-2 compliance mode.
  3634. ETEXI
  3635. HXCOMM Deprecated by -accel tcg
  3636. DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
  3637. DEF("msg", HAS_ARG, QEMU_OPTION_msg,
  3638. "-msg timestamp[=on|off]\n"
  3639. " change the format of messages\n"
  3640. " on|off controls leading timestamps (default:on)\n",
  3641. QEMU_ARCH_ALL)
  3642. STEXI
  3643. @item -msg timestamp[=on|off]
  3644. @findex -msg
  3645. prepend a timestamp to each log message.(default:on)
  3646. ETEXI
  3647. DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
  3648. "-dump-vmstate <file>\n"
  3649. " Output vmstate information in JSON format to file.\n"
  3650. " Use the scripts/vmstate-static-checker.py file to\n"
  3651. " check for possible regressions in migration code\n"
  3652. " by comparing two such vmstate dumps.\n",
  3653. QEMU_ARCH_ALL)
  3654. STEXI
  3655. @item -dump-vmstate @var{file}
  3656. @findex -dump-vmstate
  3657. Dump json-encoded vmstate information for current machine type to file
  3658. in @var{file}
  3659. ETEXI
  3660. DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
  3661. "-enable-sync-profile\n"
  3662. " enable synchronization profiling\n",
  3663. QEMU_ARCH_ALL)
  3664. STEXI
  3665. @item -enable-sync-profile
  3666. @findex -enable-sync-profile
  3667. Enable synchronization profiling.
  3668. ETEXI
  3669. STEXI
  3670. @end table
  3671. ETEXI
  3672. DEFHEADING()
  3673. DEFHEADING(Generic object creation:)
  3674. STEXI
  3675. @table @option
  3676. ETEXI
  3677. DEF("object", HAS_ARG, QEMU_OPTION_object,
  3678. "-object TYPENAME[,PROP1=VALUE1,...]\n"
  3679. " create a new object of type TYPENAME setting properties\n"
  3680. " in the order they are specified. Note that the 'id'\n"
  3681. " property must be set. These objects are placed in the\n"
  3682. " '/objects' path.\n",
  3683. QEMU_ARCH_ALL)
  3684. STEXI
  3685. @item -object @var{typename}[,@var{prop1}=@var{value1},...]
  3686. @findex -object
  3687. Create a new object of type @var{typename} setting properties
  3688. in the order they are specified. Note that the 'id'
  3689. property must be set. These objects are placed in the
  3690. '/objects' path.
  3691. @table @option
  3692. @item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off},discard-data=@var{on|off},merge=@var{on|off},dump=@var{on|off},prealloc=@var{on|off},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},align=@var{align}
  3693. Creates a memory file backend object, which can be used to back
  3694. the guest RAM with huge pages.
  3695. The @option{id} parameter is a unique ID that will be used to reference this
  3696. memory region when configuring the @option{-numa} argument.
  3697. The @option{size} option provides the size of the memory region, and accepts
  3698. common suffixes, eg @option{500M}.
  3699. The @option{mem-path} provides the path to either a shared memory or huge page
  3700. filesystem mount.
  3701. The @option{share} boolean option determines whether the memory
  3702. region is marked as private to QEMU, or shared. The latter allows
  3703. a co-operating external process to access the QEMU memory region.
  3704. The @option{share} is also required for pvrdma devices due to
  3705. limitations in the RDMA API provided by Linux.
  3706. Setting share=on might affect the ability to configure NUMA
  3707. bindings for the memory backend under some circumstances, see
  3708. Documentation/vm/numa_memory_policy.txt on the Linux kernel
  3709. source tree for additional details.
  3710. Setting the @option{discard-data} boolean option to @var{on}
  3711. indicates that file contents can be destroyed when QEMU exits,
  3712. to avoid unnecessarily flushing data to the backing file. Note
  3713. that @option{discard-data} is only an optimization, and QEMU
  3714. might not discard file contents if it aborts unexpectedly or is
  3715. terminated using SIGKILL.
  3716. The @option{merge} boolean option enables memory merge, also known as
  3717. MADV_MERGEABLE, so that Kernel Samepage Merging will consider the pages for
  3718. memory deduplication.
  3719. Setting the @option{dump} boolean option to @var{off} excludes the memory from
  3720. core dumps. This feature is also known as MADV_DONTDUMP.
  3721. The @option{prealloc} boolean option enables memory preallocation.
  3722. The @option{host-nodes} option binds the memory range to a list of NUMA host
  3723. nodes.
  3724. The @option{policy} option sets the NUMA policy to one of the following values:
  3725. @table @option
  3726. @item @var{default}
  3727. default host policy
  3728. @item @var{preferred}
  3729. prefer the given host node list for allocation
  3730. @item @var{bind}
  3731. restrict memory allocation to the given host node list
  3732. @item @var{interleave}
  3733. interleave memory allocations across the given host node list
  3734. @end table
  3735. The @option{align} option specifies the base address alignment when
  3736. QEMU mmap(2) @option{mem-path}, and accepts common suffixes, eg
  3737. @option{2M}. Some backend store specified by @option{mem-path}
  3738. requires an alignment different than the default one used by QEMU, eg
  3739. the device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
  3740. such cases, users can specify the required alignment via this option.
  3741. The @option{pmem} option specifies whether the backing file specified
  3742. by @option{mem-path} is in host persistent memory that can be accessed
  3743. using the SNIA NVM programming model (e.g. Intel NVDIMM).
  3744. If @option{pmem} is set to 'on', QEMU will take necessary operations to
  3745. guarantee the persistence of its own writes to @option{mem-path}
  3746. (e.g. in vNVDIMM label emulation and live migration).
  3747. Also, we will map the backend-file with MAP_SYNC flag, which ensures the
  3748. file metadata is in sync for @option{mem-path} in case of host crash
  3749. or a power failure. MAP_SYNC requires support from both the host kernel
  3750. (since Linux kernel 4.15) and the filesystem of @option{mem-path} mounted
  3751. with DAX option.
  3752. @item -object memory-backend-ram,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave}
  3753. Creates a memory backend object, which can be used to back the guest RAM.
  3754. Memory backend objects offer more control than the @option{-m} option that is
  3755. traditionally used to define guest RAM. Please refer to
  3756. @option{memory-backend-file} for a description of the options.
  3757. @item -object memory-backend-memfd,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},seal=@var{on|off},hugetlb=@var{on|off},hugetlbsize=@var{size}
  3758. Creates an anonymous memory file backend object, which allows QEMU to
  3759. share the memory with an external process (e.g. when using
  3760. vhost-user). The memory is allocated with memfd and optional
  3761. sealing. (Linux only)
  3762. The @option{seal} option creates a sealed-file, that will block
  3763. further resizing the memory ('on' by default).
  3764. The @option{hugetlb} option specify the file to be created resides in
  3765. the hugetlbfs filesystem (since Linux 4.14). Used in conjunction with
  3766. the @option{hugetlb} option, the @option{hugetlbsize} option specify
  3767. the hugetlb page size on systems that support multiple hugetlb page
  3768. sizes (it must be a power of 2 value supported by the system).
  3769. In some versions of Linux, the @option{hugetlb} option is incompatible
  3770. with the @option{seal} option (requires at least Linux 4.16).
  3771. Please refer to @option{memory-backend-file} for a description of the
  3772. other options.
  3773. The @option{share} boolean option is @var{on} by default with memfd.
  3774. @item -object rng-builtin,id=@var{id}
  3775. Creates a random number generator backend which obtains entropy from
  3776. QEMU builtin functions. The @option{id} parameter is a unique ID that
  3777. will be used to reference this entropy backend from the @option{virtio-rng}
  3778. device. By default, the @option{virtio-rng} device uses this RNG backend.
  3779. @item -object rng-random,id=@var{id},filename=@var{/dev/random}
  3780. Creates a random number generator backend which obtains entropy from
  3781. a device on the host. The @option{id} parameter is a unique ID that
  3782. will be used to reference this entropy backend from the @option{virtio-rng}
  3783. device. The @option{filename} parameter specifies which file to obtain
  3784. entropy from and if omitted defaults to @option{/dev/urandom}.
  3785. @item -object rng-egd,id=@var{id},chardev=@var{chardevid}
  3786. Creates a random number generator backend which obtains entropy from
  3787. an external daemon running on the host. The @option{id} parameter is
  3788. a unique ID that will be used to reference this entropy backend from
  3789. the @option{virtio-rng} device. The @option{chardev} parameter is
  3790. the unique ID of a character device backend that provides the connection
  3791. to the RNG daemon.
  3792. @item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
  3793. Creates a TLS anonymous credentials object, which can be used to provide
  3794. TLS support on network backends. The @option{id} parameter is a unique
  3795. ID which network backends will use to access the credentials. The
  3796. @option{endpoint} is either @option{server} or @option{client} depending
  3797. on whether the QEMU network backend that uses the credentials will be
  3798. acting as a client or as a server. If @option{verify-peer} is enabled
  3799. (the default) then once the handshake is completed, the peer credentials
  3800. will be verified, though this is a no-op for anonymous credentials.
  3801. The @var{dir} parameter tells QEMU where to find the credential
  3802. files. For server endpoints, this directory may contain a file
  3803. @var{dh-params.pem} providing diffie-hellman parameters to use
  3804. for the TLS server. If the file is missing, QEMU will generate
  3805. a set of DH parameters at startup. This is a computationally
  3806. expensive operation that consumes random pool entropy, so it is
  3807. recommended that a persistent set of parameters be generated
  3808. upfront and saved.
  3809. @item -object tls-creds-psk,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/keys/dir}[,username=@var{username}]
  3810. Creates a TLS Pre-Shared Keys (PSK) credentials object, which can be used to provide
  3811. TLS support on network backends. The @option{id} parameter is a unique
  3812. ID which network backends will use to access the credentials. The
  3813. @option{endpoint} is either @option{server} or @option{client} depending
  3814. on whether the QEMU network backend that uses the credentials will be
  3815. acting as a client or as a server. For clients only, @option{username}
  3816. is the username which will be sent to the server. If omitted
  3817. it defaults to ``qemu''.
  3818. The @var{dir} parameter tells QEMU where to find the keys file.
  3819. It is called ``@var{dir}/keys.psk'' and contains ``username:key''
  3820. pairs. This file can most easily be created using the GnuTLS
  3821. @code{psktool} program.
  3822. For server endpoints, @var{dir} may also contain a file
  3823. @var{dh-params.pem} providing diffie-hellman parameters to use
  3824. for the TLS server. If the file is missing, QEMU will generate
  3825. a set of DH parameters at startup. This is a computationally
  3826. expensive operation that consumes random pool entropy, so it is
  3827. recommended that a persistent set of parameters be generated
  3828. up front and saved.
  3829. @item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},priority=@var{priority},verify-peer=@var{on|off},passwordid=@var{id}
  3830. Creates a TLS anonymous credentials object, which can be used to provide
  3831. TLS support on network backends. The @option{id} parameter is a unique
  3832. ID which network backends will use to access the credentials. The
  3833. @option{endpoint} is either @option{server} or @option{client} depending
  3834. on whether the QEMU network backend that uses the credentials will be
  3835. acting as a client or as a server. If @option{verify-peer} is enabled
  3836. (the default) then once the handshake is completed, the peer credentials
  3837. will be verified. With x509 certificates, this implies that the clients
  3838. must be provided with valid client certificates too.
  3839. The @var{dir} parameter tells QEMU where to find the credential
  3840. files. For server endpoints, this directory may contain a file
  3841. @var{dh-params.pem} providing diffie-hellman parameters to use
  3842. for the TLS server. If the file is missing, QEMU will generate
  3843. a set of DH parameters at startup. This is a computationally
  3844. expensive operation that consumes random pool entropy, so it is
  3845. recommended that a persistent set of parameters be generated
  3846. upfront and saved.
  3847. For x509 certificate credentials the directory will contain further files
  3848. providing the x509 certificates. The certificates must be stored
  3849. in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
  3850. @var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
  3851. @var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
  3852. For the @var{server-key.pem} and @var{client-key.pem} files which
  3853. contain sensitive private keys, it is possible to use an encrypted
  3854. version by providing the @var{passwordid} parameter. This provides
  3855. the ID of a previously created @code{secret} object containing the
  3856. password for decryption.
  3857. The @var{priority} parameter allows to override the global default
  3858. priority used by gnutls. This can be useful if the system administrator
  3859. needs to use a weaker set of crypto priorities for QEMU without
  3860. potentially forcing the weakness onto all applications. Or conversely
  3861. if one wants wants a stronger default for QEMU than for all other
  3862. applications, they can do this through this parameter. Its format is
  3863. a gnutls priority string as described at
  3864. @url{https://gnutls.org/manual/html_node/Priority-Strings.html}.
  3865. @item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}]
  3866. Interval @var{t} can't be 0, this filter batches the packet delivery: all
  3867. packets arriving in a given interval on netdev @var{netdevid} are delayed
  3868. until the end of the interval. Interval is in microseconds.
  3869. @option{status} is optional that indicate whether the netfilter is
  3870. on (enabled) or off (disabled), the default status for netfilter will be 'on'.
  3871. queue @var{all|rx|tx} is an option that can be applied to any netfilter.
  3872. @option{all}: the filter is attached both to the receive and the transmit
  3873. queue of the netdev (default).
  3874. @option{rx}: the filter is attached to the receive queue of the netdev,
  3875. where it will receive packets sent to the netdev.
  3876. @option{tx}: the filter is attached to the transmit queue of the netdev,
  3877. where it will receive packets sent by the netdev.
  3878. @item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support]
  3879. filter-mirror on netdev @var{netdevid},mirror net packet to chardev@var{chardevid}, if it has the vnet_hdr_support flag, filter-mirror will mirror packet with vnet_hdr_len.
  3880. @item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support]
  3881. filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
  3882. @var{chardevid},and redirect indev's packet to filter.if it has the vnet_hdr_support flag,
  3883. filter-redirector will redirect packet with vnet_hdr_len.
  3884. Create a filter-redirector we need to differ outdev id from indev id, id can not
  3885. be the same. we can just use indev or outdev, but at least one of indev or outdev
  3886. need to be specified.
  3887. @item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},queue=@var{all|rx|tx},[vnet_hdr_support]
  3888. Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
  3889. secondary from primary to keep secondary tcp connection,and rewrite
  3890. tcp packet to primary from secondary make tcp packet can be handled by
  3891. client.if it has the vnet_hdr_support flag, we can parse packet with vnet header.
  3892. usage:
  3893. colo secondary:
  3894. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3895. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3896. -object filter-rewriter,id=rew0,netdev=hn0,queue=all
  3897. @item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
  3898. Dump the network traffic on netdev @var{dev} to the file specified by
  3899. @var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
  3900. The file format is libpcap, so it can be analyzed with tools such as tcpdump
  3901. or Wireshark.
  3902. @item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid},iothread=@var{id}[,vnet_hdr_support][,notify_dev=@var{id}]
  3903. Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
  3904. secondary packet. If the packets are same, we will output primary
  3905. packet to outdev@var{chardevid}, else we will notify colo-frame
  3906. do checkpoint and send primary packet to outdev@var{chardevid}.
  3907. In order to improve efficiency, we need to put the task of comparison
  3908. in another thread. If it has the vnet_hdr_support flag, colo compare
  3909. will send/recv packet with vnet_hdr_len.
  3910. If you want to use Xen COLO, will need the notify_dev to notify Xen
  3911. colo-frame to do checkpoint.
  3912. we must use it with the help of filter-mirror and filter-redirector.
  3913. @example
  3914. KVM COLO
  3915. primary:
  3916. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  3917. -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
  3918. -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
  3919. -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
  3920. -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
  3921. -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
  3922. -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
  3923. -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
  3924. -object iothread,id=iothread1
  3925. -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
  3926. -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
  3927. -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
  3928. -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
  3929. secondary:
  3930. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
  3931. -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
  3932. -chardev socket,id=red0,host=3.3.3.3,port=9003
  3933. -chardev socket,id=red1,host=3.3.3.3,port=9004
  3934. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3935. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3936. Xen COLO
  3937. primary:
  3938. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  3939. -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
  3940. -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
  3941. -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
  3942. -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
  3943. -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
  3944. -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
  3945. -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
  3946. -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
  3947. -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
  3948. -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
  3949. -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
  3950. -object iothread,id=iothread1
  3951. -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
  3952. secondary:
  3953. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
  3954. -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
  3955. -chardev socket,id=red0,host=3.3.3.3,port=9003
  3956. -chardev socket,id=red1,host=3.3.3.3,port=9004
  3957. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3958. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3959. @end example
  3960. If you want to know the detail of above command line, you can read
  3961. the colo-compare git log.
  3962. @item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
  3963. Creates a cryptodev backend which executes crypto opreation from
  3964. the QEMU cipher APIS. The @var{id} parameter is
  3965. a unique ID that will be used to reference this cryptodev backend from
  3966. the @option{virtio-crypto} device. The @var{queues} parameter is optional,
  3967. which specify the queue number of cryptodev backend, the default of
  3968. @var{queues} is 1.
  3969. @example
  3970. # @value{qemu_system} \
  3971. [...] \
  3972. -object cryptodev-backend-builtin,id=cryptodev0 \
  3973. -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
  3974. [...]
  3975. @end example
  3976. @item -object cryptodev-vhost-user,id=@var{id},chardev=@var{chardevid}[,queues=@var{queues}]
  3977. Creates a vhost-user cryptodev backend, backed by a chardev @var{chardevid}.
  3978. The @var{id} parameter is a unique ID that will be used to reference this
  3979. cryptodev backend from the @option{virtio-crypto} device.
  3980. The chardev should be a unix domain socket backed one. The vhost-user uses
  3981. a specifically defined protocol to pass vhost ioctl replacement messages
  3982. to an application on the other end of the socket.
  3983. The @var{queues} parameter is optional, which specify the queue number
  3984. of cryptodev backend for multiqueue vhost-user, the default of @var{queues} is 1.
  3985. @example
  3986. # @value{qemu_system} \
  3987. [...] \
  3988. -chardev socket,id=chardev0,path=/path/to/socket \
  3989. -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
  3990. -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
  3991. [...]
  3992. @end example
  3993. @item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
  3994. @item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
  3995. Defines a secret to store a password, encryption key, or some other sensitive
  3996. data. The sensitive data can either be passed directly via the @var{data}
  3997. parameter, or indirectly via the @var{file} parameter. Using the @var{data}
  3998. parameter is insecure unless the sensitive data is encrypted.
  3999. The sensitive data can be provided in raw format (the default), or base64.
  4000. When encoded as JSON, the raw format only supports valid UTF-8 characters,
  4001. so base64 is recommended for sending binary data. QEMU will convert from
  4002. which ever format is provided to the format it needs internally. eg, an
  4003. RBD password can be provided in raw format, even though it will be base64
  4004. encoded when passed onto the RBD sever.
  4005. For added protection, it is possible to encrypt the data associated with
  4006. a secret using the AES-256-CBC cipher. Use of encryption is indicated
  4007. by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
  4008. parameter provides the ID of a previously defined secret that contains
  4009. the AES-256 decryption key. This key should be 32-bytes long and be
  4010. base64 encoded. The @var{iv} parameter provides the random initialization
  4011. vector used for encryption of this particular secret and should be a
  4012. base64 encrypted string of the 16-byte IV.
  4013. The simplest (insecure) usage is to provide the secret inline
  4014. @example
  4015. # @value{qemu_system} -object secret,id=sec0,data=letmein,format=raw
  4016. @end example
  4017. The simplest secure usage is to provide the secret via a file
  4018. # printf "letmein" > mypasswd.txt
  4019. # @value{qemu_system} -object secret,id=sec0,file=mypasswd.txt,format=raw
  4020. For greater security, AES-256-CBC should be used. To illustrate usage,
  4021. consider the openssl command line tool which can encrypt the data. Note
  4022. that when encrypting, the plaintext must be padded to the cipher block
  4023. size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
  4024. First a master key needs to be created in base64 encoding:
  4025. @example
  4026. # openssl rand -base64 32 > key.b64
  4027. # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
  4028. @end example
  4029. Each secret to be encrypted needs to have a random initialization vector
  4030. generated. These do not need to be kept secret
  4031. @example
  4032. # openssl rand -base64 16 > iv.b64
  4033. # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
  4034. @end example
  4035. The secret to be defined can now be encrypted, in this case we're
  4036. telling openssl to base64 encode the result, but it could be left
  4037. as raw bytes if desired.
  4038. @example
  4039. # SECRET=$(printf "letmein" |
  4040. openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
  4041. @end example
  4042. When launching QEMU, create a master secret pointing to @code{key.b64}
  4043. and specify that to be used to decrypt the user password. Pass the
  4044. contents of @code{iv.b64} to the second secret
  4045. @example
  4046. # @value{qemu_system} \
  4047. -object secret,id=secmaster0,format=base64,file=key.b64 \
  4048. -object secret,id=sec0,keyid=secmaster0,format=base64,\
  4049. data=$SECRET,iv=$(<iv.b64)
  4050. @end example
  4051. @item -object sev-guest,id=@var{id},cbitpos=@var{cbitpos},reduced-phys-bits=@var{val},[sev-device=@var{string},policy=@var{policy},handle=@var{handle},dh-cert-file=@var{file},session-file=@var{file}]
  4052. Create a Secure Encrypted Virtualization (SEV) guest object, which can be used
  4053. to provide the guest memory encryption support on AMD processors.
  4054. When memory encryption is enabled, one of the physical address bit (aka the
  4055. C-bit) is utilized to mark if a memory page is protected. The @option{cbitpos}
  4056. is used to provide the C-bit position. The C-bit position is Host family dependent
  4057. hence user must provide this value. On EPYC, the value should be 47.
  4058. When memory encryption is enabled, we loose certain bits in physical address space.
  4059. The @option{reduced-phys-bits} is used to provide the number of bits we loose in
  4060. physical address space. Similar to C-bit, the value is Host family dependent.
  4061. On EPYC, the value should be 5.
  4062. The @option{sev-device} provides the device file to use for communicating with
  4063. the SEV firmware running inside AMD Secure Processor. The default device is
  4064. '/dev/sev'. If hardware supports memory encryption then /dev/sev devices are
  4065. created by CCP driver.
  4066. The @option{policy} provides the guest policy to be enforced by the SEV firmware
  4067. and restrict what configuration and operational commands can be performed on this
  4068. guest by the hypervisor. The policy should be provided by the guest owner and is
  4069. bound to the guest and cannot be changed throughout the lifetime of the guest.
  4070. The default is 0.
  4071. If guest @option{policy} allows sharing the key with another SEV guest then
  4072. @option{handle} can be use to provide handle of the guest from which to share
  4073. the key.
  4074. The @option{dh-cert-file} and @option{session-file} provides the guest owner's
  4075. Public Diffie-Hillman key defined in SEV spec. The PDH and session parameters
  4076. are used for establishing a cryptographic session with the guest owner to
  4077. negotiate keys used for attestation. The file must be encoded in base64.
  4078. e.g to launch a SEV guest
  4079. @example
  4080. # @value{qemu_system_x86} \
  4081. ......
  4082. -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \
  4083. -machine ...,memory-encryption=sev0
  4084. .....
  4085. @end example
  4086. @item -object authz-simple,id=@var{id},identity=@var{string}
  4087. Create an authorization object that will control access to network services.
  4088. The @option{identity} parameter is identifies the user and its format
  4089. depends on the network service that authorization object is associated
  4090. with. For authorizing based on TLS x509 certificates, the identity must
  4091. be the x509 distinguished name. Note that care must be taken to escape
  4092. any commas in the distinguished name.
  4093. An example authorization object to validate a x509 distinguished name
  4094. would look like:
  4095. @example
  4096. # @value{qemu_system} \
  4097. ...
  4098. -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \
  4099. ...
  4100. @end example
  4101. Note the use of quotes due to the x509 distinguished name containing
  4102. whitespace, and escaping of ','.
  4103. @item -object authz-listfile,id=@var{id},filename=@var{path},refresh=@var{yes|no}
  4104. Create an authorization object that will control access to network services.
  4105. The @option{filename} parameter is the fully qualified path to a file
  4106. containing the access control list rules in JSON format.
  4107. An example set of rules that match against SASL usernames might look
  4108. like:
  4109. @example
  4110. @{
  4111. "rules": [
  4112. @{ "match": "fred", "policy": "allow", "format": "exact" @},
  4113. @{ "match": "bob", "policy": "allow", "format": "exact" @},
  4114. @{ "match": "danb", "policy": "deny", "format": "glob" @},
  4115. @{ "match": "dan*", "policy": "allow", "format": "exact" @},
  4116. ],
  4117. "policy": "deny"
  4118. @}
  4119. @end example
  4120. When checking access the object will iterate over all the rules and
  4121. the first rule to match will have its @option{policy} value returned
  4122. as the result. If no rules match, then the default @option{policy}
  4123. value is returned.
  4124. The rules can either be an exact string match, or they can use the
  4125. simple UNIX glob pattern matching to allow wildcards to be used.
  4126. If @option{refresh} is set to true the file will be monitored
  4127. and automatically reloaded whenever its content changes.
  4128. As with the @code{authz-simple} object, the format of the identity
  4129. strings being matched depends on the network service, but is usually
  4130. a TLS x509 distinguished name, or a SASL username.
  4131. An example authorization object to validate a SASL username
  4132. would look like:
  4133. @example
  4134. # @value{qemu_system} \
  4135. ...
  4136. -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes
  4137. ...
  4138. @end example
  4139. @item -object authz-pam,id=@var{id},service=@var{string}
  4140. Create an authorization object that will control access to network services.
  4141. The @option{service} parameter provides the name of a PAM service to use
  4142. for authorization. It requires that a file @code{/etc/pam.d/@var{service}}
  4143. exist to provide the configuration for the @code{account} subsystem.
  4144. An example authorization object to validate a TLS x509 distinguished
  4145. name would look like:
  4146. @example
  4147. # @value{qemu_system} \
  4148. ...
  4149. -object authz-pam,id=auth0,service=qemu-vnc
  4150. ...
  4151. @end example
  4152. There would then be a corresponding config file for PAM at
  4153. @code{/etc/pam.d/qemu-vnc} that contains:
  4154. @example
  4155. account requisite pam_listfile.so item=user sense=allow \
  4156. file=/etc/qemu/vnc.allow
  4157. @end example
  4158. Finally the @code{/etc/qemu/vnc.allow} file would contain
  4159. the list of x509 distingished names that are permitted
  4160. access
  4161. @example
  4162. CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
  4163. @end example
  4164. @end table
  4165. ETEXI
  4166. HXCOMM This is the last statement. Insert new options before this line!
  4167. STEXI
  4168. @end table
  4169. ETEXI