qemu-options.hx 247 KB

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