qemu-options.hx 239 KB

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