summaryrefslogtreecommitdiff
path: root/development/qemu-debugging.mdwn
blob: 44a8a7c255910d52f7b6e0f5544367e60acf4d02 (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
# 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 it needs user_xattr on the host filesystem.

Guests fstab:

    ltstest /ltstest 9p   trans=virtio,version=9p2000.L,rw 0 0

Do

    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 ?