-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQIcBAABAgAGBQJXDhnDAAoJENro4Ql1lpzlon0QALYjBrRo1BFBle+llRxvj0h/ DtbB7uKbsmUv11GF6C03j+1od+tPIR+czkynkzpzkwqfZQl3PNtI0W0YPHGWl0eF VFpwO/fnt01aTtpXkgzQ8izFTyl3QhtipMRC/5PtOAjM53GG9t+ESdjQjFk6Lw3a KBNE/Ge+PfXJ4S5huLOig85utWG+e28ZL/d6opWWMyeGNoAJSg59kN2Wo3cmFhi/ DJWvOEs1RWnvwJGVxrW0NHA80Ht7Lrk4MokPmVYIvr04LOYD/Vzu/f2KOp5ZVo6i Vo4kPv/1pDeqT9Tw3IIaVt6Sd4dQ2M2g9lvNoobJl3dAk8xBwNtuvPj5v0azArew hpzdRxXJOmo/14RgzlDlToD9haUiMNsqHY0iSXA53jUzi5pbw+AJFgmW2BcMqCqw MBxjfqoiQjLiw0NRVkWu7CId82Rmj53Xv75898QOEjvKZq4paLRNEx+Qyl9wd/q0 GYz0Mc24/iY2Px7YPqe8tvJlV0QTTlcGKycdmpMqtNN6QuJYpC0cUbVWBUXibZhx uY9u7wFNoAZBnpxghUf7rlhH8oQEikONxIJVTz/MVjuWLmE6wOfdEP8KkndFyjlu +fHY8RO2BsJCw+V3/LpvSXBEwmkCsIkBJ3BLEwfON+0Vew1C0hzXeWFnbshe1l1I L4H5POEMiAf9vG0E/Nl7 =eX10 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/elmarco/tags/ivshmem-fix-pull-request' into staging # gpg: Signature made Wed 13 Apr 2016 11:04:51 BST using RSA key ID 75969CE5 # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * remotes/elmarco/tags/ivshmem-fix-pull-request: ivshmem: fix ivshmem-{plain,doorbell} crash without arg Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
8b4aaba736
@ -872,6 +872,8 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem,
|
||||
&error_abort);
|
||||
} else {
|
||||
assert(s->server_chr);
|
||||
|
||||
IVSHMEM_DPRINTF("using shared memory server (socket = %s)\n",
|
||||
s->server_chr->filename);
|
||||
|
||||
@ -1051,10 +1053,24 @@ static void ivshmem_plain_init(Object *obj)
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
static void ivshmem_plain_realize(PCIDevice *dev, Error **errp)
|
||||
{
|
||||
IVShmemState *s = IVSHMEM_COMMON(dev);
|
||||
|
||||
if (!s->hostmem) {
|
||||
error_setg(errp, "You must specify a 'memdev'");
|
||||
return;
|
||||
}
|
||||
|
||||
ivshmem_common_realize(dev, errp);
|
||||
}
|
||||
|
||||
static void ivshmem_plain_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->realize = ivshmem_plain_realize;
|
||||
dc->props = ivshmem_plain_properties;
|
||||
dc->vmsd = &ivshmem_plain_vmsd;
|
||||
}
|
||||
@ -1099,10 +1115,24 @@ static void ivshmem_doorbell_init(Object *obj)
|
||||
s->legacy_size = SIZE_MAX; /* whatever the server sends */
|
||||
}
|
||||
|
||||
static void ivshmem_doorbell_realize(PCIDevice *dev, Error **errp)
|
||||
{
|
||||
IVShmemState *s = IVSHMEM_COMMON(dev);
|
||||
|
||||
if (!s->server_chr) {
|
||||
error_setg(errp, "You must specify a 'chardev'");
|
||||
return;
|
||||
}
|
||||
|
||||
ivshmem_common_realize(dev, errp);
|
||||
}
|
||||
|
||||
static void ivshmem_doorbell_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->realize = ivshmem_doorbell_realize;
|
||||
dc->props = ivshmem_doorbell_properties;
|
||||
dc->vmsd = &ivshmem_doorbell_vmsd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user