qemu-options.hx 249 KB

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