[QEMU]标准选项(2)

-add-fd fd=fd,set=set[,opaque=opaque]
将文件描述符添加到 fd 集。有效选项包括:
fd=fd
此选项定义将其副本添加到 fd 集的文件描述符。文件描述符不能是 stdin、stdout 或 stderr。
set=set
此选项定义要向其添加文件描述符的 fd 集的 ID。
opaque=opaque
此选项定义可用于描述 fd 的自由格式字符串。
您可以使用 fd 集中预先打开的文件描述符打开图像:
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
为类型组的项目 ID 设置参数 arg
-global driver.prop=value
-global driver=driver,property=property,value=value
将驱动程序属性 prop 的默认值设置为值,例如:
qemu-system-x86_64 -global ide-hd.physical_block_size=4096 disk-image.img特别是,您可以使用它来设置由计算机模型自动创建的设备的驱动程序属性。要创建不是自动创建的设备并在其上设置属性,请使用 -。
device
-global driver.prop=value 是 -global driver=driver,property=prop,value=value 的简写。即使驱动程序包含点,长手语法也有效。
-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]
将启动顺序驱动器指定为一串驱动器号。有效的驱动器号取决于目标体系结构。x86 PC使用:a,b(软盘1和2),c(第一个硬盘),d(第一个CD-ROM),n-p(从网络适配器1-4的Etherboot),硬盘启动是默认的。要仅在首次启动时应用特定的引导顺序,请通过 指定该顺序。请注意,or 参数不应与设备的属性一起使用,因为固件实现通常不支持同时支持这两者。
once
order
once
bootindex
交互式启动菜单/提示可以通过固件/BIOS 支持它们来启用。默认值为非交互式引导。
menu=on
当给出选项splash=sp_name并且men=on(如果固件/BIOS支持它们)时,可以将启动图片传递给bios,使用户能够将其显示为徽标。目前 Seabios for X86 系统支持它。限制:启动文件可以是 jpeg 文件或 24 BPP 格式(真彩色)的 BMP 文件。SVGA模式应支持分辨率,因此建议为320x240,640x480,800x640。
超时可能会传递到 bios,当启动失败时,来宾将暂停 rb_timeout 毫秒,然后重新启动。如果rb_timeout为“-1”,则来宾将不会重新启动,qemu默认将“-1”传递给bios。目前 Seabios for X86 系统支持它。
在固件/BIOS支持的范围内进行严格引导。仅当引导索引选项更改引导优先级时,这才会起作用。默认值为非严格引导。
# 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”,但不鼓励使用它,因为它可能会从将来的版本中删除。
-m [size=]megs[,slots=n,maxmem=size]
将客户机启动 RAM 大小设置为兆兆字节。默认值为 128 MiB。或者,后缀“M”或“G”分别用于表示以兆字节或千兆字节为单位的值。可选的对插槽,maxmem可用于设置热插拔内存插槽的数量和最大内存量。请注意,maxmem 必须与页面大小对齐。
例如,以下命令行将客户机启动 RAM 大小设置为 1GB,创建 3 个插槽以热插拔额外内存,并将客户机可以达到的最大内存设置为 4GB:
qemu-system-x86_64 -m 1G,slots=3,maxmem=4G如果未指定插槽和 maxmem,则不会启用内存热插拔,并且客户机启动 RAM 永远不会增加。
-mem-path path
从路径中临时创建的文件分配客户机 RAM。
-mem-prealloc
使用 -mem-path 时预分配内存。
-k language
使用键盘布局语言(例如法语)。只有在不容易获取原始PC密钥代码的情况下才需要此选项(例如,在Mac上,某些X11服务器或VNC或诅咒显示器上)。您通常不需要在PC / Linux或PC / Windows主机上使用它。
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
将显示当前指定(已弃用)的环境变量的等效 -audiodev。
-audio [driver=]driver,model=value[,prop[=value][,...]]
此选项是用于一次性配置来宾音频硬件和主机音频后端的快捷方式。主机后端选项与下面的相应选项相同。客户机硬件型号可以使用 设置。用于列出可用的设备类型。
-audiodev
model=modelname
model=help
以下两个示例执行完全相同操作,以演示如何使用命令行长度:
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 标识的新音频后端驱动程序。存在全局属性和驱动程序特定的属性。对于输入和输出,可以对某些值进行不同的设置,它们用 .可以使用 设置输入的属性,并使用 设置输出的属性。例如:
-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
注意:已知参数验证不完整,在许多情况下,指定无效选项会导致 QEMU 打印错误消息并继续仿真,而不会发出声音。
有效的全局选项包括:
id=identifier
标识音频后端。
timer-period=period
设置音频子系统使用的计时器周期(以微秒为单位)。默认值为 10000(10 毫秒)。
in|out.mixing-engine=on|off
使用QEMU的混音引擎混合QEMU内的所有流,并在后端不支持时转换音频格式。关闭时,固定设置也必须关闭。请注意,禁用此选项意味着所选后端必须支持多个流和虚拟卡使用的音频格式,否则您将无法获得声音。除非您要使用 5.1 或 7.1 音频,否则不建议禁用此选项,因为混音引擎仅支持单声道和立体声音频。默认值为打开。
in|out.fixed-settings=on|off
对主机音频使用固定设置。关闭时,它将根据客人打开声卡的方式而变化。在这种情况下,您不得指定频率、通道或格式。默认值为打开。
in|out.frequency=frequency
指定使用固定设置时要使用的频率。默认值为 44100Hz。
in|out.channels=channels
指定使用固定设置时要使用的通道数。默认值为 2(立体声)。
in|out.format=format
指定使用固定设置时要使用的示例格式。有效值为:、 、 、 、 、 、 。默认值为 。
s8
s16
s32
u8
u16
u32
f32
s16
in|out.voices=voices
指定要使用的语音数。默认值为 1。
in|out.buffer-length=usecs
设置缓冲区的大小(以微秒为单位)。
-audiodev none,id=id[,prop[=value][,...]]
创建放弃所有输出的虚拟后端。此后端没有特定于后端的属性。
-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 “lanserv/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.
另请参阅 wiki 页面,了解 QEMU 中 VT-d 仿真的一般场景:https://wiki.qemu.org/Features/VT-d。
-name name
设置来宾的名称。此名称将显示在 SDL 窗口标题中。该名称还将用于 VNC 服务器。还可以选择在 Linux 中设置顶部可见进程名称。还可以在 Linux 上启用单个线程的命名以帮助调试。
-uuid uuid
设置系统 UUID。