qemu-options.hx 260 KB

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