[libvirt] [RFC] qmp: query-device-slots command
by Eduardo Habkost
This adds a new command to QMP: query-device-slots. It will allow
management software to query possible slots where devices can be
plugged.
This implementation of the command will return:
* Multiple PCI slots per bus, in the case of PCI buses;
* One slot per bus in the case of the other buses;
* One slot for each entry from query-hotpluggable-cpus.
In the example below, I am not sure if the PCIe ports are all
supposed to report all slots, but I didn't find any existing
field in PCIBus that would help me figure out the actual number
of slots in a given PCI bus.
Git tree
--------
This patch needs the previous query-machines series I am working
on. The full tree can be found on the git tree at:
git://github.com/ehabkost/qemu-hacks.git work/query-machines-bus-info
Example output
--------------
The following output was returned by QEMU when running it as:
$ qemu-system-x86_64 -machine q35 \
-readconfig docs/q35-chipset.cfg \
-smp 4,maxcpus=8,sockets=2,cores=2,threads=2
{
"return": [
{
"available": false,
"devices": [
"/machine/unattached/device[30]",
"/machine/unattached/device[29]",
"/machine/unattached/device[28]",
"/machine/unattached/device[27]",
"/machine/unattached/device[26]",
"/machine/unattached/device[25]",
"/machine/unattached/device[24]",
"/machine/unattached/device[23]"
],
"accepted-device-types": [
"i2c-slave"
],
"props": {
"bus": "/machine/unattached/device[22]/i2c"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.4"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.5"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.0"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.1"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [
"/machine/unattached/device[21]"
],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.2"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"ide-device"
],
"props": {
"bus": "/machine/unattached/device[20]/ide.3"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [
"/machine/unattached/device[8]",
"/machine/q35/ioapic",
"/machine/q35",
"/machine/fw_cfg",
"/machine/unattached/device[1]"
],
"accepted-device-types": [
"sys-bus-device"
],
"props": {
"bus": "/machine/unattached/sysbus"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [
"/machine/unattached/device[19]",
"/machine/unattached/device[18]",
"/machine/unattached/device[17]",
"/machine/unattached/device[16]",
"/machine/unattached/device[15]",
"/machine/unattached/device[14]",
"/machine/unattached/device[13]",
"/machine/unattached/device[12]",
"/machine/unattached/device[11]",
"/machine/unattached/device[10]",
"/machine/unattached/device[9]",
"/machine/unattached/device[7]",
"/machine/unattached/device[6]"
],
"accepted-device-types": [
"isa-device"
],
"props": {
"bus": "/machine/unattached/device[5]/isa.0"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": false,
"devices": [
"/machine/q35/mch"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 0
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[31]"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 8
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[32]"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 16
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 24
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 32
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 40
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 48
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 56
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 64
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 72
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 80
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 88
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 96
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 104
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 112
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 120
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 128
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 136
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 144
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 152
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 160
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 168
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 176
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 184
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 192
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 200
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/peripheral/ich9-uhci-4"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 208
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/peripheral/ich9-hda-audio"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 216
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/peripheral/ich9-pcie-port-1"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 224
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/peripheral/ich9-uhci-1"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 232
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/peripheral/ich9-pci-bridge"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 240
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[5]"
],
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
],
"props": {
"bus": "/machine/q35/pcie.0",
"addr": 248
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 0
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 8
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 16
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 24
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 32
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 40
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 48
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 56
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 64
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 72
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 80
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 88
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 96
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 104
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 112
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 120
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 128
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 136
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 144
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 152
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 160
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 168
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 176
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 184
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 192
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 200
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 208
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 216
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 224
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 232
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 240
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-1/ich9-pcie-port-1",
"addr": 248
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 0
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 8
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 16
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 24
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 32
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 40
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 48
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 56
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 64
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 72
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 80
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 88
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 96
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 104
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 112
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 120
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 128
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 136
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 144
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 152
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 160
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 168
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 176
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 184
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 192
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 200
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 208
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 216
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 224
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 232
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 240
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-2/ich9-pcie-port-2",
"addr": 248
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 0
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 8
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 16
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 24
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 32
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 40
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 48
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 56
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 64
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 72
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 80
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 88
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 96
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 104
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 112
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 120
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 128
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 136
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 144
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 152
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 160
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 168
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 176
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 184
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 192
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 200
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 208
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 216
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 224
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 232
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 240
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-3/ich9-pcie-port-3",
"addr": 248
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 0
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 8
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 16
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 24
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 32
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 40
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 48
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 56
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 64
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 72
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 80
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 88
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 96
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 104
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 112
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 120
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 128
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 136
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 144
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 152
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 160
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 168
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 176
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 184
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 192
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 200
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 208
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 216
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 224
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 232
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 240
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"pci-express-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pcie-port-4/ich9-pcie-port-4",
"addr": 248
},
"hotpluggable": true,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 0
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 8
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 16
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 24
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 32
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 40
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 48
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 56
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 64
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 72
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 80
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 88
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 96
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 104
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 112
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 120
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 128
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 136
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 144
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 152
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 160
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 168
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 176
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 184
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 192
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 200
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 208
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 216
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 224
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 232
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 240
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"legacy-pci-device"
],
"props": {
"bus": "/machine/peripheral/ich9-pci-bridge/ich9-pci-bridge",
"addr": 248
},
"hotpluggable": false,
"type": "pci",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"usb-device"
],
"props": {
"bus": "/machine/peripheral/ich9-ehci-1/ich9-ehci-1.0"
},
"hotpluggable": true,
"type": "generic"
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"usb-device"
],
"props": {
"bus": "/machine/peripheral/ich9-ehci-2/ich9-ehci-2.0"
},
"hotpluggable": true,
"type": "generic"
},
{
"available": false,
"devices": [],
"accepted-device-types": [
"hda-codec"
],
"props": {
"bus": "/machine/peripheral/ich9-hda-audio/ich9-hda-audio.0"
},
"hotpluggable": false,
"type": "generic"
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 1,
"core-id": 1,
"thread-id": 1
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 1,
"core-id": 1,
"thread-id": 0
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 1,
"core-id": 0,
"thread-id": 1
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": true,
"devices": [],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 1,
"core-id": 0,
"thread-id": 0
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[4]"
],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 0,
"core-id": 1,
"thread-id": 1
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[3]"
],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 0,
"core-id": 1,
"thread-id": 0
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[2]"
],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 0,
"core-id": 0,
"thread-id": 1
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
},
{
"available": false,
"devices": [
"/machine/unattached/device[0]"
],
"accepted-device-types": [
"qemu64-x86_64-cpu"
],
"props": {
"socket-id": 0,
"core-id": 0,
"thread-id": 0
},
"hotpluggable": true,
"type": "cpu",
"max-devices": 1
}
]
}
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
qapi-schema.json | 114 +++++++++++++++++++++++++++++++++++++++++++++++++
include/hw/qdev-core.h | 6 +++
hw/core/bus.c | 49 +++++++++++++++++++++
hw/pci/pci.c | 106 +++++++++++++++++++++++++++++++++------------
qdev-monitor.c | 86 ++++++++++++++++++++++++++++++++++---
5 files changed, 328 insertions(+), 33 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index d48ff3f..484d91e 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3166,6 +3166,120 @@
{ 'command': 'closefd', 'data': {'fdname': 'str'} }
##
+# @DeviceSlotType:
+#
+# Type of device slot
+#
+# @generic: Generic device slot, with no bus-specific information
+# @pci: PCI device slot
+# @cpu: CPU device slot
+##
+{ 'enum': 'DeviceSlotType',
+ 'data': ['generic', 'pci', 'cpu'] }
+
+##
+# @DeviceSlotInfo:
+#
+# Information on a slot where devices can be plugged. Some buses
+# are represented as a single slot that can support multiple devices,
+# and some buses have multiple slots that are identified by arguments
+# to @device_add.
+#
+# @bus: ID of the bus object where the device can be plugged. Optional,
+# as some devices don't need a bus to be plugged (e.g. CPUs).
+# Can be copied to the "bus" argument to @device_add.
+#
+# @type: type of device slot.
+#
+# @accepted-device-types: List of device types accepted by the slot.
+# Any device plugged to the slot should implement
+# one of the accepted device types.
+#
+# @max-devices: #optional maximum number of devices that can be plugged
+# to the slot.
+#
+# @devices: List of QOM paths for devices that are already plugged.
+#
+# @available: If false, the slot is not available for plugging any device.
+# This value can change at runtime if condition changes
+# (e.g. if the device becomes full, or if the machine
+# was already initialized and the slot doesn't support
+# hotplug).
+#
+# @hotpluggable: If true, the slot accepts hotplugged devices.
+#
+# DeviceSlotInfo structs always have a @props member, whose members
+# can be directly copied to the arguments to @device_add.
+##
+{ 'union': 'DeviceSlotInfo',
+ 'base': { 'type': 'DeviceSlotType',
+ 'accepted-device-types': [ 'str' ],
+ '*max-devices': 'int', 'devices': [ 'str' ],
+ 'available': 'bool', 'hotpluggable': 'bool' },
+ 'discriminator': 'type',
+ 'data': { 'generic': 'GenericSlotInfo',
+ 'pci': 'PCISlotInfo',
+ 'cpu': 'CPUSlotInfo' } }
+
+##
+# @GenericSlotProperties:
+##
+{ 'struct': 'GenericSlotProperties',
+ 'data': { 'bus': 'str' } }
+
+
+##
+# @GenericSlotInfo:
+#
+# Generic slot information, with no bus-specific information
+##
+{ 'struct': 'GenericSlotInfo',
+ 'data': { 'props': 'GenericSlotProperties' } }
+
+##
+# @PCIDeviceSlotProperties:
+#
+# Properties that can be set when plugging a PCI device.
+#
+# @addr: "addr" argument to @device_add.
+#
+#FIXME: replace @addr with slot and function properties.
+##
+{ 'struct': 'PCIDeviceSlotProperties',
+ 'data': { 'bus': 'str', 'addr': 'int' } }
+
+##
+# @PCISlotInfo:
+#
+# Information on a PCI device slot.
+#
+# @props: The @device_add arguments that can be used when plugging
+# the device.
+##
+{ 'struct': 'PCISlotInfo',
+ 'data': { 'props': 'PCIDeviceSlotProperties' } }
+
+##
+# @CPUSlotInfo:
+#
+# Information on a CPU device slot.
+#
+# @props: The @device_add arguments that can be used when plugging
+# the device.
+##
+{ 'struct': 'CPUSlotInfo',
+ 'data': { 'props': 'CpuInstanceProperties' } }
+
+##
+# @query-device-slots:
+#
+# Return the list of possible slots for plugging devices using
+# @device_add.
+##
+{ 'command': 'query-device-slots',
+ 'returns': [ 'DeviceSlotInfo' ] }
+
+##
# @MachineBusInfo
#
# Information about a bus present on a machine.
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index a7f9ac4..7a87234 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -214,6 +214,10 @@ struct BusClass {
* but on some cases bus instances may override it.
*/
const char *device_type;
+
+ /*TOD: write doc */
+ DeviceSlotInfoList *(*enumerate_slots)(BusState *bus, Error **errp);
+
};
typedef struct BusChild {
@@ -412,4 +416,6 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
void device_listener_register(DeviceListener *listener);
void device_listener_unregister(DeviceListener *listener);
+bool qbus_is_full(BusState *bus);
+
#endif
diff --git a/hw/core/bus.c b/hw/core/bus.c
index d2bf717..58b5c3d 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -21,6 +21,7 @@
#include "qemu-common.h"
#include "hw/qdev.h"
#include "qapi/error.h"
+#include "qapi/clone-visitor.h"
#include "qapi-visit.h"
static void qbus_set_hotplug_handler_internal(BusState *bus, Object *handler,
@@ -225,12 +226,60 @@ static void bus_get_device_type(Object *obj, Visitor *v,
visit_type_strList(v, NULL, &bus->accepted_device_types, errp);
}
+bool qbus_is_full(BusState *bus)
+{
+ BusClass *bus_class = BUS_GET_CLASS(bus);
+ return bus_class->max_dev && bus->max_index >= bus_class->max_dev;
+}
+
+/* Generic slot enumeration function: will return a single slot
+ * for the bus, with max_devices set to BusClass::max_dev, if set.
+ */
+static DeviceSlotInfoList *bus_generic_enumerate_slots(BusState *bus, Error **errp)
+{
+ Error *local_err = NULL;
+ BusClass *bc = BUS_GET_CLASS(bus);
+ strList **devlist;
+ BusChild *kid;
+ DeviceSlotInfoList *r = g_new0(DeviceSlotInfoList, 1);
+
+ r->value = g_new0(DeviceSlotInfo, 1);
+ r->value->type = DEVICE_SLOT_TYPE_GENERIC;
+ r->value->has_max_devices = bc->max_dev > 0;
+ r->value->max_devices = bc->max_dev;
+ r->value->accepted_device_types = QAPI_CLONE(strList, bus->accepted_device_types);
+ r->value->u.generic.props = g_new0(GenericSlotProperties, 1);
+ r->value->u.generic.props->bus = object_get_canonical_path(OBJECT(bus));
+
+ devlist = &r->value->devices;
+ QTAILQ_FOREACH(kid, &bus->children, sibling) {
+ DeviceState *dev = kid->child;
+ strList *item = g_new0(strList, 1);
+ item->value = object_get_canonical_path(OBJECT(dev));
+ *devlist = item;
+ devlist = &item->next;
+ }
+ r->value->hotpluggable = qbus_is_hotpluggable(bus);
+
+ /* Conditions that make a bus unavailable:
+ * - Bus already full
+ * - Hotplug when the bus is not hotpluggable
+ */
+ r->value->available =
+ !(qbus_is_full(bus) ||
+ (qdev_hotplug && !qbus_is_hotpluggable(bus)));
+
+ error_propagate(errp, local_err);
+ return r;
+}
+
static void bus_class_init(ObjectClass *class, void *data)
{
BusClass *bc = BUS_CLASS(class);
class->unparent = bus_unparent;
bc->get_fw_dev_path = default_bus_get_fw_dev_path;
+ bc->enumerate_slots = bus_generic_enumerate_slots;
object_class_property_add(class, "accepted-device-types", "strList",
bus_get_device_type, NULL, NULL, NULL,
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2eac71a..9bcc116 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -41,6 +41,7 @@
#include "hw/hotplug.h"
#include "hw/boards.h"
#include "qemu/cutils.h"
+#include "qapi/clone-visitor.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -141,6 +142,8 @@ static uint16_t pcibus_numa_node(PCIBus *bus)
return NUMA_NODE_UNASSIGNED;
}
+static DeviceSlotInfoList *pci_bus_enumerate_slots(BusState *bus, Error **errp);
+
static void pci_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
@@ -156,6 +159,7 @@ static void pci_bus_class_init(ObjectClass *klass, void *data)
* but overrides BusClass::device_type to INTERFACE_PCIE_DEVICE
*/
k->device_type = INTERFACE_LEGACY_PCI_DEVICE;
+ k->enumerate_slots = pci_bus_enumerate_slots;
pbc->is_root = pcibus_is_root;
pbc->bus_num = pcibus_num;
@@ -967,6 +971,81 @@ uint16_t pci_requester_id(PCIDevice *dev)
return pci_req_id_cache_extract(&dev->requester_id_cache);
}
+static bool pci_bus_has_pcie_upstream_port(PCIBus *bus)
+{
+ PCIDevice *parent_dev = pci_bridge_get_device(bus);
+
+ /* Device associated with an upstream port.
+ * As there are several types of these, it's easier to check the
+ * parent device: upstream ports are always connected to
+ * root or downstream ports.
+ */
+ return parent_dev &&
+ pci_is_express(parent_dev) &&
+ parent_dev->exp.exp_cap &&
+ (pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_ROOT_PORT ||
+ pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_DOWNSTREAM);
+}
+
+static PCIDevice *pci_bus_get_function_0(PCIBus *bus, int devfn)
+{
+ if(pci_bus_has_pcie_upstream_port(bus)) {
+ /* With an upstream PCIe port, we only support 1 device at slot 0 */
+ return bus->devices[0];
+ } else {
+ /* Other bus types might support multiple devices at slots 0-31 */
+ return bus->devices[PCI_DEVFN(PCI_SLOT(devfn), 0)];
+ }
+}
+
+PCIDevice *pci_get_function_0(PCIDevice *pci_dev)
+{
+ return pci_bus_get_function_0(pci_dev->bus, pci_dev->devfn);
+}
+
+static DeviceSlotInfoList *pci_bus_enumerate_slots(BusState *bus, Error **errp)
+{
+ PCIBus *pb = PCI_BUS(bus);
+ int devfn;
+ DeviceSlotInfoList *r = NULL;
+ DeviceSlotInfoList **next = &r;
+
+ for(devfn = pb->devfn_min; devfn < ARRAY_SIZE(pb->devices);
+ devfn += PCI_FUNC_MAX) {
+ DeviceSlotInfoList *i = g_new0(DeviceSlotInfoList, 1);
+ i->value = g_new0(DeviceSlotInfo, 1);
+ i->value->type = DEVICE_SLOT_TYPE_PCI;
+ i->value->has_max_devices = true;
+ i->value->max_devices = 1;
+ i->value->u.pci.props = g_new0(PCIDeviceSlotProperties, 1);
+ i->value->u.pci.props->bus = object_get_canonical_path(OBJECT(bus));
+ i->value->u.pci.props->addr = devfn;
+ /*TODO: add info about accepting only bridges on extra PCI root buses */
+ i->value->accepted_device_types = QAPI_CLONE(strList, bus->accepted_device_types);
+ if (pb->devices[devfn]) {
+ i->value->devices = g_new0(strList, 1);
+ i->value->devices->value =
+ object_get_canonical_path(OBJECT(pb->devices[devfn]));
+ }
+
+ i->value->hotpluggable = qbus_is_hotpluggable(bus);
+ /* Conditions that make a devfn unavailable:
+ * - Hotplug when function 0 is already occupied
+ * - devfn already occupied by a device
+ * - Hotplug when the bus is not hotpluggable
+ */
+ i->value->available =
+ !((qdev_hotplug && pci_bus_get_function_0(pb, devfn)) ||
+ (pb->devices[devfn]) ||
+ (qdev_hotplug && !qbus_is_hotpluggable(bus)));
+
+ *next = i;
+ next = &i->next;
+ }
+
+ return r;
+}
+
/* -1 for devfn means auto assign */
static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
const char *name, int devfn,
@@ -2607,33 +2686,6 @@ void pci_bus_get_w64_range(PCIBus *bus, Range *range)
pci_for_each_device_under_bus(bus, pci_dev_get_w64, range);
}
-static bool pcie_has_upstream_port(PCIDevice *dev)
-{
- PCIDevice *parent_dev = pci_bridge_get_device(dev->bus);
-
- /* Device associated with an upstream port.
- * As there are several types of these, it's easier to check the
- * parent device: upstream ports are always connected to
- * root or downstream ports.
- */
- return parent_dev &&
- pci_is_express(parent_dev) &&
- parent_dev->exp.exp_cap &&
- (pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_ROOT_PORT ||
- pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_DOWNSTREAM);
-}
-
-PCIDevice *pci_get_function_0(PCIDevice *pci_dev)
-{
- if(pcie_has_upstream_port(pci_dev)) {
- /* With an upstream PCIe port, we only support 1 device at slot 0 */
- return pci_dev->bus->devices[0];
- } else {
- /* Other bus types might support multiple devices at slots 0-31 */
- return pci_dev->bus->devices[PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 0)];
- }
-}
-
MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
{
MSIMessage msg;
diff --git a/qdev-monitor.c b/qdev-monitor.c
index c73410c..b4071c4 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -29,6 +29,8 @@
#include "qemu/error-report.h"
#include "qemu/help_option.h"
#include "sysemu/block-backend.h"
+#include "qapi/clone-visitor.h"
+#include "hw/boards.h"
/*
* Aliases were a bad idea from the start. Let's keep them
@@ -399,12 +401,6 @@ static DeviceState *qbus_find_dev(BusState *bus, char *elem)
return NULL;
}
-static inline bool qbus_is_full(BusState *bus)
-{
- BusClass *bus_class = BUS_GET_CLASS(bus);
- return bus_class->max_dev && bus->max_index >= bus_class->max_dev;
-}
-
/*
* Search the tree rooted at @bus for a bus.
* If @name, search for a bus with that name. Note that bus names
@@ -631,6 +627,84 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
return dev;
}
+typedef struct SlotListState {
+ DeviceSlotInfoList *result;
+ DeviceSlotInfoList **next;
+ Error *err;
+} SlotListState;
+
+static int walk_bus(Object *obj, void *opaque)
+{
+ SlotListState *s = opaque;
+ if (object_dynamic_cast(obj, TYPE_BUS)) {
+ BusState *bus = BUS(obj);
+ BusClass *bc = BUS_GET_CLASS(bus);
+ DeviceSlotInfoList *l = bc->enumerate_slots(bus, &s->err);
+ *s->next = l;
+ for (; l; l = l->next) {
+ s->next = &l->next;
+ }
+ if (s->err) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+DeviceSlotInfoList *qmp_query_device_slots(Error **errp)
+{
+ SlotListState s = { };
+ MachineState *ms = MACHINE(qdev_get_machine());
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
+
+ s.next = &s.result;
+
+ /* We build the device slot list from two sources:
+ * 1) Calling the BusClass::enumerate_slots() method on all buses;
+ * 2) The return value of MachineClass::query_hotpluggable_cpus()
+ */
+
+
+ object_child_foreach_recursive(qdev_get_machine(), walk_bus, &s);
+ if (s.err) {
+ goto out;
+ }
+
+ if (mc->query_hotpluggable_cpus) {
+ HotpluggableCPUList *hcl = mc->query_hotpluggable_cpus(ms);
+ HotpluggableCPUList *i;
+
+ for (i = hcl; i; i = i->next) {
+ DeviceSlotInfoList *r = g_new0(DeviceSlotInfoList, 1);
+ HotpluggableCPU *hc = i->value;
+ r->value = g_new0(DeviceSlotInfo, 1);
+ r->value->type = DEVICE_SLOT_TYPE_CPU;
+ r->value->accepted_device_types = g_new0(strList, 1);
+ r->value->accepted_device_types->value = g_strdup(hc->type);
+ r->value->has_max_devices = true;
+ r->value->max_devices = 1;
+ r->value->available = !hc->has_qom_path;
+ /*TODO: should it be always true? */
+ r->value->hotpluggable = true;
+
+ if (hc->has_qom_path) {
+ r->value->devices = g_new0(strList, 1);
+ r->value->devices->value = g_strdup(hc->qom_path);
+ }
+ r->value->u.cpu.props = QAPI_CLONE(CpuInstanceProperties,
+ hc->props);
+ *s.next = r;
+ s.next = & r->next;
+ }
+
+ qapi_free_HotpluggableCPUList(hcl);
+ }
+
+out:
+ error_propagate(errp, s.err);
+ return s.result;
+}
+
#define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__)
static void qbus_print(Monitor *mon, BusState *bus, int indent);
--
2.7.4
--
Eduardo
7 years, 11 months
[libvirt] [PATCH 0/2] Simplify perf events handling a little
by Daniel P. Berrange
This does two simplifications to the perf events code.
Daniel P. Berrange (2):
perf: get rid of pointless virPerfGetEventAttr() method
perf: get rid of pointless virPerfGetEvent() method
src/util/virperf.c | 162 +++++++++++++++++++++--------------------------------
1 file changed, 65 insertions(+), 97 deletions(-)
--
2.9.3
7 years, 11 months
[libvirt] [PATCH 0/3] Fix build on FreeBSD
by Michal Privoznik
Obviously my latest patch set broke some stuff on FreeBSD.
Michal Privoznik (3):
configure: Link witch -lacl only on linux
qemu: Mark more namespace code linux-only
virfile: Support bind mount only on linux
configure.ac | 2 +-
src/qemu/qemu_domain.c | 372 +++++++++++++++++++++++++------------------------
src/util/virfile.c | 6 +-
3 files changed, 195 insertions(+), 185 deletions(-)
--
2.11.0
7 years, 11 months
[libvirt] [PATCH 0/4] Add generic perf event support
by Nitesh Konkar
Add support and documentation for generic
perf events like bus_cycles, stalled_cycles_frontend,
stalled_cycles_backend and ref_cpu_cycles.
Nitesh Konkar (4):
perf: add bus_cycles perf event support
perf: add stalled_cycles_frontend perf event support
perf: add stalled_cycles_backend perf event support
perf: add ref_cpu_cycles perf event support
docs/formatdomain.html.in | 24 +++++++++++++++++
docs/news.html.in | 6 +++--
docs/schemas/domaincommon.rng | 4 +++
include/libvirt/libvirt-domain.h | 40 +++++++++++++++++++++++++++++
src/libvirt-domain.c | 11 ++++++++
src/qemu/qemu_driver.c | 4 +++
src/util/virperf.c | 16 +++++++++++-
src/util/virperf.h | 4 +++
tests/genericxml2xmlindata/generic-perf.xml | 4 +++
tools/virsh.pod | 16 +++++++++++-
10 files changed, 125 insertions(+), 4 deletions(-)
--
1.9.3
7 years, 11 months
[libvirt] [RFC v2] qmp: query-device-slots command
by Eduardo Habkost
This adds a new command to QMP: query-device-slots. It will allow
management software to query possible slots where devices can be
plugged.
This implementation of the command will return:
* Multiple PCI slots per bus, in the case of PCI buses;
* One slot per bus for the other buses (that don't
implement slot enumeration yet);
* One slot for each entry from query-hotpluggable-cpus.
Git tree
--------
This patch needs the previous query-machines series I am working
on. The full tree can be found on the git tree at:
git://github.com/ehabkost/qemu-hacks.git work/query-machines-bus-info
Example output
--------------
The following output was returned by QEMU when running it as:
$ qemu-system-x86_64 -machine q35 \
-readconfig docs/q35-chipset.cfg \
-smp 4,maxcpus=8,sockets=2,cores=2,threads=2
{
"return": [
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "i2c"
},
"type": "non-slot",
"accepted-device-types": [
"i2c-slave"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.4"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.5"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.0"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.1"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.2"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ide.3"
},
"type": "non-slot",
"accepted-device-types": [
"ide-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "main-system-bus"
},
"type": "non-slot",
"accepted-device-types": [
"sys-bus-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "isa.0"
},
"type": "non-slot",
"accepted-device-types": [
"isa-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 1
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 2
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 3
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 4
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 5
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 6
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 7
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 8
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 9
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 10
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 11
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 12
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 13
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 14
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 15
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 16
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 17
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 18
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 19
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 20
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 21
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 22
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 23
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 24
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 25
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 26
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 27
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 28
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 29
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 30
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "pcie.0",
"device-number": 31
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device",
"pci-express-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-pcie-port-1",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"pci-express-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-pcie-port-2",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"pci-express-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-pcie-port-3",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"pci-express-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-pcie-port-4",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"pci-express-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 0
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 1
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 2
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 3
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 4
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 5
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 6
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 7
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 8
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 9
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 10
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 11
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 12
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 13
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 14
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 15
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 16
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 17
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 18
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 19
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 20
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 21
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 22
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 23
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 24
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 25
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 26
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 27
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 28
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 29
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 30
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-pci-bridge",
"device-number": 31
},
"type": "pci",
"accepted-device-types": [
"legacy-pci-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-ehci-1.0"
},
"type": "non-slot",
"accepted-device-types": [
"usb-device"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"bus": "ich9-ehci-2.0"
},
"type": "non-slot",
"accepted-device-types": [
"usb-device"
]
},
{
"available": false,
"hotpluggable": false,
"props": {
"bus": "ich9-hda-audio.0"
},
"type": "non-slot",
"accepted-device-types": [
"hda-codec"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"socket-id": 1,
"core-id": 1,
"thread-id": 1
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"socket-id": 1,
"core-id": 1,
"thread-id": 0
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"socket-id": 1,
"core-id": 0,
"thread-id": 1
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": true,
"hotpluggable": true,
"props": {
"socket-id": 1,
"core-id": 0,
"thread-id": 0
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": false,
"hotpluggable": true,
"props": {
"socket-id": 0,
"core-id": 1,
"thread-id": 1
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": false,
"hotpluggable": true,
"props": {
"socket-id": 0,
"core-id": 1,
"thread-id": 0
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": false,
"hotpluggable": true,
"props": {
"socket-id": 0,
"core-id": 0,
"thread-id": 1
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
},
{
"available": false,
"hotpluggable": true,
"props": {
"socket-id": 0,
"core-id": 0,
"thread-id": 0
},
"type": "cpu",
"accepted-device-types": [
"qemu64-x86_64-cpu"
]
}
]
}
Cc: Marcel Apfelbaum <marcel(a)redhat.com>
Cc: Markus Armbruster <armbru(a)redhat.com>
Cc: libvir-list(a)redhat.com,
Cc: Igor Mammedov <imammedo(a)redhat.com>
Cc: Laine Stump <laine(a)redhat.com>
Cc: "Michael S. Tsirkin" <mst(a)redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
Changes v1 -> v2:
* Don't show sysbus unless has_dynamic_sysbus is set for the
machine type
* Removed max-devices and devices properties
* Introduced "non-slot" slot type, to explicitly indicate
we are returning info on a bus that doesn't implement slot
enumeration yet.
* Return bus name instead of full QOM path on "bus" field
* PCI: Replaced "addr" property (string parsed by property
setter) with "device-number" uint32 property
* PCI: return only one slot for PCIe ports
---
qapi-schema.json | 131 +++++++++++++++++++++++++++++++++++++++
include/hw/qdev-core.h | 6 ++
hw/core/bus.c | 35 +++++++++++
hw/pci/pci.c | 165 +++++++++++++++++++++++++++++++++++++++++--------
qdev-monitor.c | 88 ++++++++++++++++++++++++--
5 files changed, 392 insertions(+), 33 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index d48ff3f..50e09f5 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3166,6 +3166,137 @@
{ 'command': 'closefd', 'data': {'fdname': 'str'} }
##
+# @DeviceSlotType:
+#
+# Type of device slot
+#
+# @non-slot: Slot type representing a bus that doesn't return any
+# specific slot information yet.
+# @pci: PCI device slot
+# @cpu: CPU device slot
+#
+#TODO: try to find a better name for non-slot. "generic-bus", maybe?
+##
+{ 'enum': 'DeviceSlotType',
+ 'data': ['non-slot', 'pci', 'cpu'] }
+
+##
+# @DeviceSlotInfo:
+#
+# Information on a slot where devices can be plugged.
+#
+# @type: type of device slot.
+#
+# @accepted-device-types: List of device types accepted by the slot.
+# Any device plugged to the slot should implement
+# one of the accepted device types.
+#
+# @available: If false, the slot is not available for plugging any device.
+# This value can change at runtime if condition changes
+# (e.g. if the slot becomes full, or if the machine
+# was already initialized and the slot doesn't support
+# hotplug).
+#
+# @hotpluggable: If true, the slot accepts hotplugged devices.
+#
+# @props: The arguments that should be given to @device_add if plugging
+# a device to this slot.
+#
+# For specific rules about what can be plugged on each type of slot,
+# see the type-specific structs (@NonSlotInfo, @PCISlotInfo,
+# @CPUSlotInfo).
+##
+{ 'union': 'DeviceSlotInfo',
+ 'base': { 'type': 'DeviceSlotType',
+ 'accepted-device-types': [ 'str' ],
+ 'available': 'bool', 'hotpluggable': 'bool' },
+ 'discriminator': 'type',
+ 'data': { 'non-slot': 'NonSlotInfo',
+ 'pci': 'PCISlotInfo',
+ 'cpu': 'CPUSlotInfo' } }
+
+##
+# @NonSlotProperties:
+#
+# Arguments to @device_add when plugging a device to a bus that
+# doesn't return specific slot info yet.
+#
+# @bus: "bus" argument to @device_add.
+#
+# Slots returned as type=non-slot might require extra arguments to
+# be set to specify the device address, but they are not covered by
+# NonSlotInfoProperties.
+##
+{ 'struct': 'NonSlotProperties',
+ 'data': { 'bus': 'str' } }
+
+
+##
+# @NonSlotInfo:
+#
+# Generic entry representing a bus that doesn't support slot enumeration
+# yet. Slots of this type should be replaced by more specific slot types
+# in future QEMU versions.
+#
+# Slots of this type may or may not support multiple devices.
+#
+# @props: The arguments that should be given to @device_add if plugging
+# a device to this slot. The list of properties might be incomplete
+# in case the bus requires additional parameters to be provided.
+##
+{ 'struct': 'NonSlotInfo',
+ 'data': { 'props': 'NonSlotProperties' } }
+
+##
+# @PCIDeviceSlotProperties:
+#
+# Arguments to @device_add when plugging a device to a PCI slot.
+#
+# @bus: "bus" argument to @device_add.
+# @slot: "device-number" argument to @device_add. PCI device
+# number (sometimes called "slot").
+#
+##
+{ 'struct': 'PCIDeviceSlotProperties',
+ 'data': { 'bus': 'str', 'device-number': 'int' } }
+
+##
+# @PCISlotInfo:
+#
+# Information on a PCI device slot.
+#
+# @props: The arguments that should be given to @device_add if plugging
+# a device to this slot.
+#
+# PCI device slots become unavailable after a device is plugged to
+# function 0.
+##
+{ 'struct': 'PCISlotInfo',
+ 'data': { 'props': 'PCIDeviceSlotProperties' } }
+
+##
+# @CPUSlotInfo:
+#
+# Information on a CPU device slot.
+#
+# @props: The arguments that should be given to @device_add if plugging
+# a device to this slot.
+#
+# CPU slots become unavailable after one device is plugged to them.
+##
+{ 'struct': 'CPUSlotInfo',
+ 'data': { 'props': 'CpuInstanceProperties' } }
+
+##
+# @query-device-slots:
+#
+# Return the list of possible slots for plugging devices using
+# @device_add.
+##
+{ 'command': 'query-device-slots',
+ 'returns': [ 'DeviceSlotInfo' ] }
+
+##
# @MachineBusInfo
#
# Information about a bus present on a machine.
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index a7f9ac4..2cb043a 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -214,6 +214,10 @@ struct BusClass {
* but on some cases bus instances may override it.
*/
const char *device_type;
+
+ /*TODO: write doc */
+ DeviceSlotInfoList *(*enumerate_slots)(BusState *bus, Error **errp);
+
};
typedef struct BusChild {
@@ -412,4 +416,6 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
void device_listener_register(DeviceListener *listener);
void device_listener_unregister(DeviceListener *listener);
+bool qbus_is_full(BusState *bus);
+
#endif
diff --git a/hw/core/bus.c b/hw/core/bus.c
index d2bf717..451fa46 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -21,6 +21,7 @@
#include "qemu-common.h"
#include "hw/qdev.h"
#include "qapi/error.h"
+#include "qapi/clone-visitor.h"
#include "qapi-visit.h"
static void qbus_set_hotplug_handler_internal(BusState *bus, Object *handler,
@@ -225,12 +226,46 @@ static void bus_get_device_type(Object *obj, Visitor *v,
visit_type_strList(v, NULL, &bus->accepted_device_types, errp);
}
+bool qbus_is_full(BusState *bus)
+{
+ BusClass *bus_class = BUS_GET_CLASS(bus);
+ return bus_class->max_dev && bus->max_index >= bus_class->max_dev;
+}
+
+/* Generic slot enumeration function that will return a generic-slot slot type.
+ */
+static DeviceSlotInfoList *bus_generic_enumerate_slots(BusState *bus, Error **errp)
+{
+ Error *local_err = NULL;
+ DeviceSlotInfoList *r = g_new0(DeviceSlotInfoList, 1);
+
+ r->value = g_new0(DeviceSlotInfo, 1);
+ r->value->type = DEVICE_SLOT_TYPE_NON_SLOT;
+ r->value->accepted_device_types = QAPI_CLONE(strList, bus->accepted_device_types);
+ r->value->u.non_slot.props = g_new0(NonSlotProperties, 1);
+ r->value->u.non_slot.props->bus = g_strdup(bus->name);
+
+ r->value->hotpluggable = qbus_is_hotpluggable(bus);
+
+ /* Conditions that make a bus unavailable:
+ * - Bus already full
+ * - Hotplug when the bus is not hotpluggable
+ */
+ r->value->available =
+ !(qbus_is_full(bus) ||
+ (qdev_hotplug && !qbus_is_hotpluggable(bus)));
+
+ error_propagate(errp, local_err);
+ return r;
+}
+
static void bus_class_init(ObjectClass *class, void *data)
{
BusClass *bc = BUS_CLASS(class);
class->unparent = bus_unparent;
bc->get_fw_dev_path = default_bus_get_fw_dev_path;
+ bc->enumerate_slots = bus_generic_enumerate_slots;
object_class_property_add(class, "accepted-device-types", "strList",
bus_get_device_type, NULL, NULL, NULL,
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2eac71a..7870af9 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -41,6 +41,7 @@
#include "hw/hotplug.h"
#include "hw/boards.h"
#include "qemu/cutils.h"
+#include "qapi/clone-visitor.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -141,6 +142,8 @@ static uint16_t pcibus_numa_node(PCIBus *bus)
return NUMA_NODE_UNASSIGNED;
}
+static DeviceSlotInfoList *pci_bus_enumerate_slots(BusState *bus, Error **errp);
+
static void pci_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
@@ -156,6 +159,7 @@ static void pci_bus_class_init(ObjectClass *klass, void *data)
* but overrides BusClass::device_type to INTERFACE_PCIE_DEVICE
*/
k->device_type = INTERFACE_LEGACY_PCI_DEVICE;
+ k->enumerate_slots = pci_bus_enumerate_slots;
pbc->is_root = pcibus_is_root;
pbc->bus_num = pcibus_num;
@@ -967,6 +971,77 @@ uint16_t pci_requester_id(PCIDevice *dev)
return pci_req_id_cache_extract(&dev->requester_id_cache);
}
+static bool pci_bus_has_pcie_upstream_port(PCIBus *bus)
+{
+ PCIDevice *parent_dev = pci_bridge_get_device(bus);
+
+ /* Device associated with an upstream port.
+ * As there are several types of these, it's easier to check the
+ * parent device: upstream ports are always connected to
+ * root or downstream ports.
+ */
+ return parent_dev &&
+ pci_is_express(parent_dev) &&
+ parent_dev->exp.exp_cap &&
+ (pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_ROOT_PORT ||
+ pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_DOWNSTREAM);
+}
+
+static PCIDevice *pci_bus_get_function_0(PCIBus *bus, int devfn)
+{
+ if(pci_bus_has_pcie_upstream_port(bus)) {
+ /* With an upstream PCIe port, we only support 1 device at slot 0 */
+ return bus->devices[0];
+ } else {
+ /* Other bus types might support multiple devices at slots 0-31 */
+ return bus->devices[PCI_DEVFN(PCI_SLOT(devfn), 0)];
+ }
+}
+
+PCIDevice *pci_get_function_0(PCIDevice *pci_dev)
+{
+ return pci_bus_get_function_0(pci_dev->bus, pci_dev->devfn);
+}
+
+static DeviceSlotInfoList *pci_bus_enumerate_slots(BusState *bus, Error **errp)
+{
+ PCIBus *pb = PCI_BUS(bus);
+ int slot, slots;
+ DeviceSlotInfoList *r = NULL;
+ DeviceSlotInfoList **next = &r;
+
+ if (pci_bus_has_pcie_upstream_port(pb)) {
+ slots = 1;
+ } else {
+ slots = PCI_SLOT_MAX;
+ }
+
+ for(slot = PCI_SLOT(pb->devfn_min); slot < slots; slot++) {
+ DeviceSlotInfoList *i = g_new0(DeviceSlotInfoList, 1);
+ i->value = g_new0(DeviceSlotInfo, 1);
+ i->value->type = DEVICE_SLOT_TYPE_PCI;
+ i->value->u.pci.props = g_new0(PCIDeviceSlotProperties, 1);
+ i->value->u.pci.props->bus = g_strdup(bus->name);
+ i->value->u.pci.props->device_number = slot;
+ /*TODO: add info about accepting only bridges on extra PCI root buses */
+ i->value->accepted_device_types = QAPI_CLONE(strList, bus->accepted_device_types);
+
+ i->value->hotpluggable = qbus_is_hotpluggable(bus);
+ /* Conditions that make a slot unavailable:
+ * - function 0 already occupied by a device
+ * - Hotplug when the bus is not hotpluggable
+ */
+ i->value->available =
+ !((pb->devices[PCI_DEVFN(slot, 0)]) ||
+ (qdev_hotplug && !qbus_is_hotpluggable(bus)));
+
+ *next = i;
+ next = &i->next;
+ }
+
+ return r;
+}
+
/* -1 for devfn means auto assign */
static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
const char *name, int devfn,
@@ -2509,6 +2584,56 @@ MemoryRegion *pci_address_space_io(PCIDevice *dev)
return dev->bus->address_space_io;
}
+static void pci_device_get_devnr(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ PCIDevice *dev = PCI_DEVICE(obj);
+ uint32_t devnr = PCI_SLOT(dev->devfn);
+
+ visit_type_uint32(v, "device-number", &devnr, errp);
+}
+
+static void pci_device_set_devnr(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ PCIDevice *dev = PCI_DEVICE(obj);
+ uint32_t devnr;
+ Error *local_err = NULL;
+
+ visit_type_uint32(v, "device-number", &devnr, &local_err);
+ if (local_err) {
+ goto out;
+ }
+ dev->devfn = PCI_DEVFN(devnr, PCI_FUNC(dev->devfn));
+out:
+ error_propagate(errp, local_err);
+}
+
+static void pci_device_get_function(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ PCIDevice *dev = PCI_DEVICE(obj);
+ uint32_t function = PCI_FUNC(dev->devfn);
+
+ visit_type_uint32(v, "function", &function, errp);
+}
+
+static void pci_device_set_function(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ PCIDevice *dev = PCI_DEVICE(obj);
+ uint32_t function;
+ Error *local_err = NULL;
+
+ visit_type_uint32(v, "function", &function, &local_err);
+ if (local_err) {
+ goto out;
+ }
+ dev->devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), function);
+out:
+ error_propagate(errp, local_err);
+}
+
static void pci_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
@@ -2519,6 +2644,19 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
k->bus_type = TYPE_PCI_BUS;
k->props = pci_props;
pc->realize = pci_default_realize;
+
+ /* Internally, bits 3:8 of devfn are called "slots", but:
+ * - they can be confused with physical slot numbers;
+ * - TYPE_PCIE_SLOT objects already have a "slot" property.
+ * So we use the terminology used in the PCI specifiction:
+ * "device number".
+ */
+ object_class_property_add(klass, "device-number", "uint32",
+ pci_device_get_devnr, pci_device_set_devnr,
+ NULL, NULL, &error_abort);
+ object_class_property_add(klass, "function", "uint32",
+ pci_device_get_function, pci_device_set_function,
+ NULL, NULL, &error_abort);
}
static void pci_device_class_base_init(ObjectClass *klass, void *data)
@@ -2607,33 +2745,6 @@ void pci_bus_get_w64_range(PCIBus *bus, Range *range)
pci_for_each_device_under_bus(bus, pci_dev_get_w64, range);
}
-static bool pcie_has_upstream_port(PCIDevice *dev)
-{
- PCIDevice *parent_dev = pci_bridge_get_device(dev->bus);
-
- /* Device associated with an upstream port.
- * As there are several types of these, it's easier to check the
- * parent device: upstream ports are always connected to
- * root or downstream ports.
- */
- return parent_dev &&
- pci_is_express(parent_dev) &&
- parent_dev->exp.exp_cap &&
- (pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_ROOT_PORT ||
- pcie_cap_get_type(parent_dev) == PCI_EXP_TYPE_DOWNSTREAM);
-}
-
-PCIDevice *pci_get_function_0(PCIDevice *pci_dev)
-{
- if(pcie_has_upstream_port(pci_dev)) {
- /* With an upstream PCIe port, we only support 1 device at slot 0 */
- return pci_dev->bus->devices[0];
- } else {
- /* Other bus types might support multiple devices at slots 0-31 */
- return pci_dev->bus->devices[PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 0)];
- }
-}
-
MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
{
MSIMessage msg;
diff --git a/qdev-monitor.c b/qdev-monitor.c
index c73410c..44f8b5c 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -29,6 +29,8 @@
#include "qemu/error-report.h"
#include "qemu/help_option.h"
#include "sysemu/block-backend.h"
+#include "qapi/clone-visitor.h"
+#include "hw/boards.h"
/*
* Aliases were a bad idea from the start. Let's keep them
@@ -399,12 +401,6 @@ static DeviceState *qbus_find_dev(BusState *bus, char *elem)
return NULL;
}
-static inline bool qbus_is_full(BusState *bus)
-{
- BusClass *bus_class = BUS_GET_CLASS(bus);
- return bus_class->max_dev && bus->max_index >= bus_class->max_dev;
-}
-
/*
* Search the tree rooted at @bus for a bus.
* If @name, search for a bus with that name. Note that bus names
@@ -631,6 +627,86 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
return dev;
}
+typedef struct SlotListState {
+ MachineState *machine;
+ DeviceSlotInfoList *result;
+ DeviceSlotInfoList **next;
+ Error *err;
+} SlotListState;
+
+static int walk_bus(Object *obj, void *opaque)
+{
+ SlotListState *s = opaque;
+
+ /* sysbus is special: never return it unless the machine
+ * supports dynamic sysbus devices.
+ */
+ if (object_dynamic_cast(obj, TYPE_BUS) &&
+ (!object_dynamic_cast(obj, TYPE_SYSTEM_BUS) ||
+ MACHINE_GET_CLASS(s->machine)->has_dynamic_sysbus)) {
+ BusState *bus = BUS(obj);
+ BusClass *bc = BUS_GET_CLASS(bus);
+ DeviceSlotInfoList *l = bc->enumerate_slots(bus, &s->err);
+ *s->next = l;
+ for (; l; l = l->next) {
+ s->next = &l->next;
+ }
+ if (s->err) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+DeviceSlotInfoList *qmp_query_device_slots(Error **errp)
+{
+ SlotListState s = { };
+ MachineState *ms = MACHINE(qdev_get_machine());
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
+
+ s.machine = ms;
+ s.next = &s.result;
+
+ /* We build the device slot list from two sources:
+ * 1) Calling the BusClass::enumerate_slots() method on all buses;
+ * 2) The return value of MachineClass::query_hotpluggable_cpus()
+ */
+
+
+ object_child_foreach_recursive(qdev_get_machine(), walk_bus, &s);
+ if (s.err) {
+ goto out;
+ }
+
+ if (mc->query_hotpluggable_cpus) {
+ HotpluggableCPUList *hcl = mc->query_hotpluggable_cpus(ms);
+ HotpluggableCPUList *i;
+
+ for (i = hcl; i; i = i->next) {
+ DeviceSlotInfoList *r = g_new0(DeviceSlotInfoList, 1);
+ HotpluggableCPU *hc = i->value;
+ r->value = g_new0(DeviceSlotInfo, 1);
+ r->value->type = DEVICE_SLOT_TYPE_CPU;
+ r->value->accepted_device_types = g_new0(strList, 1);
+ r->value->accepted_device_types->value = g_strdup(hc->type);
+ r->value->available = !hc->has_qom_path;
+ /*TODO: should it be always true? */
+ r->value->hotpluggable = true;
+
+ r->value->u.cpu.props = QAPI_CLONE(CpuInstanceProperties,
+ hc->props);
+ *s.next = r;
+ s.next = & r->next;
+ }
+
+ qapi_free_HotpluggableCPUList(hcl);
+ }
+
+out:
+ error_propagate(errp, s.err);
+ return s.result;
+}
+
#define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__)
static void qbus_print(Monitor *mon, BusState *bus, int indent);
--
2.7.4
7 years, 11 months
[libvirt] [PATCH v2] [libvirt-ci] Add builders for Fedora 25 and remove builders for Fedora 23
by Yash Mankad
Add builders for Fedora 25 and remove builders for Fedora 23
for ci.centos.org
Signed-off-by: Yash Mankad <ymankad(a)redhat.com>
---
projects/libosinfo.yaml | 2 +-
projects/libvirt-cim.yaml | 2 +-
projects/libvirt-glib.yaml | 2 +-
projects/libvirt-perl.yaml | 2 +-
projects/libvirt-python.yaml | 2 +-
projects/libvirt-sandbox.yaml | 2 +-
projects/libvirt-tck.yaml | 2 +-
projects/libvirt.yaml | 6 +++---
projects/osinfo-db-tools.yaml | 2 +-
projects/osinfo-db.yaml | 2 +-
projects/virt-manager.yaml | 2 +-
projects/virt-viewer.yaml | 2 +-
12 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/projects/libosinfo.yaml b/projects/libosinfo.yaml
index 49639f3..6562fa8 100644
--- a/projects/libosinfo.yaml
+++ b/projects/libosinfo.yaml
@@ -3,8 +3,8 @@
name: libosinfo
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: libosinfo
make_env: |
diff --git a/projects/libvirt-cim.yaml b/projects/libvirt-cim.yaml
index d1705af..a2b1086 100644
--- a/projects/libvirt-cim.yaml
+++ b/projects/libvirt-cim.yaml
@@ -4,8 +4,8 @@
machines:
- libvirt-centos-6
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: libvirt CIM
jobs:
diff --git a/projects/libvirt-glib.yaml b/projects/libvirt-glib.yaml
index 38bcded..c3f60db 100644
--- a/projects/libvirt-glib.yaml
+++ b/projects/libvirt-glib.yaml
@@ -3,8 +3,8 @@
name: libvirt-glib
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt GLib
jobs:
diff --git a/projects/libvirt-perl.yaml b/projects/libvirt-perl.yaml
index 2bad51d..668de7d 100644
--- a/projects/libvirt-perl.yaml
+++ b/projects/libvirt-perl.yaml
@@ -3,8 +3,8 @@
name: libvirt-perl
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt Perl
jobs:
diff --git a/projects/libvirt-python.yaml b/projects/libvirt-python.yaml
index baca308..1df43bf 100644
--- a/projects/libvirt-python.yaml
+++ b/projects/libvirt-python.yaml
@@ -4,8 +4,8 @@
machines:
- libvirt-centos-6
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt Python
jobs:
diff --git a/projects/libvirt-sandbox.yaml b/projects/libvirt-sandbox.yaml
index eee249c..97abbe9 100644
--- a/projects/libvirt-sandbox.yaml
+++ b/projects/libvirt-sandbox.yaml
@@ -2,8 +2,8 @@
- project:
name: libvirt-sandbox
machines:
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt Sandbox
jobs:
diff --git a/projects/libvirt-tck.yaml b/projects/libvirt-tck.yaml
index 571f3ce..0c3515b 100644
--- a/projects/libvirt-tck.yaml
+++ b/projects/libvirt-tck.yaml
@@ -2,8 +2,8 @@
- project:
name: libvirt-tck
machines:
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt TCK
jobs:
diff --git a/projects/libvirt.yaml b/projects/libvirt.yaml
index 20de27c..a75d2a7 100644
--- a/projects/libvirt.yaml
+++ b/projects/libvirt.yaml
@@ -4,8 +4,8 @@
machines:
- libvirt-centos-6
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Libvirt
archive_format: xz
@@ -16,8 +16,8 @@
- libvirt-centos-6
- libvirt-centos-7
- libvirt-debian
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
- libvirt-freebsd
- autotools-syntax-check-job:
@@ -26,8 +26,8 @@
- libvirt-centos-6
- libvirt-centos-7
- libvirt-debian
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
check_env: |
export VIR_TEST_EXPENSIVE=1
diff --git a/projects/osinfo-db-tools.yaml b/projects/osinfo-db-tools.yaml
index bcb63da..5aff41b 100644
--- a/projects/osinfo-db-tools.yaml
+++ b/projects/osinfo-db-tools.yaml
@@ -3,8 +3,8 @@
name: osinfo-db-tools
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: osinfo database tools
jobs:
diff --git a/projects/osinfo-db.yaml b/projects/osinfo-db.yaml
index f48aa3f..c8b60b5 100644
--- a/projects/osinfo-db.yaml
+++ b/projects/osinfo-db.yaml
@@ -3,8 +3,8 @@
name: osinfo-db
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: osinfo database
jobs:
diff --git a/projects/virt-manager.yaml b/projects/virt-manager.yaml
index 737e37d..5268085 100644
--- a/projects/virt-manager.yaml
+++ b/projects/virt-manager.yaml
@@ -3,8 +3,8 @@
name: virt-manager
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Virtual Machine Manager
jobs:
diff --git a/projects/virt-viewer.yaml b/projects/virt-viewer.yaml
index d7b7108..5076f1b 100644
--- a/projects/virt-viewer.yaml
+++ b/projects/virt-viewer.yaml
@@ -3,8 +3,8 @@
name: virt-viewer
machines:
- libvirt-centos-7
- - libvirt-fedora-23
- libvirt-fedora-24
+ - libvirt-fedora-25
- libvirt-fedora-rawhide
title: Virt Viewer
jobs:
--
2.7.4
7 years, 11 months
[libvirt] [PATCH v1] libxl: reverse defaults on HVM net device attach
by Joao Martins
libvirt libxl picks its own default with respect to the default NIC
to use. libxlMakeNic is the one responsible for this and on boot it
picks LIBXL_NIC_TYPE_VIF_IOEMU for HVM domains such that it accomodates
both PV and emulated one. The good behaving guest at boot will then
select the pv and unplug the emulated device.
Now, on HVM when attaching an interface it will pick the same default
that is LIBXL_NIC_TYPE_VIF_IOEMU which as a result will fail the attach
(see xen commit 32e9d0f ("libxl: nic type defaults to vif in hotplug for
hvm guest"). Xen doesn't yet support the hotplug of emulated devices,
but we don't want to rule out that case either, which might get support
in the future. Hence we simply reverse the defaults when we are
attaching the interface which allows libvirt to prefer the PV nic first
without adding "model='netfront'" following the same pattern as above
commit. Also to avoid ruling out the emulated one we set to
LIBXL_NIC_TYPE_IOEMU when setting a model type that is not 'netfront'.
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Since RFC:
- Joao: Add mention to HVM domains in the first paragraph of commit
message.
- Jim: Add comment about libxl_device_nic type inner workings
- Jim: Prevent attach on PV when model != netfront
- Joao: Remove now unused ioemu_nic variable
- Joao: Append one small paragraph about why we mimic xl/libxl
---
src/libxl/libxl_conf.c | 39 +++++++++++++++++++++++++++++++--------
src/libxl/libxl_conf.h | 3 ++-
src/libxl/libxl_driver.c | 2 +-
3 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index dcf8e7e..9515e2a 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -881,9 +881,9 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
int
libxlMakeNic(virDomainDefPtr def,
virDomainNetDefPtr l_nic,
- libxl_device_nic *x_nic)
+ libxl_device_nic *x_nic,
+ bool attach)
{
- bool ioemu_nic = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
virDomainNetType actual_type = virDomainNetGetActualType(l_nic);
virNetworkPtr network = NULL;
virConnectPtr conn = NULL;
@@ -907,16 +907,39 @@ libxlMakeNic(virDomainDefPtr def,
virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
- if (ioemu_nic)
- x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
- else
- x_nic->nictype = LIBXL_NIC_TYPE_VIF;
-
+ /*
+ * The nictype field of libxl_device_nic structure tells Xen which type of
+ * NIC device to create for the domain. LIBXL_NIC_TYPE_VIF specifies a
+ * PV NIC. LIBXL_NIC_TYPE_VIF_IOEMU specifies a PV and emulated NIC,
+ * allowing the domain to choose which NIC to use and unplug the unused
+ * one. LIBXL_NIC_TYPE_VIF_IOEMU is only valid for HVM domains. Further,
+ * if hotplugging the NIC, emulated NICs are currently not supported.
+ * Alternatively one could set LIBXL_NIC_TYPE_UNKNOWN and let libxl decide,
+ * but its behaviour might not be consistent across all libvirt supported
+ * versions. The other nictype values are well established already, hence
+ * we manually select our own default and mimic xl/libxl behaviour starting
+ * xen commit 32e9d0f ("libxl: nic type defaults to vif in hotplug for
+ * hvm guest").
+ */
if (l_nic->model) {
+ if (def->os.type == VIR_DOMAIN_OSTYPE_XEN &&
+ STRNEQ(l_nic->model, "netfront")) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("only model 'netfront' is supported for "
+ "Xen PV domains"));
+ return -1;
+ }
if (VIR_STRDUP(x_nic->model, l_nic->model) < 0)
goto cleanup;
if (STREQ(l_nic->model, "netfront"))
x_nic->nictype = LIBXL_NIC_TYPE_VIF;
+ else
+ x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
+ } else {
+ if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && !attach)
+ x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
+ else
+ x_nic->nictype = LIBXL_NIC_TYPE_VIF;
}
if (VIR_STRDUP(x_nic->ifname, l_nic->ifname) < 0)
@@ -1047,7 +1070,7 @@ libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config)
if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
continue;
- if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics]))
+ if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics], false))
goto error;
/*
* The devid (at least right now) will not get initialized by
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 0ea76b4..851f3af 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -178,7 +178,8 @@ libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
int
libxlMakeNic(virDomainDefPtr def,
virDomainNetDefPtr l_nic,
- libxl_device_nic *x_nic);
+ libxl_device_nic *x_nic,
+ bool attach);
int
libxlMakeVfb(virPortAllocatorPtr graphicsports,
virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index b19b17e..7e5d9b6 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3379,7 +3379,7 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver,
goto cleanup;
}
- if (libxlMakeNic(vm->def, net, &nic) < 0)
+ if (libxlMakeNic(vm->def, net, &nic, true) < 0)
goto cleanup;
if (libxl_device_nic_add(cfg->ctx, vm->def->id, &nic, 0)) {
--
2.1.4
7 years, 11 months
[libvirt] [PATCH v2 00/10] admin: Introduce runtime logging APIs
by Erik Skultety
v1 here https://www.redhat.com/archives/libvir-list/2016-November/msg00009.html
since v1:
- incorporated notes raised during review
- allowed passing of NULL via the public APIs
* behaves the same way as an empty string, but lead to even more code
reduction in 'daemonSetupLogging' for practically no extra code to enable
such feature
- added forgotten documentation
- updated NEWS file
Erik Skultety (10):
virlog: Introduce virLog{Get,Set}DefaultOutput
admin: Allow passing NULL to virLogSetFilters
daemon: Hook up the virLog{Get,Set}DefaultOutput to the daemon's init
routine
admin: Introduce virAdmConnectGetLoggingOutputs
admin: Introduce virAdmConnectGetLoggingFilters
admin: Introduce virAdmConnectSetLoggingOutputs
admin: Introduce virAdmConnectSetLoggingFilters
virt-admin: Wire-up the logging APIs
admin: Add an example demonstrating how to use the logging APIs
admin: Update the news file to include the new logging features
.gitignore | 1 +
daemon/admin.c | 104 ++++++++++++++++++++++++++
daemon/libvirtd.c | 96 ++++--------------------
docs/news.html.in | 4 +
examples/Makefile.am | 3 +-
examples/admin/logging.c | 102 ++++++++++++++++++++++++++
include/libvirt/libvirt-admin.h | 16 ++++
src/admin/admin_protocol.x | 50 ++++++++++++-
src/admin/admin_remote.c | 70 ++++++++++++++++++
src/admin_protocol-structs | 26 +++++++
src/libvirt-admin.c | 157 ++++++++++++++++++++++++++++++++++++++++
src/libvirt_admin_private.syms | 6 ++
src/libvirt_admin_public.syms | 8 ++
src/libvirt_private.syms | 2 +
src/locking/lock_daemon.c | 90 ++++-------------------
src/logging/log_daemon.c | 92 ++++-------------------
src/util/virlog.c | 100 ++++++++++++++++++++++++-
src/util/virlog.h | 4 +-
tools/virt-admin.c | 120 ++++++++++++++++++++++++++++++
tools/virt-admin.pod | 90 +++++++++++++++++++++++
20 files changed, 899 insertions(+), 242 deletions(-)
create mode 100644 examples/admin/logging.c
--
2.5.5
7 years, 11 months
[libvirt] [PATCH v2 00/21] Run qemu under its own namespace
by Michal Privoznik
v1 posted here:
https://www.redhat.com/archives/libvir-list/2016-November/msg01208.html
diff to v1:
- I've dropped the patches for hugepages which are posted separately [1]
- I've reworked some parts according to Dan's suggestions
- Filled missing impl for virSCSIVHostDevice which was merged meanwhile
Please note that patches 1-5, 7 were ACKed already.
You can also find the patches on my github:
https://github.com/zippy2/libvirt/tree/qemu_container_v3
(Yeah, _v2 branch is not good enough.)
1: https://www.redhat.com/archives/libvir-list/2016-November/msg01415.html
Michal Privoznik (21):
virprocess: Introduce virProcessSetupPrivateMountNS
virfile: Introduce virFileSetupDev
virfile: Introduce ACL helpers
virusb: Introduce virUSBDeviceGetPath
virscsi: Introduce virSCSIDeviceGetPath
virscsivhost: Introduce virSCSIVHostDeviceGetPath
qemu_cgroup: Expose defaultDeviceACL
qemu: Spawn qemu under mount namespace
qemu: Prepare disks when starting a domain
qemu: Prepare hostdevs when starting a domain
qemu: Prepare chardevs when starting a domain
qemu: Prepare TPM when starting a domain
qemu: Prepare inputs when starting a domain
qemu: Prepare RNGs when starting a domain
qemu: Enter the namespace on relabelling
qemu: Manage /dev entry on disk hotplug
qemu: Manage /dev entry on hostdev hotplug
qemu: Manage /dev entry on chardev hotplug
qemu: Manage /dev entry on RNG hotplug
qemu: Let users opt-out from containerization
qemu: Enable mount namespace
config-post.h | 2 +
configure.ac | 12 +-
src/Makefile.am | 7 +-
src/libvirt_private.syms | 10 +
src/lxc/lxc_container.c | 20 +-
src/lxc/lxc_controller.c | 32 +-
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 8 +
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/qemu_cgroup.h | 1 +
src/qemu/qemu_conf.c | 33 +
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_domain.c | 1244 +++++++++++++++++++++++++++++++++++-
src/qemu/qemu_domain.h | 52 ++
src/qemu/qemu_driver.c | 5 +-
src/qemu/qemu_hotplug.c | 90 ++-
src/qemu/qemu_process.c | 28 +-
src/qemu/qemu_security.c | 198 ++++++
src/qemu/qemu_security.h | 55 ++
src/qemu/test_libvirtd_qemu.aug.in | 3 +
src/util/virfile.c | 153 +++++
src/util/virfile.h | 17 +
src/util/virprocess.c | 38 ++
src/util/virprocess.h | 2 +
src/util/virscsi.c | 6 +
src/util/virscsi.h | 1 +
src/util/virscsivhost.c | 7 +
src/util/virscsivhost.h | 1 +
src/util/virusb.c | 5 +
src/util/virusb.h | 1 +
30 files changed, 1951 insertions(+), 85 deletions(-)
create mode 100644 src/qemu/qemu_security.c
create mode 100644 src/qemu/qemu_security.h
--
2.11.0
7 years, 11 months
[libvirt] [PATCH 0/2] qemu: fix few image/resource locking problems
by Peter Krempa
The problem from patch 2/2 made me to look at the locking infrastructure in
libvirt. There are a few broken places. This fixes two mistakes but more patches
will come.
Peter Krempa (2):
qemu: monitor: Don't resume lockspaces in resume event handler
qemu: snapshot: Don't attempt to resume cpus if they were not paused
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_process.c | 11 -----------
2 files changed, 2 insertions(+), 13 deletions(-)
--
2.11.0
7 years, 11 months