[libvirt] [PATCH 10/10] qemu: report error when shmem have a invalid address

Martin Kletzander mkletzan at redhat.com
Wed Jul 8 12:22:36 UTC 2015


On Wed, Jun 17, 2015 at 11:56:21AM +0800, Luyao Huang wrote:
>If user pass a invalid address shared memory device
>to qemu, qemu won't report the error, but will auto
>assign a pci address to the shared memory device.
>
>Signed-off-by: Luyao Huang <lhuang at redhat.com>
>---
> src/qemu/qemu_command.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>

ACK

>diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>index 5d55794..9c659fe 100644
>--- a/src/qemu/qemu_command.c
>+++ b/src/qemu/qemu_command.c
>@@ -8482,6 +8482,13 @@ qemuBuildShmemDevStr(virDomainDefPtr def,
>         }
>     }
>
>+    if (shmem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
>+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
>+                       _("only 'pci' addresses are supported for the "
>+                         "shared memory device"));
>+        goto error;
>+    }
>+
>     if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info, qemuCaps) < 0)
>         goto error;
>
>--
>1.8.3.1
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150708/c58799e7/attachment-0001.sig>


More information about the libvir-list mailing list