[QEMU]標(biāo)準(zhǔn)選項(xiàng)(2)

-add-fd?fd=fd,set=set[,opaque=opaque]
將文件描述符添加到 fd 集。有效選項(xiàng)包括:
fd=fd
此選項(xiàng)定義將其副本添加到 fd 集的文件描述符。文件描述符不能是 stdin、stdout 或 stderr。
set=set
此選項(xiàng)定義要向其添加文件描述符的 fd 集的 ID。
opaque=opaque
此選項(xiàng)定義可用于描述 fd 的自由格式字符串。
您可以使用 fd 集中預(yù)先打開的文件描述符打開圖像:
qemu-system-x86_64 \ -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \ -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \ -drive file=/dev/fdset/2,index=0,media=disk-set?group.id.arg=value
為類型組的項(xiàng)目 ID 設(shè)置參數(shù) arg
-global?driver.prop=value
-global?driver=driver,property=property,value=value
將驅(qū)動(dòng)程序?qū)傩?prop 的默認(rèn)值設(shè)置為值,例如:
qemu-system-x86_64 -global ide-hd.physical_block_size=4096 disk-image.img特別是,您可以使用它來設(shè)置由計(jì)算機(jī)模型自動(dòng)創(chuàng)建的設(shè)備的驅(qū)動(dòng)程序?qū)傩?。要?jiǎng)?chuàng)建不是自動(dòng)創(chuàng)建的設(shè)備并在其上設(shè)置屬性,請(qǐng)使用 -。
device
-global driver.prop=value 是 -global driver=driver,property=prop,value=value 的簡(jiǎn)寫。即使驅(qū)動(dòng)程序包含點(diǎn),長(zhǎng)手語法也有效。
-boot?[order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]
將啟動(dòng)順序驅(qū)動(dòng)器指定為一串驅(qū)動(dòng)器號(hào)。有效的驅(qū)動(dòng)器號(hào)取決于目標(biāo)體系結(jié)構(gòu)。x86 PC使用:a,b(軟盤1和2),c(第一個(gè)硬盤),d(第一個(gè)CD-ROM),n-p(從網(wǎng)絡(luò)適配器1-4的Etherboot),硬盤啟動(dòng)是默認(rèn)的。要僅在首次啟動(dòng)時(shí)應(yīng)用特定的引導(dǎo)順序,請(qǐng)通過 指定該順序。請(qǐng)注意,or 參數(shù)不應(yīng)與設(shè)備的屬性一起使用,因?yàn)楣碳?shí)現(xiàn)通常不支持同時(shí)支持這兩者。
once
order
once
bootindex
交互式啟動(dòng)菜單/提示可以通過固件/BIOS 支持它們來啟用。默認(rèn)值為非交互式引導(dǎo)。
menu=on
當(dāng)給出選項(xiàng)splash=sp_name并且men=on(如果固件/BIOS支持它們)時(shí),可以將啟動(dòng)圖片傳遞給bios,使用戶能夠?qū)⑵滹@示為徽標(biāo)。目前 Seabios for X86 系統(tǒng)支持它。限制:?jiǎn)?dòng)文件可以是 jpeg 文件或 24 BPP 格式(真彩色)的 BMP 文件。SVGA模式應(yīng)支持分辨率,因此建議為320x240,640x480,800x640。
超時(shí)可能會(huì)傳遞到 bios,當(dāng)啟動(dòng)失敗時(shí),來賓將暫停 rb_timeout 毫秒,然后重新啟動(dòng)。如果rb_timeout為“-1”,則來賓將不會(huì)重新啟動(dòng),qemu默認(rèn)將“-1”傳遞給bios。目前 Seabios for X86 系統(tǒng)支持它。
在固件/BIOS支持的范圍內(nèi)進(jìn)行嚴(yán)格引導(dǎo)。僅當(dāng)引導(dǎo)索引選項(xiàng)更改引導(dǎo)優(yōu)先級(jí)時(shí),這才會(huì)起作用。默認(rèn)值為非嚴(yán)格引導(dǎo)。
# try to boot from network first, then from hard disk qemu-system-x86_64 -boot order=nc # boot from CD-ROM first, switch back to default order after reboot qemu-system-x86_64 -boot once=d # boot with a splash picture for 5 seconds. qemu-system-x86_64 -boot menu=on,splash=/root/boot.bmp,splash-time=5000strict=on
注意:仍然支持舊格式“-boot drives”,但不鼓勵(lì)使用它,因?yàn)樗赡軙?huì)從將來的版本中刪除。
-m?[size=]megs[,slots=n,maxmem=size]
將客戶機(jī)啟動(dòng) RAM 大小設(shè)置為兆兆字節(jié)。默認(rèn)值為 128 MiB?;蛘撸缶Y“M”或“G”分別用于表示以兆字節(jié)或千兆字節(jié)為單位的值??蛇x的對(duì)插槽,maxmem可用于設(shè)置熱插拔內(nèi)存插槽的數(shù)量和最大內(nèi)存量。請(qǐng)注意,maxmem 必須與頁面大小對(duì)齊。
例如,以下命令行將客戶機(jī)啟動(dòng) RAM 大小設(shè)置為 1GB,創(chuàng)建 3 個(gè)插槽以熱插拔額外內(nèi)存,并將客戶機(jī)可以達(dá)到的最大內(nèi)存設(shè)置為 4GB:
qemu-system-x86_64 -m 1G,slots=3,maxmem=4G如果未指定插槽和 maxmem,則不會(huì)啟用內(nèi)存熱插拔,并且客戶機(jī)啟動(dòng) RAM 永遠(yuǎn)不會(huì)增加。
-mem-path?path
從路徑中臨時(shí)創(chuàng)建的文件分配客戶機(jī) RAM。
-mem-prealloc
使用 -mem-path 時(shí)預(yù)分配內(nèi)存。
-k?language
使用鍵盤布局語言(例如法語)。只有在不容易獲取原始PC密鑰代碼的情況下才需要此選項(xiàng)(例如,在Mac上,某些X11服務(wù)器或VNC或詛咒顯示器上)。您通常不需要在PC / Linux或PC / Windows主機(jī)上使用它。
fr
可用的布局包括:
ar ?de-ch ?es ?fo ? ? fr-ca ?hu ?ja ?mk ? ? no ?pt-br ?svda ?en-gb ?et ?fr ? ? fr-ch ?is ?lt ?nl ? ? pl ?ru ? ? thde ?en-us ?fi ?fr-be ?hr ? ? it ?lv ?nl-be ?pt ?sl ? ? tr缺省值為 。
en-us
-audio-help
將顯示當(dāng)前指定(已棄用)的環(huán)境變量的等效 -audiodev。
-audio?[driver=]driver,model=value[,prop[=value][,...]]
此選項(xiàng)是用于一次性配置來賓音頻硬件和主機(jī)音頻后端的快捷方式。主機(jī)后端選項(xiàng)與下面的相應(yīng)選項(xiàng)相同??蛻魴C(jī)硬件型號(hào)可以使用 設(shè)置。用于列出可用的設(shè)備類型。
-audiodev
model=modelname
model=help
以下兩個(gè)示例執(zhí)行完全相同操作,以演示如何使用命令行長(zhǎng)度:
qemu-system-x86_64 -audiodev pa,id=pa -device sb16,audiodev=pa qemu-system-x86_64 -audio pa,model=sb16-audio
-audiodev?[driver=]driver,id=id[,prop[=value][,...]]
添加由 id 標(biāo)識(shí)的新音頻后端驅(qū)動(dòng)程序。存在全局屬性和驅(qū)動(dòng)程序特定的屬性。對(duì)于輸入和輸出,可以對(duì)某些值進(jìn)行不同的設(shè)置,它們用 .可以使用 設(shè)置輸入的屬性,并使用 設(shè)置輸出的屬性。例如:
-audiodev alsa,id=example,in.frequency=44110,out.frequency=8000-audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecifiedin|out.
in.prop
out.prop
注意:已知參數(shù)驗(yàn)證不完整,在許多情況下,指定無效選項(xiàng)會(huì)導(dǎo)致 QEMU 打印錯(cuò)誤消息并繼續(xù)仿真,而不會(huì)發(fā)出聲音。
有效的全局選項(xiàng)包括:
id=identifier
標(biāo)識(shí)音頻后端。
timer-period=period
設(shè)置音頻子系統(tǒng)使用的計(jì)時(shí)器周期(以微秒為單位)。默認(rèn)值為 10000(10 毫秒)。
in|out.mixing-engine=on|off
使用QEMU的混音引擎混合QEMU內(nèi)的所有流,并在后端不支持時(shí)轉(zhuǎn)換音頻格式。關(guān)閉時(shí),固定設(shè)置也必須關(guān)閉。請(qǐng)注意,禁用此選項(xiàng)意味著所選后端必須支持多個(gè)流和虛擬卡使用的音頻格式,否則您將無法獲得聲音。除非您要使用 5.1 或 7.1 音頻,否則不建議禁用此選項(xiàng),因?yàn)榛煲粢鎯H支持單聲道和立體聲音頻。默認(rèn)值為打開。
in|out.fixed-settings=on|off
對(duì)主機(jī)音頻使用固定設(shè)置。關(guān)閉時(shí),它將根據(jù)客人打開聲卡的方式而變化。在這種情況下,您不得指定頻率、通道或格式。默認(rèn)值為打開。
in|out.frequency=frequency
指定使用固定設(shè)置時(shí)要使用的頻率。默認(rèn)值為 44100Hz。
in|out.channels=channels
指定使用固定設(shè)置時(shí)要使用的通道數(shù)。默認(rèn)值為 2(立體聲)。
in|out.format=format
指定使用固定設(shè)置時(shí)要使用的示例格式。有效值為:、 、 、 、 、 、 。默認(rèn)值為 。
s8
s16
s32
u8
u16
u32
f32
s16
in|out.voices=voices
指定要使用的語音數(shù)。默認(rèn)值為 1。
in|out.buffer-length=usecs
設(shè)置緩沖區(qū)的大?。ㄒ晕⒚霝閱挝唬?。
-audiodev?none,id=id[,prop[=value][,...]]
創(chuàng)建放棄所有輸出的虛擬后端。此后端沒有特定于后端的屬性。
-audiodev?alsa,id=id[,prop[=value][,...]]
Creates backend using the ALSA. This backend is only available on Linux.
ALSA specific options are:
in|out.dev=device
Specify the ALSA device to use for input and/or output. Default is?.
default
in|out.period-length=usecs
Sets the period length in microseconds.
in|out.try-poll=on|off
Attempt to use poll mode with the device. Default is on.
threshold=threshold
Threshold (in microseconds) when playback starts. Default is 0.
-audiodev?coreaudio,id=id[,prop[=value][,...]]
Creates a backend using Apple’s Core Audio. This backend is only available on Mac OS and only supports playback.
Core Audio specific options are:
in|out.buffer-count=count
Sets the count of the buffers.
-audiodev?dsound,id=id[,prop[=value][,...]]
Creates a backend using Microsoft’s DirectSound. This backend is only available on Windows and only supports playback.
DirectSound specific options are:
latency=usecs
Add extra usecs microseconds latency to playback. Default is 10000 (10 ms).
-audiodev?oss,id=id[,prop[=value][,...]]
Creates a backend using OSS. This backend is available on most Unix-like systems.
OSS specific options are:
in|out.dev=device
Specify the file name of the OSS device to use. Default is?.
/dev/dsp
in|out.buffer-count=count
Sets the count of the buffers.
in|out.try-poll=on|of
Attempt to use poll mode with the device. Default is on.
try-mmap=on|off
Try using memory mapped device access. Default is off.
exclusive=on|off
Open the device in exclusive mode (vmix won’t work in this case). Default is off.
dsp-policy=policy
Sets the timing policy (between 0 and 10, where smaller number means smaller latency but higher CPU usage). Use -1 to use buffer sizes specified by?and?. This option is ignored if you do not have OSS 4. Default is 5.
buffer
buffer-count
-audiodev?pa,id=id[,prop[=value][,...]]
Creates a backend using PulseAudio. This backend is available on most systems.
PulseAudio specific options are:
server=server
Sets the PulseAudio server to connect to.
in|out.name=sink
Use the specified source/sink for recording/playback.
in|out.latency=usecs
Desired latency in microseconds. The PulseAudio server will try to honor this value but actual latencies may be lower or higher.
-audiodev?sdl,id=id[,prop[=value][,...]]
Creates a backend using SDL. This backend is available on most systems, but you should use your platform’s native backend if possible.
SDL specific options are:
in|out.buffer-count=count
Sets the count of the buffers.
-audiodev?spice,id=id[,prop[=value][,...]]
Creates a backend that sends audio through SPICE. This backend requires?and automatically selected in that case, so usually you can ignore this option. This backend has no backend specific properties.
-spice
-audiodev?wav,id=id[,prop[=value][,...]]
Creates a backend that writes audio to a WAV file.
Backend specific options are:
path=path
Write recorded audio into the specified file. Default is?.
qemu.wav
-device?driver[,prop[=value][,...]]
Add device driver. prop=value sets driver properties. Valid properties depend on the driver. To get help on possible drivers and properties, use?and?.
-device?help
-device?driver,help
Some drivers are:
-device?ipmi-bmc-sim,id=id[,prop[=value][,...]]
Add an IPMI BMC. This is a simulation of a hardware management interface processor that normally sits on a system. It provides a watchdog and the ability to reset and power control the system. You need to connect this to an IPMI interface to make it useful
The IPMI slave address to use for the BMC. The default is 0x20. This address is the BMC’s address on the I2C network of management controllers. If you don’t know what this means, it is safe to ignore it.
id=id
The BMC id for interfaces to use this device.
slave_addr=val
Define slave address to use for the BMC. The default is 0x20.
sdrfile=file
file containing raw Sensor Data Records (SDR) data. The default is none.
fruareasize=val
size of a Field Replaceable Unit (FRU) area. The default is 1024.
frudatafile=file
file containing raw Field Replaceable Unit (FRU) inventory data. The default is none.
guid=uuid
value for the GUID for the BMC, in standard UUID format. If this is set, get “Get GUID” command to the BMC will return it. Otherwise “Get GUID” will return an error.
-device?ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]
Add a connection to an external IPMI BMC simulator. Instead of locally emulating the BMC like the above item, instead connect to an external entity that provides the IPMI services.
A connection is made to an external BMC simulator. If you do this, it is strongly recommended that you use the “reconnect=” chardev option to reconnect to the simulator if the connection is lost. Note that if this is not used carefully, it can be a security issue, as the interface has the ability to send resets, NMIs, and power off the VM. It’s best if QEMU makes a connection to an external simulator running on a secure port on localhost, so neither the simulator nor QEMU is exposed to any outside network.
See the “l(fā)anserv/README.vm” file in the OpenIPMI library for more details on the external interface.
-device?isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]
Add a KCS IPMI interafce on the ISA bus. This also adds a corresponding ACPI and SMBIOS entries, if appropriate.
bmc=id
The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
ioport=val
Define the I/O address of the interface. The default is 0xca0 for KCS.
irq=val
Define the interrupt to use. The default is 5. To disable interrupts, set this to 0.
-device?isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]
Like the KCS interface, but defines a BT interface. The default port is 0xe4 and the default interrupt is 5.
-device?pci-ipmi-kcs,bmc=id
Add a KCS IPMI interafce on the PCI bus.
bmc=id
The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
-device?pci-ipmi-bt,bmc=id
Like the KCS interface, but defines a BT interface on the PCI bus.
-device?intel-iommu[,option=...]
This is only supported by?, which will enable Intel VT-d emulation within the guest. It supports below options:
-machine?q35
intremap=on|off
?(default: auto)This enables interrupt remapping feature. It’s required to enable complete x2apic. Currently it only supports kvm kernel-irqchip modes?or?, while full kernel-irqchip is not yet supported. The default value is “auto”, which will be decided by the mode of kernel-irqchip.
off
split
caching-mode=on|off
?(default: off)This enables caching mode for the VT-d emulated device. When caching-mode is enabled, each guest DMA buffer mapping will generate an IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in a synchronous way. It is required for?to work with the VT-d device, because host assigned devices requires to setup the DMA mapping on the host before guest DMA starts.
-device?vfio-pci
device-iotlb=on|off
?(default: off)This enables device-iotlb capability for the emulated VT-d device. So far virtio/vhost should be the only real user for this parameter, paired with ats=on configured for the device.
aw-bits=39|48
?(default: 39)This decides the address width of IOVA address space. The address space has 39 bits width for 3-level IOMMU page tables, and 48 bits for 4-level IOMMU page tables.
另請(qǐng)參閱 wiki 頁面,了解 QEMU 中 VT-d 仿真的一般場(chǎng)景:https://wiki.qemu.org/Features/VT-d。
-name?name
設(shè)置來賓的名稱。此名稱將顯示在 SDL 窗口標(biāo)題中。該名稱還將用于 VNC 服務(wù)器。還可以選擇在 Linux 中設(shè)置頂部可見進(jìn)程名稱。還可以在 Linux 上啟用單個(gè)線程的命名以幫助調(diào)試。
-uuid?uuid
設(shè)置系統(tǒng) UUID。