qemu-options.hx 263 KB

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