[libvirt] [PATCH v3 2/4] qemu: assign virtio devices to PCIe slot when appropriate
by Laine Stump
libvirt previously assigned nearly all devices to a hotpluggable
legacy PCI slot even on machines with a PCIe root complex. Doing this
means that the domain will need a dmi-to-pci-bridge (to convert from
PCIe to legacy PCI) and a pci-bridge (to provide hotpluggable legacy
PCI slots.
To help reduce the need for these legacy controllers, this patch
checks for the QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY capability (if that
capability is present, then all virtio devices will automatically
present as PCIe when attached to a PCIe controller, or PCI when
attached to a legacy PCI controller), and assigns virtio devices to a
hotpluggable PCIe slot instead.
NB: since the slot must be hotpluggable, and pcie-root (the PCIe root
complex) does *not* support hotplug, this means that suitable
controllers must also be in the config (i.e. either pcie-root-port, or
pcie-downstream-port). For now, libvirt doesn't add those
automatically, so if you put virtio devices in a config for a qemu
that has PCIe-capable virtio devices, you'll need to add extra
pcie-root-ports yourself. That requirement will be eliminated in a
future patch, but for now, it's simple to do this:
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
...
Partially Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1330024
---
change from V2: incorporated Anrea's suggestions from V2 review
src/qemu/qemu_domain_address.c | 103 ++++++++++----
tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args | 57 ++++++++
tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml | 60 +++++++++
.../qemuxml2argv-q35-virtio-pci.args | 57 ++++++++
.../qemuxml2argv-q35-virtio-pci.xml | 1 +
tests/qemuxml2argvtest.c | 45 +++++++
.../qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml | 149 +++++++++++++++++++++
.../qemuxml2xmlout-q35-virtio-pci.xml | 149 +++++++++++++++++++++
tests/qemuxml2xmltest.c | 40 ++++++
9 files changed, 633 insertions(+), 28 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pci.xml
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 3d52d72..73f4241 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -996,16 +996,25 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
virDomainPCIAddressSetPtr addrs)
{
size_t i, j;
- virDomainPCIConnectFlags flags = 0; /* initialize to quiet gcc warning */
+ virDomainPCIConnectFlags virtioFlags;
+ virDomainPCIConnectFlags pciFlags;
+ virDomainPCIConnectFlags pcieFlags;
virPCIDeviceAddress tmp_addr;
+ bool havePCIeRoot = false;
/* PCI controllers */
for (i = 0; i < def->ncontrollers; i++) {
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
virDomainControllerModelPCI model = def->controllers[i]->model;
+ virDomainPCIConnectFlags flags;
+ flags = virDomainPCIControllerModelToConnectType(model);
+
+ if (model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) {
+ havePCIeRoot = true;
+ continue;
+ }
if (model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT ||
- model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT ||
!virDeviceInfoPCIAddressWanted(&def->controllers[i]->info))
continue;
@@ -1013,7 +1022,6 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
* flag to use when searching for the proper
* controller/bus to connect it to on the upstream side.
*/
- flags = virDomainPCIControllerModelToConnectType(model);
if (virDomainPCIAddressReserveNextSlot(addrs,
&def->controllers[i]->info,
flags) < 0)
@@ -1021,12 +1029,20 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
}
}
- /* all other devices that plug into a PCI slot are treated as a
- * PCI endpoint devices that require a hotplug-capable slot
- * (except for some special cases which have specific handling
- * below)
+ pciFlags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+ pcieFlags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE;
+
+ /* if qemu has the disable-legacy option for
+ * virtio-net, then its virtio devices will present
+ * themselves as PCIe devices when plugged into a PCIe
+ * slot, so we can safely assign them to a PCIe slot.
*/
- flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+ if (havePCIeRoot &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) {
+ virtioFlags = pcieFlags;
+ } else {
+ virtioFlags = pciFlags;
+ }
for (i = 0; i < def->nfss; i++) {
if (!virDeviceInfoPCIAddressWanted(&def->fss[i]->info))
@@ -1035,7 +1051,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
/* Only support VirtIO-9p-pci so far. If that changes,
* we might need to skip devices here */
if (virDomainPCIAddressReserveNextSlot(addrs, &def->fss[i]->info,
- flags) < 0)
+ virtioFlags) < 0)
goto error;
}
@@ -1045,12 +1061,20 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
* in hostdevs list anyway, so handle them with other hostdevs
* instead of here.
*/
- if ((def->nets[i]->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) ||
- !virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) {
+ virDomainNetDefPtr net = def->nets[i];
+ virDomainPCIConnectFlags flags;
+
+ if ((net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) ||
+ !virDeviceInfoPCIAddressWanted(&net->info)) {
continue;
}
- if (virDomainPCIAddressReserveNextSlot(addrs, &def->nets[i]->info,
- flags) < 0)
+
+ if (STREQ(net->model, "virtio"))
+ flags = virtioFlags;
+ else
+ flags = pciFlags;
+
+ if (virDomainPCIAddressReserveNextSlot(addrs, &net->info, flags) < 0)
goto error;
}
@@ -1065,7 +1089,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
continue;
if (virDomainPCIAddressReserveNextSlot(addrs, &def->sounds[i]->info,
- flags) < 0)
+ pciFlags) < 0)
goto error;
}
@@ -1132,7 +1156,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (!foundAddr) {
/* This is the first part of the controller, so need
* to find a free slot & then reserve a function */
- if (virDomainPCIAddressGetNextSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressGetNextSlot(addrs, &tmp_addr,
+ pciFlags) < 0)
goto error;
addr.bus = tmp_addr.bus;
@@ -1143,13 +1168,24 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
addrs->lastaddr.multi = VIR_TRISTATE_SWITCH_ABSENT;
}
/* Finally we can reserve the slot+function */
- if (virDomainPCIAddressReserveAddr(addrs, &addr, flags,
+ if (virDomainPCIAddressReserveAddr(addrs, &addr, pciFlags,
false, foundAddr) < 0)
goto error;
def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
def->controllers[i]->info.addr.pci = addr;
} else {
+ virDomainPCIConnectFlags flags;
+
+ if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
+ def->controllers[i]->model ==
+ VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) ||
+ (def->controllers[i]->type ==
+ VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL))
+ flags = virtioFlags;
+ else
+ flags = pciFlags;
+
if (virDomainPCIAddressReserveNextSlot(addrs,
&def->controllers[i]->info,
flags) < 0)
@@ -1185,7 +1221,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
}
if (virDomainPCIAddressReserveNextSlot(addrs, &def->disks[i]->info,
- flags) < 0)
+ virtioFlags) < 0)
goto error;
}
@@ -1199,7 +1235,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (virDomainPCIAddressReserveNextSlot(addrs,
def->hostdevs[i]->info,
- flags) < 0)
+ pciFlags) < 0)
goto error;
}
@@ -1207,9 +1243,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (def->memballoon &&
def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO &&
virDeviceInfoPCIAddressWanted(&def->memballoon->info)) {
+
if (virDomainPCIAddressReserveNextSlot(addrs,
&def->memballoon->info,
- flags) < 0)
+ virtioFlags) < 0)
goto error;
}
@@ -1219,8 +1256,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
!virDeviceInfoPCIAddressWanted(&def->rngs[i]->info))
continue;
- if (virDomainPCIAddressReserveNextSlot(addrs,
- &def->rngs[i]->info, flags) < 0)
+ if (virDomainPCIAddressReserveNextSlot(addrs, &def->rngs[i]->info,
+ virtioFlags) < 0)
goto error;
}
@@ -1228,8 +1265,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (def->watchdog &&
def->watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB &&
virDeviceInfoPCIAddressWanted(&def->watchdog->info)) {
+
if (virDomainPCIAddressReserveNextSlot(addrs, &def->watchdog->info,
- flags) < 0)
+ pciFlags) < 0)
goto error;
}
@@ -1237,6 +1275,13 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
* assigned address. */
if (def->nvideos > 0 &&
virDeviceInfoPCIAddressWanted(&def->videos[0]->info)) {
+ virDomainPCIConnectFlags flags;
+
+ if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO)
+ flags = virtioFlags;
+ else
+ flags = pciFlags;
+
if (virDomainPCIAddressReserveNextSlot(addrs, &def->videos[0]->info,
flags) < 0)
goto error;
@@ -1251,8 +1296,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
}
if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
continue;
+
if (virDomainPCIAddressReserveNextSlot(addrs, &def->videos[i]->info,
- flags) < 0)
+ pciFlags) < 0)
goto error;
}
@@ -1261,8 +1307,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (!virDeviceInfoPCIAddressWanted(&def->shmems[i]->info))
continue;
- if (virDomainPCIAddressReserveNextSlot(addrs,
- &def->shmems[i]->info, flags) < 0)
+ if (virDomainPCIAddressReserveNextSlot(addrs, &def->shmems[i]->info,
+ pciFlags) < 0)
goto error;
}
for (i = 0; i < def->ninputs; i++) {
@@ -1270,8 +1316,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
!virDeviceInfoPCIAddressWanted(&def->inputs[i]->info))
continue;
- if (virDomainPCIAddressReserveNextSlot(addrs,
- &def->inputs[i]->info, flags) < 0)
+ if (virDomainPCIAddressReserveNextSlot(addrs, &def->inputs[i]->info,
+ virtioFlags) < 0)
goto error;
}
for (i = 0; i < def->nparallels; i++) {
@@ -1284,7 +1330,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
!virDeviceInfoPCIAddressWanted(&chr->info))
continue;
- if (virDomainPCIAddressReserveNextSlot(addrs, &chr->info, flags) < 0)
+ if (virDomainPCIAddressReserveNextSlot(addrs, &chr->info,
+ pciFlags) < 0)
goto error;
}
for (i = 0; i < def->nchannels; i++) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args
new file mode 100644
index 0000000..2ea0c08
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args
@@ -0,0 +1,57 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/libexec/qemu-kvm \
+-name q35-test \
+-S \
+-M q35 \
+-m 2048 \
+-smp 2,sockets=2,cores=1,threads=1 \
+-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \
+-no-acpi \
+-boot c \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
+-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
+-device ioh3420,port=0x18,chassis=4,id=pci.4,bus=pcie.0,addr=0x3 \
+-device ioh3420,port=0x20,chassis=5,id=pci.5,bus=pcie.0,addr=0x4 \
+-device ioh3420,port=0x28,chassis=6,id=pci.6,bus=pcie.0,addr=0x5 \
+-device ioh3420,port=0x30,chassis=7,id=pci.7,bus=pcie.0,addr=0x6 \
+-device ioh3420,port=0x38,chassis=8,id=pci.8,bus=pcie.0,addr=0x7 \
+-device ioh3420,port=0x40,chassis=9,id=pci.9,bus=pcie.0,addr=0x8 \
+-device ioh3420,port=0x48,chassis=10,id=pci.10,bus=pcie.0,addr=0x9 \
+-device ioh3420,port=0x50,chassis=11,id=pci.11,bus=pcie.0,addr=0xa \
+-device ioh3420,port=0x58,chassis=12,id=pci.12,bus=pcie.0,addr=0xb \
+-device ioh3420,port=0x60,chassis=13,id=pci.13,bus=pcie.0,addr=0xc \
+-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \
+-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,\
+addr=0x1d \
+-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 \
+-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \
+-device virtio-scsi-pci,id=scsi0,bus=pci.6,addr=0x0 \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.5,addr=0x0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk1 \
+-device virtio-blk-pci,bus=pci.7,addr=0x0,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/to/guest \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=/import/from/host,\
+bus=pci.3,addr=0x0 \
+-netdev user,id=hostnet0 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.4,\
+addr=0x0 \
+-device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234,bus=pci.10,\
+addr=0x0 \
+-device virtio-mouse-pci,id=input1,bus=pci.11,addr=0x0 \
+-device virtio-keyboard-pci,id=input2,bus=pci.12,addr=0x0 \
+-device virtio-tablet-pci,id=input3,bus=pci.13,addr=0x0 \
+-device virtio-vga,id=video0,bus=pcie.0,addr=0x1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.8,addr=0x0 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.9,\
+addr=0x0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml
new file mode 100644
index 0000000..7bed08c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml
@@ -0,0 +1,60 @@
+<domain type='qemu'>
+ <name>q35-test</name>
+ <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='pci' model='pcie-root'/>
+ <controller type='pci' model='dmi-to-pci-bridge'/>
+ <controller type='pci' model='pci-bridge'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='pci' model='pcie-root-port'/>
+ <controller type='virtio-serial'/>
+ <controller type='scsi' model='virtio-scsi'/>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='vdb' bus='virtio'/>
+ </disk>
+ <filesystem type='mount'>
+ <source dir='/export/to/guest'/>
+ <target dir='/import/from/host'/>
+ </filesystem>
+ <video>
+ <model type='virtio'/>
+ </video>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ </interface>
+ <memballoon model='virtio'/>
+ <rng model='virtio'>
+ <rate bytes='123' period='1234'/>
+ <backend model='random'>/dev/urandom</backend>
+ </rng>
+ <input type='passthrough' bus='virtio'>
+ <source evdev='/dev/input/event1234'/>
+ </input>
+ <input type='mouse' bus='virtio'/>
+ <input type='keyboard' bus='virtio'/>
+ <input type='tablet' bus='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args
new file mode 100644
index 0000000..7cedc82
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args
@@ -0,0 +1,57 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/libexec/qemu-kvm \
+-name q35-test \
+-S \
+-M q35 \
+-m 2048 \
+-smp 2,sockets=2,cores=1,threads=1 \
+-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \
+-no-acpi \
+-boot c \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
+-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
+-device ioh3420,port=0x18,chassis=4,id=pci.4,bus=pcie.0,addr=0x3 \
+-device ioh3420,port=0x20,chassis=5,id=pci.5,bus=pcie.0,addr=0x4 \
+-device ioh3420,port=0x28,chassis=6,id=pci.6,bus=pcie.0,addr=0x5 \
+-device ioh3420,port=0x30,chassis=7,id=pci.7,bus=pcie.0,addr=0x6 \
+-device ioh3420,port=0x38,chassis=8,id=pci.8,bus=pcie.0,addr=0x7 \
+-device ioh3420,port=0x40,chassis=9,id=pci.9,bus=pcie.0,addr=0x8 \
+-device ioh3420,port=0x48,chassis=10,id=pci.10,bus=pcie.0,addr=0x9 \
+-device ioh3420,port=0x50,chassis=11,id=pci.11,bus=pcie.0,addr=0xa \
+-device ioh3420,port=0x58,chassis=12,id=pci.12,bus=pcie.0,addr=0xb \
+-device ioh3420,port=0x60,chassis=13,id=pci.13,bus=pcie.0,addr=0xc \
+-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \
+-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,\
+addr=0x1d \
+-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 \
+-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \
+-device virtio-scsi-pci,id=scsi0,bus=pci.2,addr=0x4 \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x3 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk1 \
+-device virtio-blk-pci,bus=pci.2,addr=0x5,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/to/guest \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=/import/from/host,\
+bus=pci.2,addr=0x1 \
+-netdev user,id=hostnet0 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.2,\
+addr=0x2 \
+-device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234,bus=pci.2,\
+addr=0x8 \
+-device virtio-mouse-pci,id=input1,bus=pci.2,addr=0x9 \
+-device virtio-keyboard-pci,id=input2,bus=pci.2,addr=0xa \
+-device virtio-tablet-pci,id=input3,bus=pci.2,addr=0xb \
+-device virtio-vga,id=video0,bus=pcie.0,addr=0x1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x6 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.2,\
+addr=0x7
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.xml
new file mode 120000
index 0000000..fc8c0ad
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.xml
@@ -0,0 +1 @@
+qemuxml2argv-q35-pcie.xml
\ No newline at end of file
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index e8b8cb4..e0d092a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1673,6 +1673,51 @@ mymain(void)
QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL);
+ /* verify that devices with pcie capability are assigned to a pcie slot */
+ DO_TEST("q35-pcie",
+ QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY,
+ QEMU_CAPS_DEVICE_VIRTIO_RNG,
+ QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_NETDEV,
+ QEMU_CAPS_DEVICE_VIRTIO_NET,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_VIRTIO_INPUT_HOST,
+ QEMU_CAPS_VIRTIO_SCSI,
+ QEMU_CAPS_FSDEV,
+ QEMU_CAPS_FSDEV_WRITEOUT,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_ICH9_AHCI,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ /* same XML as q35-pcie, but don't set QEMU_CAPS_VIRTIO_PCI_LEGACY,
+ * so virtio devices should be assigned to legacy pci slots
+ */
+ DO_TEST("q35-virtio-pci",
+ QEMU_CAPS_DEVICE_VIRTIO_RNG,
+ QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_NETDEV,
+ QEMU_CAPS_DEVICE_VIRTIO_NET,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_VIRTIO_INPUT_HOST,
+ QEMU_CAPS_VIRTIO_SCSI,
+ QEMU_CAPS_FSDEV,
+ QEMU_CAPS_FSDEV_WRITEOUT,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_ICH9_AHCI,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
DO_TEST("pcie-root-port",
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml
new file mode 100644
index 0000000..60e29b5
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml
@@ -0,0 +1,149 @@
+<domain type='qemu'>
+ <name>q35-test</name>
+ <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
+ </disk>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+ <model name='i82801b11-bridge'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
+ </controller>
+ <controller type='pci' index='2' model='pci-bridge'>
+ <model name='pci-bridge'/>
+ <target chassisNr='2'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='pci' index='3' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='3' port='0x10'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <controller type='pci' index='4' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='4' port='0x18'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='5' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='5' port='0x20'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <controller type='pci' index='6' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='6' port='0x28'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </controller>
+ <controller type='pci' index='7' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='7' port='0x30'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </controller>
+ <controller type='pci' index='8' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='8' port='0x38'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </controller>
+ <controller type='pci' index='9' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='9' port='0x40'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+ </controller>
+ <controller type='pci' index='10' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='10' port='0x48'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+ </controller>
+ <controller type='pci' index='11' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='11' port='0x50'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
+ </controller>
+ <controller type='pci' index='12' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='12' port='0x58'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
+ </controller>
+ <controller type='pci' index='13' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='13' port='0x60'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-ehci1'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'>
+ <master startport='0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci2'>
+ <master startport='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'>
+ <master startport='4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/export/to/guest'/>
+ <target dir='/import/from/host'/>
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+ </filesystem>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+ </interface>
+ <input type='passthrough' bus='virtio'>
+ <source evdev='/dev/input/event1234'/>
+ <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
+ </input>
+ <input type='mouse' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
+ </input>
+ <input type='keyboard' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x0c' slot='0x00' function='0x0'/>
+ </input>
+ <input type='tablet' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x0d' slot='0x00' function='0x0'/>
+ </input>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <video>
+ <model type='virtio' heads='1' primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </video>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
+ </memballoon>
+ <rng model='virtio'>
+ <rate bytes='123' period='1234'/>
+ <backend model='random'>/dev/urandom</backend>
+ <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
+ </rng>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pci.xml
new file mode 100644
index 0000000..5c5acac
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pci.xml
@@ -0,0 +1,149 @@
+<domain type='qemu'>
+ <name>q35-test</name>
+ <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
+ </disk>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+ <model name='i82801b11-bridge'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
+ </controller>
+ <controller type='pci' index='2' model='pci-bridge'>
+ <model name='pci-bridge'/>
+ <target chassisNr='2'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='pci' index='3' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='3' port='0x10'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <controller type='pci' index='4' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='4' port='0x18'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='5' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='5' port='0x20'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <controller type='pci' index='6' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='6' port='0x28'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </controller>
+ <controller type='pci' index='7' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='7' port='0x30'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </controller>
+ <controller type='pci' index='8' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='8' port='0x38'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </controller>
+ <controller type='pci' index='9' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='9' port='0x40'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+ </controller>
+ <controller type='pci' index='10' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='10' port='0x48'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+ </controller>
+ <controller type='pci' index='11' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='11' port='0x50'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
+ </controller>
+ <controller type='pci' index='12' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='12' port='0x58'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
+ </controller>
+ <controller type='pci' index='13' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='13' port='0x60'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-ehci1'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'>
+ <master startport='0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci2'>
+ <master startport='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'>
+ <master startport='4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/export/to/guest'/>
+ <target dir='/import/from/host'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
+ </filesystem>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
+ </interface>
+ <input type='passthrough' bus='virtio'>
+ <source evdev='/dev/input/event1234'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x08' function='0x0'/>
+ </input>
+ <input type='mouse' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x09' function='0x0'/>
+ </input>
+ <input type='keyboard' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x0a' function='0x0'/>
+ </input>
+ <input type='tablet' bus='virtio'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x0b' function='0x0'/>
+ </input>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <video>
+ <model type='virtio' heads='1' primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </video>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
+ </memballoon>
+ <rng model='virtio'>
+ <rate bytes='123' period='1234'/>
+ <backend model='random'>/dev/urandom</backend>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x07' function='0x0'/>
+ </rng>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 7601a5f..ffd1792 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -691,6 +691,46 @@ mymain(void)
QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION,
QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL);
+ DO_TEST("q35-pcie",
+ QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY,
+ QEMU_CAPS_DEVICE_VIRTIO_RNG,
+ QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_DEVICE_VIRTIO_NET,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_VIRTIO_INPUT_HOST,
+ QEMU_CAPS_VIRTIO_SCSI,
+ QEMU_CAPS_FSDEV,
+ QEMU_CAPS_FSDEV_WRITEOUT,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_ICH9_AHCI,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ /* same XML as q35-pcie, but don't set QEMU_CAPS_VIRTIO_PCI_LEGACY */
+ DO_TEST("q35-virtio-pci",
+ QEMU_CAPS_DEVICE_VIRTIO_RNG,
+ QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_DEVICE_VIRTIO_NET,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_VIRTIO_INPUT_HOST,
+ QEMU_CAPS_VIRTIO_SCSI,
+ QEMU_CAPS_FSDEV,
+ QEMU_CAPS_FSDEV_WRITEOUT,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_ICH9_AHCI,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
DO_TEST("pcie-root",
QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
--
2.7.4
8 years, 8 months
[libvirt] Question about virtio-pci in Aarch64
by Kevin Zhao
Hi Cole && All,
Nice meeting you in the libvirt mail-list. Greetings from Linaro !!!
I am Kevin Zhao from Linaro and working for OpenStack on Aarch64.
Nowadays I find that the default "virtio" bus is "virtio-mmio" , not
"virtio-pci". Since virtio-mmio do not has the host plugged function ,
something is wrong with the function in OpenStack Nova.
Then I search and find some mail information as belows by Cole :-)
1)
https://www.redhat.com/archives/libvir-list/2015-December/msg00217.html
2)
https://www.redhat.com/archives/libvir-list/2016-March/msg00167.html
I see some efforts have been doing by you. Really thanks for your
efforts for Aarch64. And I have some small questions.
1. Is Libvirt planning to replace the default virtio-mmio to
virtio-pci for Aarch64?
2. If not , how can I change the xml file(generated by Virsh) for
virtio-pci so that Qemu can recognize it ?
Really big thanks for your help. Looking forwards to your response!
Best Regards,
Kevin Zhao
8 years, 8 months
[libvirt] [PATCH] networkxml2conftest: Don't leak dnsmasq capabilities
by Michal Privoznik
==18324== 32 bytes in 1 blocks are still reachable in loss record 41 of 114
==18324== at 0x4C2C070: calloc (vg_replace_malloc.c:623)
==18324== by 0x4EA479B: virAlloc (viralloc.c:144)
==18324== by 0x4EA674A: virBitmapNewQuiet (virbitmap.c:77)
==18324== by 0x4EA67F7: virBitmapNew (virbitmap.c:106)
==18324== by 0x4EC777D: dnsmasqCapsNewEmpty (virdnsmasq.c:801)
==18324== by 0x4EC781B: dnsmasqCapsNewFromBuffer (virdnsmasq.c:815)
==18324== by 0x407CF4: mymain (networkxml2conftest.c:99)
==18324== by 0x409CF0: virTestMain (testutils.c:982)
==18324== by 0x4080EA: main (networkxml2conftest.c:136)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/networkxml2conftest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index 11e08c0..69b55ed 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -128,6 +128,10 @@ mymain(void)
DO_TEST("dhcp6-nat-network", dhcpv6);
DO_TEST("dhcp6host-routed-network", dhcpv6);
+ virObjectUnref(dhcpv6);
+ virObjectUnref(full);
+ virObjectUnref(restricted);
+
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.8.4
8 years, 8 months
[libvirt] problem with rbd auth after switch to secret objects
by Jim Fehlig
Hi John,
I've been having problems with rbd auth since the change to using qemu's secret
objects. E.g. when hotplugging disk config
<disk type="network" device="disk">
<driver name="qemu" type="raw" cache="none"/>
<source protocol="rbd" name="volumes/volume-f9c33a0a-5313-44fc-9624-c3b09ed21a57">
<host name="xxx.xxx.xxx.xxx" port="6789"/>
</source>
<auth username="cinder">
<secret type="ceph" uuid="dcff478d-8021-42c4-b57a-98b5f5447e8f"/>
</auth>
<target bus="virtio" dev="vdb"/>
</disk>
libvirt issues the following monitor commands
2016-08-08 16:13:41.720+0000: 27504: info : qemuMonitorSend:1006 :
QEMU_MONITOR_SEND_MSG: mon=0x7f55c4000f50
msg={"execute":"object-add","arguments":{"qom-type":"secret","id":"virtio-disk1-secret0","props":{"data":"w6x17STyqO9tMEOpAJy9Mnx+B5R1qrsJBXZZn/uZCKU=","keyid":"masterKey0","iv":"ZAE6WkKf+jDIl9lJkXGsnQ==","format":"base64"}},"id":"libvirt-12"}
2016-08-08 16:13:41.722+0000: 27504: debug : qemuMonitorJSONCommandWithFd:296 :
Send command
'{"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy
file=rbd:volumes/volume-f9c33a0a-5313-44fc-9624-c3b09ed21a57:id=cinder:auth_supported=cephx\\;none:mon_host=xxx.xx.xxx.xxx\\:6789,password-secret=virtio-disk1-secret0,format=raw,if=none,id=drive-virtio-disk1,cache=none"},"id":"libvirt-13"}'
The latter fails with
2016-08-08 16:13:41.733+0000: 27499: debug : virJSONValueFromString:1604 :
string={"return": "error connecting\r\n", "id": "libvirt-13"}
Debugging in the qemu rbd code, I found that
secretid = qemu_opt_get(opts, "password-secret");
in $qemu-src/block/rbd.c:qemu_rbd_create() returns NULL. The NULL secretid is
later passed to qemu_rbd_set_auth(), which silently returns success when
secretid==NULL. Later, rados_connect() fails with "error connecting" since the
secret was not configured.
I'm not familiar with qemu option parsing, but it seems the
...,password-secret=xxx,... associates the password-secret option parsing with
the drive object, whereas it needs to be associated with the rbd "file" object?
As a quick hack test, I made the following change in libvirt and then was able
to successfully attach the disk
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 55df23d..eb478fb 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1287,7 +1287,7 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
virBufferAddLit(buf, ",");
if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) {
- virBufferAsprintf(buf, "password-secret=%s,",
+ virBufferAsprintf(buf, "file.password-secret=%s,",
secinfo->s.aes.alias);
}
I suspect others (including yourself) have done this successfully without that
hack, so I'm not quite sure what the problem might be in my configuration. I'm
using libvirt.git master and qemu 2.6, but I didn't notice any post-2.6 patches
that would help on the qemu side.
Thanks for any suggestions.
Regards,
Jim
8 years, 8 months
[libvirt] [PATCH] util: Make virStringArrayHasString() const-correct
by Andrea Bolognani
The first argument should be const char ** instead of
char **, because this is a search function and as such it
doesn't, and shouldn't, alter the haystack in any way.
This change means we no longer have to cast arrays of
immutable strings to arrays of mutable strings; we still
have to do the opposite, though, but that's reasonable.
---
src/lxc/lxc_native.c | 5 +++--
src/qemu/qemu_capabilities.c | 4 ++--
src/qemu/qemu_monitor_json.c | 2 +-
src/qemu/qemu_process.c | 4 +++-
src/util/virstring.c | 3 ++-
src/util/virstring.h | 2 +-
tests/qemumonitorjsontest.c | 10 +++++-----
7 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 4b22e2a..94fb659 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -299,7 +299,7 @@ lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab)
type = VIR_DOMAIN_FS_TYPE_BLOCK;
/* Do we have ro in options? */
- readonly = virStringArrayHasString(options, "ro");
+ readonly = virStringArrayHasString((const char **) options, "ro");
if (lxcAddFSDef(def, type, src, dst, readonly, usage) < 0)
goto cleanup;
@@ -981,7 +981,8 @@ lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties)
for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) {
capString = virDomainCapsFeatureTypeToString(i);
- if (toDrop != NULL && virStringArrayHasString(toDrop, capString))
+ if (toDrop != NULL &&
+ virStringArrayHasString((const char **) toDrop, capString))
def->caps_features[i] = VIR_TRISTATE_SWITCH_OFF;
}
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 43e3ea7..1483217 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2580,7 +2580,7 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps,
for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsTPMModelsToCaps); i++) {
const char *needle = virDomainTPMModelTypeToString(
virQEMUCapsTPMModelsToCaps[i].type);
- if (virStringArrayHasString(entries, needle))
+ if (virStringArrayHasString((const char **) entries, needle))
virQEMUCapsSet(qemuCaps,
virQEMUCapsTPMModelsToCaps[i].caps);
}
@@ -2594,7 +2594,7 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps,
for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsTPMTypesToCaps); i++) {
const char *needle = virDomainTPMBackendTypeToString(
virQEMUCapsTPMTypesToCaps[i].type);
- if (virStringArrayHasString(entries, needle))
+ if (virStringArrayHasString((const char **) entries, needle))
virQEMUCapsSet(qemuCaps, virQEMUCapsTPMTypesToCaps[i].caps);
}
}
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index d455adf..1df1e4a 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5728,7 +5728,7 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
if (qemuMonitorJSONGetMigrationCapabilities(mon, &capsList) < 0)
return -1;
- ret = virStringArrayHasString(capsList, cap);
+ ret = virStringArrayHasString((const char **) capsList, cap);
virStringFreeList(capsList);
return ret;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7481626..3ade190 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3151,6 +3151,7 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDeviceDef dev;
+ const char **qemuDevices;
char **old;
char **tmp;
int ret = -1;
@@ -3163,9 +3164,10 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver,
if (qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
goto cleanup;
+ qemuDevices = (const char **) priv->qemuDevices;
if ((tmp = old)) {
while (*tmp) {
- if (!virStringArrayHasString(priv->qemuDevices, *tmp) &&
+ if (!virStringArrayHasString(qemuDevices, *tmp) &&
virDomainDefFindDevice(vm->def, *tmp, &dev, false) == 0 &&
qemuDomainRemoveDevice(driver, vm, &dev) < 0) {
goto cleanup;
diff --git a/src/util/virstring.c b/src/util/virstring.c
index 0177a95..4a70620 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -210,7 +210,8 @@ virStringFreeListCount(char **strings,
bool
-virStringArrayHasString(char **strings, const char *needle)
+virStringArrayHasString(const char **strings,
+ const char *needle)
{
size_t i = 0;
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 040771e..8854d5f 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -44,7 +44,7 @@ char *virStringJoin(const char **strings,
void virStringFreeList(char **strings);
void virStringFreeListCount(char **strings, size_t count);
-bool virStringArrayHasString(char **strings, const char *needle);
+bool virStringArrayHasString(const char **strings, const char *needle);
char *virStringGetFirstWithPrefix(char **strings, const char *prefix)
ATTRIBUTE_NONNULL(2);
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 544b569..9988754 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -999,7 +999,7 @@ testQemuMonitorJSONGetDeviceAliases(const void *data)
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
int ret = -1;
char **aliases = NULL;
- char **alias;
+ const char **alias;
const char *expected[] = {
"virtio-disk25", "video0", "serial0", "ide0-0-0", "usb", NULL };
@@ -1033,14 +1033,14 @@ testQemuMonitorJSONGetDeviceAliases(const void *data)
}
ret = 0;
- for (alias = aliases; *alias; alias++) {
- if (!virStringArrayHasString((char **) expected, *alias)) {
+ for (alias = (const char **) aliases; *alias; alias++) {
+ if (!virStringArrayHasString(expected, *alias)) {
fprintf(stderr, "got unexpected device alias '%s'\n", *alias);
ret = -1;
}
}
- for (alias = (char **) expected; *alias; alias++) {
- if (!virStringArrayHasString(aliases, *alias)) {
+ for (alias = expected; *alias; alias++) {
+ if (!virStringArrayHasString((const char **) aliases, *alias)) {
fprintf(stderr, "missing expected alias '%s'\n", *alias);
ret = -1;
}
--
2.7.4
8 years, 8 months
[libvirt] [PATCH v2 0/7] qemu: util: vz: some fixes and improvements
by Maxim Nestratov
v1-v2 changes:
- fixed "vz: reset errors after ignoring return values"
- added "vz: relax disk bus controller and device indices check"
Maxim Nestratov (6):
vz: get additional error information from job correctly
util: fix crash in virClassIsDerivedFrom for CloseCallbacks objects
vz: don't fail query domain info in case we don't have valid stats
handle
vz: reset errors after ignoring return values
vz: specify VIR_DOMAIN_NET_TYPE_NETWORK for routed networks
vz: relax disk bus controller and device indices check
Yuri Pudgorodskiy (1):
qemu: guest agent: introduce new error code VIR_ERR_AGENT_UNSYNCED
include/libvirt/virterror.h | 2 ++
src/qemu/qemu_agent.c | 6 +++---
src/util/virclosecallbacks.c | 3 +++
src/util/virerror.c | 6 ++++++
src/vz/vz_driver.c | 13 +++++++++----
src/vz/vz_sdk.c | 42 ++++++++++++++++++++++++------------------
src/vz/vz_utils.c | 8 --------
7 files changed, 47 insertions(+), 33 deletions(-)
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH] vz: add validation callbacks
by Mikhail Feoktistov
This patch fixes a bug which occurs when we check a bus and unit number
for a new attached disk. We should do this check in ValidadionCallback,
not in PostParse callback. Because in PostParse we have not initialized
disk->info.addr.drive struct yet.
Move part of code from domainPostParseCallback to domainValidateCallback
and part from devicesPostParseCallback to deviceValidateCallback.
PostParse callbacks are for modification data.
ValidateCallbacks are only for checks.
---
src/vz/vz_driver.c | 23 +++++++++++++++++++++--
src/vz/vz_utils.c | 2 +-
src/vz/vz_utils.h | 2 +-
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index b1b6d14..e9f9a17 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -232,6 +232,7 @@ vzConnectGetCapabilities(virConnectPtr conn)
xml = virCapabilitiesFormatXML(privconn->driver->caps);
return xml;
}
+
static int
vzDomainDefAddDefaultInputDevices(virDomainDefPtr def)
{
@@ -258,11 +259,19 @@ static int
vzDomainDefPostParse(virDomainDefPtr def,
virCapsPtr caps ATTRIBUTE_UNUSED,
unsigned int parseFlags ATTRIBUTE_UNUSED,
- void *opaque)
+ void *opaque ATTRIBUTE_UNUSED)
{
if (vzDomainDefAddDefaultInputDevices(def) < 0)
return -1;
+ return 0;
+}
+
+static int
+vzDomainDefValidate(const virDomainDef *def,
+ virCapsPtr caps ATTRIBUTE_UNUSED,
+ void *opaque)
+{
if (vzCheckUnsupportedControllers(def, opaque) < 0)
return -1;
@@ -284,6 +293,14 @@ vzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
VIR_STRDUP(dev->data.net->model, "e1000") < 0)
return -1;
+ return 0;
+}
+
+static int
+vzDomainDeviceDefValidate(const virDomainDeviceDef *dev,
+ const virDomainDef *def,
+ void *opaque ATTRIBUTE_UNUSED)
+{
if (dev->type == VIR_DOMAIN_DEVICE_DISK)
return vzCheckUnsupportedDisk(def, dev->data.disk, opaque);
else if (dev->type == VIR_DOMAIN_DEVICE_GRAPHICS)
@@ -299,8 +316,10 @@ static virDomainXMLPrivateDataCallbacks vzDomainXMLPrivateDataCallbacksPtr = {
static virDomainDefParserConfig vzDomainDefParserConfig = {
.macPrefix = {0x42, 0x1C, 0x00},
- .devicesPostParseCallback = vzDomainDeviceDefPostParse,
.domainPostParseCallback = vzDomainDefPostParse,
+ .devicesPostParseCallback = vzDomainDeviceDefPostParse,
+ .domainValidateCallback = vzDomainDefValidate,
+ .deviceValidateCallback = vzDomainDeviceDefValidate,
};
static vzDriverPtr
diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
index 312355d..eaf09f2 100644
--- a/src/vz/vz_utils.c
+++ b/src/vz/vz_utils.c
@@ -463,7 +463,7 @@ vzCheckUnsupportedDisk(const virDomainDef *def,
}
int
-vzCheckUnsupportedControllers(virDomainDefPtr def, vzCapabilitiesPtr vzCaps)
+vzCheckUnsupportedControllers(const virDomainDef *def, vzCapabilitiesPtr vzCaps)
{
size_t i, j;
virDomainControllerDefPtr controller;
diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h
index d033f94..4b407ec 100644
--- a/src/vz/vz_utils.h
+++ b/src/vz/vz_utils.h
@@ -137,7 +137,7 @@ vzCheckUnsupportedDisk(const virDomainDef *def,
virDomainDiskDefPtr disk,
vzCapabilitiesPtr vzCaps);
int
-vzCheckUnsupportedControllers(virDomainDefPtr def,
+vzCheckUnsupportedControllers(const virDomainDef *def,
vzCapabilitiesPtr vzCaps);
int
vzGetDefaultSCSIModel(vzDriverPtr driver,
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH v2] vz: fixed race in vzDomainAttach/DettachDevice
by Olga Krishtal
While dettaching/attaching device in OpenStack, nova
calls vzDomainDettachDevice twice, because the update of the internal
configuration of the ct comes a bit latter than the update event.
As the result, we suffer from the second call to dettach the same device.
Signed-off-by: Olga Krishtal <okrishtal(a)virtuozzo.com>
---
src/vz/vz_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 2ed12db..26b14a2 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1193,6 +1193,9 @@ static int vzDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (prlsdkAttachDevice(driver, dom, dev) < 0)
goto cleanup;
+ if (prlsdkUpdateDomain(driver, dom) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
virDomainDeviceDefFree(dev);
@@ -1245,6 +1248,9 @@ static int vzDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (prlsdkDetachDevice(driver, dom, dev) < 0)
goto cleanup;
+ if (prlsdkUpdateDomain(driver, dom) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
virDomainDeviceDefFree(dev);
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH 0/7] More syntax-check cleanups
by Ján Tomko
The first patch pulls the latest gnulibs to fetch the newest syntax-check
speedups.
Patch 2 is included since a gnulib update will trigger configure anyway.
The rest are mostly cleanups, the speed-ups they (might) provide are barely
measurable.
Ján Tomko (7):
maint: update to latest gnulib
configure.ac: drop checks for ETH flags
tests: fix the return value of test-wrap-argv
cfg.mk: use subst instead of tr
cfg.mk: drop redundant sc_prohibit_gethostby
cfg.mk: drop redundant sc_size_of_brackets
cfg.mk: join not_streq and not_strneq tests
.gnulib | 2 +-
build-aux/check-spacing.pl | 2 +-
cfg.mk | 35 +++++------------------------------
configure.ac | 5 -----
src/util/virnetdev.c | 20 ++++++++++----------
tests/test-wrap-argv.pl | 2 +-
tests/virstoragetest.c | 2 +-
7 files changed, 19 insertions(+), 49 deletions(-)
--
2.7.3
8 years, 8 months
[libvirt] [PATCH 0/7]
by Nikolay Shirokovskiy
filesystem pools inception
Filesystem pools is a facility to manage filesystems resources similar
to how storage pools manages volume resources. Furthermore new API follows
storage API closely where it makes sense. Uploading/downloading operations
are not defined yet as it is not obvious how to make it properly. I guess
we can use some kind of tar to make a stream from a filesystem. Please share
you thoughts on this particular issue.
The patchset provides 'dir' backend which simply expose directories in some
directory in host filesystem. The virsh commands are provided too. So it is
ready to play with, just replace 'pool' in xml descriptions and virsh commands
to 'fspool' and 'volume' to 'item'.
Olga Krishtal (7):
fspool: introduce filesystem pools API
fspool: usual driver based implementation of filesystem pools API
fspools: configuration and internal representation
fspools: acl support for filesystem pools
remote: filesystem pools driver implementation
fspool: default implementation of filesystem pools
virsh: filesystem pools commands
configure.ac | 33 +
daemon/Makefile.am | 4 +
daemon/libvirtd.c | 10 +
daemon/remote.c | 35 +
include/libvirt/libvirt-fs.h | 273 +++++
include/libvirt/libvirt.h | 1 +
include/libvirt/virterror.h | 8 +
po/POTFILES.in | 6 +
src/Makefile.am | 46 +
src/access/viraccessdriver.h | 12 +
src/access/viraccessdrivernop.c | 19 +
src/access/viraccessdriverpolkit.c | 47 +
src/access/viraccessdriverstack.c | 49 +
src/access/viraccessmanager.c | 31 +
src/access/viraccessmanager.h | 11 +
src/access/viraccessperm.c | 15 +-
src/access/viraccessperm.h | 124 +++
src/conf/fs_conf.c | 1624 +++++++++++++++++++++++++++
src/conf/fs_conf.h | 310 ++++++
src/datatypes.c | 154 +++
src/datatypes.h | 94 ++
src/driver-fs.h | 210 ++++
src/driver.h | 3 +
src/fs/fs_backend.h | 85 ++
src/fs/fs_backend_dir.c | 334 ++++++
src/fs/fs_backend_dir.h | 8 +
src/fs/fs_driver.c | 2164 ++++++++++++++++++++++++++++++++++++
src/fs/fs_driver.h | 10 +
src/libvirt-fs.c | 1715 ++++++++++++++++++++++++++++
src/libvirt.c | 28 +
src/libvirt_private.syms | 53 +
src/libvirt_public.syms | 46 +
src/remote/remote_driver.c | 72 +-
src/remote/remote_protocol.x | 522 ++++++++-
src/rpc/gendispatch.pl | 19 +-
src/util/virerror.c | 37 +
tools/Makefile.am | 4 +
tools/virsh-fspool.c | 1728 ++++++++++++++++++++++++++++
tools/virsh-fspool.h | 36 +
tools/virsh-item.c | 1274 +++++++++++++++++++++
tools/virsh-item.h | 37 +
tools/virsh.c | 4 +
tools/virsh.h | 9 +
43 files changed, 11294 insertions(+), 10 deletions(-)
create mode 100644 include/libvirt/libvirt-fs.h
create mode 100644 src/conf/fs_conf.c
create mode 100644 src/conf/fs_conf.h
create mode 100644 src/driver-fs.h
create mode 100644 src/fs/fs_backend.h
create mode 100644 src/fs/fs_backend_dir.c
create mode 100644 src/fs/fs_backend_dir.h
create mode 100644 src/fs/fs_driver.c
create mode 100644 src/fs/fs_driver.h
create mode 100644 src/libvirt-fs.c
create mode 100644 tools/virsh-fspool.c
create mode 100644 tools/virsh-fspool.h
create mode 100644 tools/virsh-item.c
create mode 100644 tools/virsh-item.h
--
1.8.3.1
8 years, 8 months