qemu-options.hx 237 KB

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