qemu-options.hx 265 KB

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