2015-11-06 21:20:06 +08:00
|
|
|
LC_ALL=C \
|
|
|
|
PATH=/bin \
|
2019-03-06 20:29:01 +08:00
|
|
|
HOME=/tmp/lib/domain--1-QEMUGuest2 \
|
2015-11-06 21:20:06 +08:00
|
|
|
USER=test \
|
|
|
|
LOGNAME=test \
|
2019-03-08 19:15:07 +08:00
|
|
|
XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest2/.local/share \
|
|
|
|
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest2/.cache \
|
|
|
|
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest2/.config \
|
2015-11-06 21:20:06 +08:00
|
|
|
QEMU_AUDIO_DRV=none \
|
2019-11-30 00:33:37 +08:00
|
|
|
/usr/bin/qemu-system-i386 \
|
2015-11-06 22:29:41 +08:00
|
|
|
-name QEMUGuest2 \
|
2015-11-06 21:20:06 +08:00
|
|
|
-S \
|
2018-03-29 18:51:55 +08:00
|
|
|
-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
2015-11-06 21:20:06 +08:00
|
|
|
-m 214 \
|
2019-04-12 16:03:36 +08:00
|
|
|
-realtime mlock=off \
|
2016-06-23 19:29:16 +08:00
|
|
|
-smp 1,sockets=1,cores=1,threads=1 \
|
2015-11-06 22:29:52 +08:00
|
|
|
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
|
2018-03-29 18:51:55 +08:00
|
|
|
-display none \
|
2018-03-29 18:51:55 +08:00
|
|
|
-no-user-config \
|
2015-11-06 21:20:06 +08:00
|
|
|
-nodefaults \
|
2017-06-26 22:40:39 +08:00
|
|
|
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\
|
|
|
|
server,nowait \
|
2018-03-29 06:04:58 +08:00
|
|
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
2018-03-29 18:51:55 +08:00
|
|
|
-rtc base=utc \
|
2018-03-29 18:51:55 +08:00
|
|
|
-no-shutdown \
|
2015-11-06 21:20:06 +08:00
|
|
|
-no-acpi \
|
|
|
|
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
|
|
|
|
-usb \
|
2015-12-28 22:13:52 +08:00
|
|
|
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
|
2019-01-28 21:44:57 +08:00
|
|
|
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
|
2018-10-12 17:09:56 +08:00
|
|
|
-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
|
2016-07-11 22:27:53 +08:00
|
|
|
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
|
|
|
|
drive=drive-hostdev0,id=hostdev0 \
|
qemu: Build qemu command line for scsi host device
Except the scsi host device's controller is "lsilogic", mapping
between the libvirt attributes and scsi-generic properties is:
libvirt qemu
-----------------------------------------
controller bus ($libvirt_controller.0)
bus channel
target scsi-id
unit lun
For scsi host device with "lsilogic" controller, the mapping is:
('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
must <= 7).
libvirt qemu
----------------------------------------------------------
controller && bus bus ($libvirt_controller.$libvirt_bus)
unit scsi-id
It's not good to hardcode/hard-check limits of these attributes,
and even worse, these limits are not documented, one has to find
out by either testing or reading the qemu code, I'm looking forward
to qemu expose limits like these one day). For example, exposing
"max_target", "max_lun" for megasas:
static const struct SCSIBusInfo megasas_scsi_info = {
.tcq = true,
.max_target = MFI_MAX_LD,
.max_lun = 255,
.transfer_data = megasas_xfer_complete,
.get_sg_list = megasas_get_sg_list,
.complete = megasas_command_complete,
.cancel = megasas_command_cancel,
};
Example of the qemu command line (lsilogic controller):
-drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
-device scsi-generic,bus=scsi0.0,scsi-id=8,\
drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
Example of the qemu command line (virtio-scsi controller):
-drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
2013-05-04 02:07:23 +08:00
|
|
|
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
|