qemu-options.hx 227 KB

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