blob: ed30a17ead3f2810dfc6121d8af74db1da4feecd (
plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# Enable tracing
In virsh
qemu-monitor-command <vm> --hmp trace-event usb_xhci_* on
qemu-monitor-command <vm> --hmp info trace-events
output goes to /var/log/libvirt/qemu/<vm>.log by default
# 9pfs
* Libvirt XML
<filesystem type='mount' accessmode='mapped'>
<source dir='/cache/ltstest'/>
<target dir='ltstest'/>
</filesystem>
*mapped* is important. It uses extended attributes so the filesystem that
needs to be mounted with *user_xattr* on the host filesystem and the folder
needs to be writeable by qemu:
mount -o remount,user_xattr /cache/ltstest
chown libvirt-qemu /cache/ltstest
The Guests fstab then uses:
ltstest /ltstest 9p trans=virtio,version=9p2000.L,rw 0 0
After mounting you can write from the guest to the hosts fileystem:
mount /ltstest
cd /ltstest && touch a
results on the host as extended attributes
# attr -l a
Attribute "virtfs.uid" has a 4 byte value for a
Attribute "virtfs.gid" has a 4 byte value for a
Attribute "virtfs.mode" has a 4 byte value for a
For details on 9pfs see http://man.cat-v.org/plan_9/5/intro
# Hot (un)plug Devices #
## PCI devices ##
http://www.linux-kvm.org/page/Hotadd_pci_devices
## UARTs ##
http://nairobi-embedded.org/qemu_character_devices.html
## Sound ##
Devices are not hotpluggable via libvirt
([#1417464](https://bugzilla.redhat.com/show_bug.cgi?id=1417464)) but
via QMP monitor:
qemu-monitor-command <vm> '{ "execute": "device_add", "arguments": { "driver": "ES1370", "id": "snd1" }}'
qemu-monitor-command <vm> '{ "execute": "device_del", "arguments": { "id": "snd1" }}
qemu-monitor-command <vm> '{ "execute": "device_add", "arguments": { "driver": "AC97", "id": "snd2" }}'
qemu-monitor-command <vm> '{ "execute": "device_del", "arguments": { "id": "snd2" }}
[More details on QMP commands](https://git.qemu.org/?p=qemu.git;a=blob;f=qapi-schema.json)
# Misc #
* List all devices:
qemu-system-x86_64 -device ?
* Enabling the monitor on raw qemu
$ qemu-system-i386 -qmp tcp:localhost:4444,server,nowait
$ telnet localhost 4444
{ "execute": "qmp_capabilities" }
{"execute": "commands"}
|