diff options
| author | Bogdan Purcareata <bogdan.purcareata@nxp.com> | 2016-04-05 15:48:32 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-04-07 10:53:55 -0400 |
| commit | 042425c1d98bdd7e44a62789bd03b375045266f5 (patch) | |
| tree | 7c91f07fdf21bf906ada6e0fc43aa334446f6119 | |
| parent | 2e74fb085b2d0a41a90e4d96459f8833a99d0ab8 (diff) | |
| download | meta-virtualization-042425c1d98bdd7e44a62789bd03b375045266f5.tar.gz | |
libvirt: Fix bug in assigning virtio-mmio disks with qemu
Patch contains a more detailed description. Basically allows adding virtio-mmio
block device to QEMU guests. Tested on ARM64.
Please apply on jethro branch.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
| -rw-r--r-- | recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch | 81 | ||||
| -rw-r--r-- | recipes-extended/libvirt/libvirt_1.2.19.bb | 1 |
2 files changed, 82 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch b/recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch new file mode 100644 index 00000000..f0b7ab59 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | From d526e37bad2515cf91caa0e4ff3edaf41e45b5c2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pavel Fedin <p.fedin@samsung.com> | ||
| 3 | Date: Wed, 9 Sep 2015 15:02:53 +0300 | ||
| 4 | Subject: [PATCH] Ignore virtio-mmio disks in qemuAssignDevicePCISlots() | ||
| 5 | |||
| 6 | Fixes the following error when attempting to add a disk with bus='virtio' | ||
| 7 | to a machine which actually supports virtio-mmio (caught with ARM virt): | ||
| 8 | |||
| 9 | virtio disk cannot have an address of type 'virtio-mmio' | ||
| 10 | |||
| 11 | The problem has been likely introduced by | ||
| 12 | e8d55172544c1fafe31a9e09346bdebca4f0d6f9. Before that | ||
| 13 | qemuAssignDevicePCISlots() was never called for ARM "virt" machine. | ||
| 14 | |||
| 15 | Upstream-status: Accepted | ||
| 16 | [https://libvirt.org/git/?p=libvirt.git;a=commit;h=d526e37bad2515cf91caa0e4ff3edaf41e45b5c2] | ||
| 17 | |||
| 18 | Signed-off-by: Pavel Fedin <p.fedin@samsung.com> | ||
| 19 | --- | ||
| 20 | src/qemu/qemu_command.c | 11 +++++++++-- | ||
| 21 | src/qemu/qemu_command.h | 1 + | ||
| 22 | 2 files changed, 10 insertions(+), 2 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c | ||
| 25 | index b56670c..25f57f2 100644 | ||
| 26 | --- a/src/qemu/qemu_command.c | ||
| 27 | +++ b/src/qemu/qemu_command.c | ||
| 28 | @@ -2261,7 +2261,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, | ||
| 29 | virDomainPCIAddressReserveNextSlot(addrs, &info, flags) < 0) | ||
| 30 | goto cleanup; | ||
| 31 | |||
| 32 | - if (qemuAssignDevicePCISlots(def, addrs) < 0) | ||
| 33 | + if (qemuAssignDevicePCISlots(def, qemuCaps, addrs) < 0) | ||
| 34 | goto cleanup; | ||
| 35 | |||
| 36 | for (i = 1; i < addrs->nbuses; i++) { | ||
| 37 | @@ -2294,7 +2294,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, | ||
| 38 | if (qemuValidateDevicePCISlotsChipsets(def, qemuCaps, addrs) < 0) | ||
| 39 | goto cleanup; | ||
| 40 | |||
| 41 | - if (qemuAssignDevicePCISlots(def, addrs) < 0) | ||
| 42 | + if (qemuAssignDevicePCISlots(def, qemuCaps, addrs) < 0) | ||
| 43 | goto cleanup; | ||
| 44 | |||
| 45 | for (i = 0; i < def->ncontrollers; i++) { | ||
| 46 | @@ -2426,6 +2426,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, | ||
| 47 | */ | ||
| 48 | int | ||
| 49 | qemuAssignDevicePCISlots(virDomainDefPtr def, | ||
| 50 | + virQEMUCapsPtr qemuCaps, | ||
| 51 | virDomainPCIAddressSetPtr addrs) | ||
| 52 | { | ||
| 53 | size_t i, j; | ||
| 54 | @@ -2618,6 +2619,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, | ||
| 55 | VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) | ||
| 56 | continue; | ||
| 57 | |||
| 58 | + /* Also ignore virtio-mmio disks if our machine allows them */ | ||
| 59 | + if (def->disks[i]->info.type == | ||
| 60 | + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO && | ||
| 61 | + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) | ||
| 62 | + continue; | ||
| 63 | + | ||
| 64 | if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { | ||
| 65 | virReportError(VIR_ERR_CONFIG_UNSUPPORTED, | ||
| 66 | _("virtio disk cannot have an address of type '%s'"), | ||
| 67 | diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h | ||
| 68 | index 767d31f..4aa7f2d 100644 | ||
| 69 | --- a/src/qemu/qemu_command.h | ||
| 70 | +++ b/src/qemu/qemu_command.h | ||
| 71 | @@ -284,6 +284,7 @@ virDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def, | ||
| 72 | bool dryRun); | ||
| 73 | |||
| 74 | int qemuAssignDevicePCISlots(virDomainDefPtr def, | ||
| 75 | + virQEMUCapsPtr qemuCaps, | ||
| 76 | virDomainPCIAddressSetPtr addrs); | ||
| 77 | |||
| 78 | int qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps); | ||
| 79 | -- | ||
| 80 | 1.9.1 | ||
| 81 | |||
diff --git a/recipes-extended/libvirt/libvirt_1.2.19.bb b/recipes-extended/libvirt/libvirt_1.2.19.bb index df53d59a..774eea4d 100644 --- a/recipes-extended/libvirt/libvirt_1.2.19.bb +++ b/recipes-extended/libvirt/libvirt_1.2.19.bb | |||
| @@ -33,6 +33,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ | |||
| 33 | file://libvirt-use-pkg-config-to-locate-libcap.patch \ | 33 | file://libvirt-use-pkg-config-to-locate-libcap.patch \ |
| 34 | file://0001-to-fix-build-error.patch \ | 34 | file://0001-to-fix-build-error.patch \ |
| 35 | file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \ | 35 | file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \ |
| 36 | file://Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch \ | ||
| 36 | " | 37 | " |
| 37 | 38 | ||
| 38 | SRC_URI[libvirt.md5sum] = "bc3ab1ba5b6fabd2e4516c70ddd4d97c" | 39 | SRC_URI[libvirt.md5sum] = "bc3ab1ba5b6fabd2e4516c70ddd4d97c" |
