From: Bogdan Purcareata <bogdan.purcareata@nxp.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: "meta-virtualization@yoctoproject.org"
<meta-virtualization@yoctoproject.org>
Subject: Re: [PATCH] libvirt: Fix bug in assigning virtio-mmio disks with qemu
Date: Thu, 7 Apr 2016 09:13:24 +0000 [thread overview]
Message-ID: <570624B3.7040005@nxp.com> (raw)
In-Reply-To: <CADkTA4PvBVAJFWQkb1LsceVqxfnGHwR4CoqspKmbfo-7DwJyhQ@mail.gmail.com>
On 07.04.2016 09:57, Bruce Ashfield wrote:
> On Tue, Apr 5, 2016 at 11:48 AM, Bogdan Purcareata <
> bogdan.purcareata@nxp.com> wrote:
>
>> Patch contains a more detailed description. Basically allows adding
>> virtio-mmio
>> block device to QEMU guests. Tested on ARM64.
>>
>> Please apply on jethro branch.
>>
>
> We don't want to create functionality on old branches that isn't also on
> master.
> Is there any reason why this wouldn't be applicable to master as well ?
Master delivers libvirt 1.3.2 [1] which has this patch included:
[libvirt]$ git checkout v1.3.2 && git log --pretty=oneline | grep "Ignore
virtio-mmio"
d526e37bad2515cf91caa0e4ff3edaf41e45b5c2 Ignore virtio-mmio disks in
qemuAssignDevicePCISlots()
[1]
https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/tree/recipes-extended/libvirt
Thank you,
Bogdan P.
>>
>> Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
>> ---
>> ...io-mmio-disks-in-qemuAssignDevicePCISlots.patch | 81
>> ++++++++++++++++++++++
>> recipes-extended/libvirt/libvirt_1.2.19.bb | 1 +
>> 2 files changed, 82 insertions(+)
>> create mode 100644
>> recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch
>>
>> 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 0000000..f0b7ab5
>> --- /dev/null
>> +++
>> b/recipes-extended/libvirt/libvirt/Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch
>> @@ -0,0 +1,81 @@
>> +From d526e37bad2515cf91caa0e4ff3edaf41e45b5c2 Mon Sep 17 00:00:00 2001
>> +From: Pavel Fedin <p.fedin@samsung.com>
>> +Date: Wed, 9 Sep 2015 15:02:53 +0300
>> +Subject: [PATCH] Ignore virtio-mmio disks in qemuAssignDevicePCISlots()
>> +
>> +Fixes the following error when attempting to add a disk with bus='virtio'
>> +to a machine which actually supports virtio-mmio (caught with ARM virt):
>> +
>> +virtio disk cannot have an address of type 'virtio-mmio'
>> +
>> +The problem has been likely introduced by
>> +e8d55172544c1fafe31a9e09346bdebca4f0d6f9. Before that
>> +qemuAssignDevicePCISlots() was never called for ARM "virt" machine.
>> +
>> +Upstream-status: Accepted
>> +[
>> https://libvirt.org/git/?p=libvirt.git;a=commit;h=d526e37bad2515cf91caa0e4ff3edaf41e45b5c2
>> ]
>> +
>> +Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
>> +---
>> + src/qemu/qemu_command.c | 11 +++++++++--
>> + src/qemu/qemu_command.h | 1 +
>> + 2 files changed, 10 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> +index b56670c..25f57f2 100644
>> +--- a/src/qemu/qemu_command.c
>> ++++ b/src/qemu/qemu_command.c
>> +@@ -2261,7 +2261,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
>> + virDomainPCIAddressReserveNextSlot(addrs, &info, flags)
>> < 0)
>> + goto cleanup;
>> +
>> +- if (qemuAssignDevicePCISlots(def, addrs) < 0)
>> ++ if (qemuAssignDevicePCISlots(def, qemuCaps, addrs) < 0)
>> + goto cleanup;
>> +
>> + for (i = 1; i < addrs->nbuses; i++) {
>> +@@ -2294,7 +2294,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
>> + if (qemuValidateDevicePCISlotsChipsets(def, qemuCaps, addrs)
>> < 0)
>> + goto cleanup;
>> +
>> +- if (qemuAssignDevicePCISlots(def, addrs) < 0)
>> ++ if (qemuAssignDevicePCISlots(def, qemuCaps, addrs) < 0)
>> + goto cleanup;
>> +
>> + for (i = 0; i < def->ncontrollers; i++) {
>> +@@ -2426,6 +2426,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
>> + */
>> + int
>> + qemuAssignDevicePCISlots(virDomainDefPtr def,
>> ++ virQEMUCapsPtr qemuCaps,
>> + virDomainPCIAddressSetPtr addrs)
>> + {
>> + size_t i, j;
>> +@@ -2618,6 +2619,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
>> + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
>> + continue;
>> +
>> ++ /* Also ignore virtio-mmio disks if our machine allows them */
>> ++ if (def->disks[i]->info.type ==
>> ++ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO &&
>> ++ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO))
>> ++ continue;
>> ++
>> + if (def->disks[i]->info.type !=
>> VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
>> + virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> + _("virtio disk cannot have an address of type
>> '%s'"),
>> +diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
>> +index 767d31f..4aa7f2d 100644
>> +--- a/src/qemu/qemu_command.h
>> ++++ b/src/qemu/qemu_command.h
>> +@@ -284,6 +284,7 @@ virDomainPCIAddressSetPtr
>> qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
>> + bool dryRun);
>> +
>> + int qemuAssignDevicePCISlots(virDomainDefPtr def,
>> ++ virQEMUCapsPtr qemuCaps,
>> + virDomainPCIAddressSetPtr addrs);
>> +
>> + int qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr
>> qemuCaps);
>> +--
>> +1.9.1
>> +
>> diff --git a/recipes-extended/libvirt/libvirt_1.2.19.bb
>> b/recipes-extended/libvirt/libvirt_1.2.19.bb
>> index df53d59..774eea4 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 \
>> file://libvirt-use-pkg-config-to-locate-libcap.patch \
>> file://0001-to-fix-build-error.patch \
>> file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \
>> +
>> file://Ignore-virtio-mmio-disks-in-qemuAssignDevicePCISlots.patch \
>> "
>>
>> SRC_URI[libvirt.md5sum] = "bc3ab1ba5b6fabd2e4516c70ddd4d97c"
>> --
>> 1.9.1
>>
>> --
>> _______________________________________________
>> meta-virtualization mailing list
>> meta-virtualization@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-virtualization
>>
>
>
>
next prev parent reply other threads:[~2016-04-07 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 15:48 [PATCH] libvirt: Fix bug in assigning virtio-mmio disks with qemu Bogdan Purcareata
2016-04-07 6:57 ` Bruce Ashfield
2016-04-07 9:13 ` Bogdan Purcareata [this message]
2016-04-07 14:55 ` Bruce Ashfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570624B3.7040005@nxp.com \
--to=bogdan.purcareata@nxp.com \
--cc=bruce.ashfield@gmail.com \
--cc=meta-virtualization@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.