qemu的drive参数解释
- drive参数很简单,可以理解成是定义了一个实际的硬盘(或者是cd)与drive对应的是device-drive option[,option[,option[,...]]]
-
Define a new drive. This includes creating a block driver node (the backend) as well as a guest device, and is mostly a shortcut for defining the corresponding-blockdev and -device options.
定义一个新的驱动,包括后端的驱动节点(可以理解成后端具体的设备)还有guest文件系统中的一个具体的设备。
-driveaccepts all options that are accepted by-blockdev. In addition, it knows the following options:
- file=file
-
This option defines which disk image (see disk_images) to use with this drive. If the filename contains comma, you must double it (for instance, "file=my,,file" to use file "my,file").
Special files such as iSCSI devices can be specified using protocol specific URLs. See the section for "Device URL Syntax" for more information.
- if=interface
-
This option defines on which type on interface the drive is connected. Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none.
- bus=bus,unit=unit
-
These options define where is connected the drive by defining the bus number and the unit id.
- index=index
-
This option defines where is connected the drive by using an index in the list of available connectors of a given interface type.
- media=media
-
This option defines the type of the media: disk or cdrom.
- cyls=c,heads=h,secs=s[,trans=t]
-
These options have the same definition as they have in-hdachs. These parameters are deprecated, use the corresponding parameters of
-deviceinstead. - snapshot=snapshot
-
snapshot is "on" or "off" and controls snapshot mode for the given drive (see-snapshot).
- cache=cache
-
cache is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data. This is a shortcut that sets thecache.directandcache.no-flushoptions (as in-blockdev), and additionallycache.writeback, which provides a default for thewrite-cacheoption of block guest devices (as in-device). The modes correspond to the following settings:
│ cache.writeback cache.direct cache.no-flush
─────────────┼─────────────────────────────────────────────────
writeback │ on off off
none │ on on off
writethrough │ off off off
directsync │ off on off
unsafe │ on off onThe default mode iscache=writeback.
- aio=aio
-
aio is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
- format=format
-
Specify which disk format will be used rather than detecting the format. Can be used to specify format=raw to avoid interpreting an untrusted format header.
- serial=serial
-
This option specifies the serial number to assign to the device. This parameter is deprecated, use the corresponding parameter of
-deviceinstead. - addr=addr
-
Specify the controller’s PCI address (if=virtio only). This parameter is deprecated, use the corresponding parameter of
-deviceinstead. - werror=action,rerror=action
-
Specify which action to take on write and read errors. Valid actions are: "ignore" (ignore the error and try to continue), "stop" (pause QEMU), "report" (report the error to the guest), "enospc" (pause QEMU only if the host disk is full; report the error to the guest otherwise). The default setting iswerror=enospcandrerror=report.
- copy-on-read=copy-on-read
-
copy-on-read is "on" or "off" and enables whether to copy read backing file sectors into the image file.
- bps=b,bps_rd=r,bps_wr=w
-
Specify bandwidth throttling limits in bytes per second, either for all request types or for reads or writes only. Small values can lead to timeouts or hangs inside the guest. A safe minimum for disks is 2 MB/s.
- bps_max=bm,bps_rd_max=rm,bps_wr_max=wm
-
Specify bursts in bytes per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.
- iops=i,iops_rd=r,iops_wr=w
-
Specify request rate limits in requests per second, either for all request types or for reads or writes only.
- iops_max=bm,iops_rd_max=rm,iops_wr_max=wm
-
Specify bursts in requests per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.
- iops_size=is
-
Let every is bytes of a request count as a new request for iops throttling purposes. Use this option to prevent guests from circumventing iops limits by sending fewer but larger requests.
- group=g
-
Join a throttling quota group with given name g. All drives that are members of the same group are accounted for together. Use this option to prevent guests from circumventing throttling limits by using many small disks instead of a single larger disk.
By default, thecache.writeback=onmode is used. It will report data writes as completed as soon as the data is present in the host page cache. This is safe as long as your guest OS makes sure to correctly flush disk caches where needed. If your guest OS does not handle volatile disk write caches correctly and your host crashes or loses power, then the guest may experience data corruption.
For such guests, you should consider usingcache.writeback=off. This means that the host page cache will be used to read and write data, but write notification will be sent to the guest only after QEMU has made sure to flush each write to the disk. Be aware that this has a major impact on performance.
When using the-snapshotoption, unsafe caching is always used.
Copy-on-read avoids accessing the same backing file sectors repeatedly and is useful when the backing file is over a slow network. By default copy-on-read is off.
Instead of-cdromyou can use:
qemu-system-i386 -drive file=file,index=2,media=cdrom
Instead of-hda,-hdb,-hdc,-hdd, you can use:
qemu-system-i386 -drive file=file,index=0,media=disk
qemu-system-i386 -drive file=file,index=1,media=disk
qemu-system-i386 -drive file=file,index=2,media=disk
qemu-system-i386 -drive file=file,index=3,media=diskYou can open an image using pre-opened file descriptors from an fd set:
qemu-system-i386
-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=diskYou can connect a CDROM to the slave of ide0:
qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
If you don’t specify the "file=" argument, you define an empty drive:
qemu-system-i386 -drive if=ide,index=1,media=cdrom
Instead of-fda,-fdb, you can use:
qemu-system-i386 -drive file=file,index=0,if=floppy
qemu-system-i386 -drive file=file,index=1,if=floppyBy default, interface is "ide" and index is automatically incremented:
qemu-system-i386 -drive file=a -drive file=b"
is interpreted like:
qemu-system-i386 -hda a -hdb b
qemu的drive参数解释的更多相关文章
- qemu的device参数解释 包括socket的一些知识
前面一片是driver,是把这个新的设备“插入到虚机中”,device 是准备驱动了.device 都是和设备配合使用的.要怎么去驱动一个设备,包括使用的驱动函数是啥,device后面的函数根据驱动的 ...
- http load 的使用以及参数解释
http load 的使用以及参数解释 1.参数含义 参数 全称 含义 -p -parallel 并发的用户进程数.-f -fetches ...
- /etc/sysctl.conf参数解释
/etc/sysctl.conf参数解释: fs.file max = 999999 #表示进程(例如一个worker进程)可能同时打开的最大句柄数,直接限制最大并发连接数 net.ipv4.tcp_ ...
- lcd参数解释及刷新率计算,LCD时序
一.LCD显示图像的过程如下: 其中,VSYNC和HSYNC是有宽度的,加上后如下: 参数解释: HBP(Horizontal Back Porch)水平后沿:在每行或每列的象素数据开始输出时要插入的 ...
- Yolov3参数解释以及答疑
目录 参数解析 训练答疑 参数解析 [net] #Testing #batch=1 //test:一次一个图片 #subdivisions=1 #Training batch=32 //一次迭代送 ...
- angular-cli.json配置参数解释,以及依稀常用命令的通用关键参数解释
一. angular-cli.json常见配置 { "project": { "name": "ng-admin", //项目名称 &quo ...
- mysql命令行各个参数解释
mysql命令行各个参数解释 http://blog.51yip.com/mysql/1056.html Usage: mysql [OPTIONS] [database] //命令方式 -?, ...
- Wget用法、参数解释
wget功能的强大就不用多说了,在高手手里,它就像是个无往不利的杀人利器,下面是转载的一篇Wget用法.参数解释的比较好的一个文章,当然最好的老师还是man wget 是一个从网络上自动下载文件的自由 ...
- my.cnf 配置文件参数解释
my.cnf 配置文件参数解释: #*** client options 相关选项 ***# #以下选项会被MySQL客户端应用读取.注意只有MySQL附带的客户端应用程序保证可以读取这段内容.如果你 ...
随机推荐
- Qt基于model/view数据库编程3
QSqlQueryModel和QSqlQuery类: 工程开发过程中将这两个类合起来使用,用QSqlQueryModel查询展示数据库中的数据,用QSqlQuery类执行sql语言,实现对数据库的操作 ...
- python的元组数据类型及常用操作
Python的元组与列表类似,不同之处在于元组的元素不能修改. 元组使用小括号,列表使用方括号. 元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可. 如下实例: tup1 = ('physi ...
- java常见面试问题.你一定会预见到。
1判断一个char字符是不是数字:Character.isDigit(char).是数字返回true,反之返回false. 2字符串的toCharArray() 把字符串转换为字符数组.返回char[ ...
- click与on的区别
click只能用于html在注册事件之后没有变化的:on用于html在注册事件后,还会通过JS脚本添加一些按钮,并者希望这些按钮也会有之前注册事件的按钮同样的事件话,就需要用on去为按钮的父节点去注册 ...
- 解决每次运行Xcode,都需要输入密码的问题
新买的Mac,在安装了 Xcode 7.1的时候,不知道是配置信息哪里手残了一下,导致每次运行Xcode模拟器 后 都需要输入一次密码. 为此在网上也是查阅了不少的资料,当时 所谓的 XCode--- ...
- Centos7安装FastDFS
离线安装包准备: 将相关的安装包上传到 /usr/local 目录,安装包下载 并解压到当前目录 1.安装 gcc yum install -y gcc gcc-c++ 2.安装 perl yum i ...
- php post提交xml文件
<?php header("Content-type: text/xml;"); // xml code demo $xmlData = '<?xml version= ...
- SHOPEX快递单号查询插件圆通V8.2专版
SHOPEX快递物流单号查询插件特色 本SHOPEX快递物流单号跟踪插件提供国内外近2000家快递物流订单单号查询服务例如申通快递.顺丰快递.圆通快递.EMS快递.汇通快递.宅急送快递.德邦物流.百世 ...
- Hadoop(5)-Hive
在Hadoop的存储处理方面提供了两种不同的机制,一种是之前介绍过的Hbase,另外一种就是Hive,有关于Hbase,它是一种nosql数据库的一种,是一种数据库,基于分布式的列式存储,适合海量数据 ...
- 11个简单实用技巧--Java性能调优
多数开发人员认为性能优化是个比较复杂的问题,需要大量的经验和知识.是的,这并不没有错.诚然,优化应用程序以获得最好的性能并不是一件容易的事情,但这并不意味着你在没有获得这些经验和知识之前就不能做任何事 ...