forked from MoatLab/FEMU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
f.sh
executable file
·63 lines (51 loc) · 1.83 KB
/
f.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
IMGDIR=$HOME/images
is_mounted=$(mount | grep "/mnt/tmpfs")
if [[ $is_mounted == "" ]]; then
sudo mkdir -p /mnt/tmpfs
# huge=always
sudo mount -t tmpfs -o size=4G tmpfs /mnt/tmpfs
fi
# every time we run a new SSD
sudo rm -rf /mnt/tmpfs/test1.raw
[[ ! -e /mnt/tmpfs/test1.raw ]] && ./qemu-img create -f raw /mnt/tmpfs/test1.raw 4G
#-object iothread,id=iothread0 \
#-device virtio-blk-pci,iothread=iothread0,drive=id0 \
#-nographic \
#-device nvme,drive=id0,serial=serial0,id=nvme0 \
#-kernel /home/huaicheng/git/linux/arch/x86_64/boot/bzImage \
#-append "root=/dev/vda1 console=ttyS0,115200n8 console=tty0" \
#-virtfs local,path=/home/huaicheng/share/,security_model=passthrough,mount_tag=host_share \
#must come before all other qemu options!!!!!!
#-trace events=/tmp/events \
#-object memory-backend-file,id=mem1,size=8G,mem-path=/dev/hugepages2M \
#-device pc-dimm,id=dimm1,memdev=mem1 \
sudo x86_64-softmmu/qemu-system-x86_64 \
-name "nvme-FEMU-test" \
-enable-kvm \
-cpu host \
-smp 4 \
-m 8G \
-device virtio-scsi-pci,id=scsi0 \
-device scsi-hd,drive=hd0 \
-drive file=/home/huaicheng/images/u14s.qcow2,if=none,aio=native,cache=none,format=qcow2,id=hd0 \
-device virtio-scsi-pci,id=scsi1 \
-device scsi-hd,drive=hd1 \
-drive file=$IMGDIR/vmdata.raw,if=none,aio=native,cache=none,format=raw,id=hd1 \
-net user,hostfwd=tcp::8080-:22 \
-net nic,model=virtio \
-nographic \
#-qmp unix:./qmp-sock,server,nowait | tee /media/log
#-object iothread,id=iothread0 \
#-display none \
#-nographic \
#-monitor stdio \
#-s -S \
#
#sleep 10
#./pin.sh
#sshsim "~/tsc.sh"
#sshsim "echo 0 | sudo tee /proc/sys/kernel/timer_migration"
#sshsim "echo 0 | sudo tee /sys/kernel/debug/tracing/tracing_on"
echo "VM is up, enjoy it :)"
wait