2
0

qemu-options.hx 211 KB

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