ivshmem patches for 2.5
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWVX6SAAoJEDhwtADrkYZTZyoP/jYDr+mK3PkimysF42/rE1cW IJBLd7MRJWSLdflmJjn/lDbmo11KNR49i2XerTVK2znKG53egObVmdkESazdz4wm J4XKFqpKPcOaeeicxjeNly8Hq5okk6gvOoP5+vJvvu8GZFGrwAg6DFMP3xEs5CVv NfySXBUYOIi8jvtzvwesjh7nOfTv9mKWIKA3m7Fli9TjMG8X8UjilKtWVDPLo4ev pzTFNSchi/AoYh4Fdl+E7guGW6SOiwjAPJCDTuHNra0Fadj5RsV4X4E7AsMXAP+T WZzTzn+GEtyGC7yjhCy448u7f1lPlXUFfYnIsNOtQ6azrEbaNo0i8IFFmpdFSVRe Medl71TQBGR9roLKhyZYVfH/KveVpqyIxkPa3azC2vTGiDtNmqJ0e0+uxDDMIT0R HnAZc+7rSdVpDItVibrExYA92q5m9qN8GqhS6dflbYu2cy54uPa33dR5xKUPNU5Q moYVl3E5uLz8Tdj3gbyc+rvyPiT7vYCvZlGP/e81ZSIRepiQKadI3Qkhx879336f gzuGHOtaTBTz36XGQsQBJC1rZ+3TjC+VylOUttPH0GqqlIfoUdvA/tdbiXmO6DpY N99H6RlBAD+Tw6Y7g6M1BwT9a7TBhkeeMdRWZSYeC4jw3T6AslBfBwcKbmTmE/NC hTZ7RNdZ7FeFa5ZH/LhE =/gHp -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/armbru/tags/pull-ivshmem-2015-11-25' into staging ivshmem patches for 2.5 # gpg: Signature made Wed 25 Nov 2015 09:25:38 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-ivshmem-2015-11-25: ivshmem: Rename property memdev to x-memdev for 2.5 ivshmem: Mark questionable socket type test FIXME tests/ivshmem-test: Supply missing initializer in get_device() qemu-doc: Fix ivshmem usage example with shm=... qemu-doc: Fix ivshmem example markup Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
1aae36df4b
|
@ -60,8 +60,6 @@
|
||||||
#define IVSHMEM(obj) \
|
#define IVSHMEM(obj) \
|
||||||
OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM)
|
OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM)
|
||||||
|
|
||||||
#define IVSHMEM_MEMDEV_PROP "memdev"
|
|
||||||
|
|
||||||
typedef struct Peer {
|
typedef struct Peer {
|
||||||
int nb_eventfds;
|
int nb_eventfds;
|
||||||
EventNotifier *eventfds;
|
EventNotifier *eventfds;
|
||||||
|
@ -857,8 +855,8 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error **errp)
|
||||||
PCI_BASE_ADDRESS_MEM_PREFETCH;
|
PCI_BASE_ADDRESS_MEM_PREFETCH;
|
||||||
|
|
||||||
if (!!s->server_chr + !!s->shmobj + !!s->hostmem != 1) {
|
if (!!s->server_chr + !!s->shmobj + !!s->hostmem != 1) {
|
||||||
error_setg(errp, "You must specify either a shmobj, a chardev"
|
error_setg(errp,
|
||||||
" or a hostmem");
|
"You must specify either 'shm', 'chardev' or 'x-memdev'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -939,6 +937,7 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error **errp)
|
||||||
memory_region_add_subregion(&s->bar, 0, mr);
|
memory_region_add_subregion(&s->bar, 0, mr);
|
||||||
pci_register_bar(PCI_DEVICE(s), 2, attr, &s->bar);
|
pci_register_bar(PCI_DEVICE(s), 2, attr, &s->bar);
|
||||||
} else if (s->server_chr != NULL) {
|
} else if (s->server_chr != NULL) {
|
||||||
|
/* FIXME do not rely on what chr drivers put into filename */
|
||||||
if (strncmp(s->server_chr->filename, "unix:", 5)) {
|
if (strncmp(s->server_chr->filename, "unix:", 5)) {
|
||||||
error_setg(errp, "chardev is not a unix client socket");
|
error_setg(errp, "chardev is not a unix client socket");
|
||||||
return;
|
return;
|
||||||
|
@ -1181,7 +1180,7 @@ static void ivshmem_init(Object *obj)
|
||||||
{
|
{
|
||||||
IVShmemState *s = IVSHMEM(obj);
|
IVShmemState *s = IVSHMEM(obj);
|
||||||
|
|
||||||
object_property_add_link(obj, IVSHMEM_MEMDEV_PROP, TYPE_MEMORY_BACKEND,
|
object_property_add_link(obj, "x-memdev", TYPE_MEMORY_BACKEND,
|
||||||
(Object **)&s->hostmem,
|
(Object **)&s->hostmem,
|
||||||
ivshmem_check_memdev_is_busy,
|
ivshmem_check_memdev_is_busy,
|
||||||
OBJ_PROP_LINK_UNREF_ON_RELEASE,
|
OBJ_PROP_LINK_UNREF_ON_RELEASE,
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ zero-copy communication to the application level of the guests. The basic
|
||||||
syntax is:
|
syntax is:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
qemu-system-i386 -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>]
|
qemu-system-i386 -device ivshmem,size=@var{size},shm=@var{shm-name}
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
If desired, interrupts can be sent between guest VMs accessing the same shared
|
If desired, interrupts can be sent between guest VMs accessing the same shared
|
||||||
|
@ -1267,12 +1267,12 @@ memory server is:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
# First start the ivshmem server once and for all
|
# First start the ivshmem server once and for all
|
||||||
ivshmem-server -p <pidfile> -S <path> -m <shm name> -l <shm size> -n <vectors n>
|
ivshmem-server -p @var{pidfile} -S @var{path} -m @var{shm-name} -l @var{shm-size} -n @var{vectors}
|
||||||
|
|
||||||
# Then start your qemu instances with matching arguments
|
# Then start your qemu instances with matching arguments
|
||||||
qemu-system-i386 -device ivshmem,size=<shm size>,vectors=<vectors n>,chardev=<id>
|
qemu-system-i386 -device ivshmem,size=@var{shm-size},vectors=@var{vectors},chardev=@var{id}
|
||||||
[,msi=on][,ioeventfd=on][,role=peer|master]
|
[,msi=on][,ioeventfd=on][,role=peer|master]
|
||||||
-chardev socket,path=<path>,id=<id>
|
-chardev socket,path=@var{path},id=@var{id}
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
When using the server, the guest will be assigned a VM ID (>=0) that allows guests
|
When using the server, the guest will be assigned a VM ID (>=0) that allows guests
|
||||||
|
@ -1300,7 +1300,7 @@ a memory backend that has hugepage support:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
qemu-system-i386 -object memory-backend-file,size=1G,mem-path=/mnt/hugepages/my-shmem-file,id=mb1
|
qemu-system-i386 -object memory-backend-file,size=1G,mem-path=/mnt/hugepages/my-shmem-file,id=mb1
|
||||||
-device ivshmem,memdev=mb1
|
-device ivshmem,x-memdev=mb1
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
ivshmem-server also supports hugepages mount points with the
|
ivshmem-server also supports hugepages mount points with the
|
||||||
|
|
|
@ -40,6 +40,7 @@ static QPCIDevice *get_device(void)
|
||||||
QPCIBus *pcibus;
|
QPCIBus *pcibus;
|
||||||
|
|
||||||
pcibus = qpci_init_pc();
|
pcibus = qpci_init_pc();
|
||||||
|
dev = NULL;
|
||||||
qpci_device_foreach(pcibus, 0x1af4, 0x1110, save_fn, &dev);
|
qpci_device_foreach(pcibus, 0x1af4, 0x1110, save_fn, &dev);
|
||||||
g_assert(dev != NULL);
|
g_assert(dev != NULL);
|
||||||
|
|
||||||
|
@ -392,7 +393,7 @@ static void test_ivshmem_memdev(void)
|
||||||
|
|
||||||
/* just for the sake of checking memory-backend property */
|
/* just for the sake of checking memory-backend property */
|
||||||
setup_vm_cmd(&state, "-object memory-backend-ram,size=1M,id=mb1"
|
setup_vm_cmd(&state, "-object memory-backend-ram,size=1M,id=mb1"
|
||||||
" -device ivshmem,memdev=mb1", false);
|
" -device ivshmem,x-memdev=mb1", false);
|
||||||
|
|
||||||
qtest_quit(state.qtest);
|
qtest_quit(state.qtest);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue