qemu-options.hx 214 KB

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