qemu-options.hx 175 KB

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