Pure Software Engineer :)
[Xen] User level inter virtual machine communication 본문
[Xen] User level inter virtual machine communication
HelloJaewon 2012. 11. 1. 22:31dom0에는 (2.6.32.39 이후 버전) user level process가 VM간에 통신을 할 수 있도록 guest OS level에서 page를 할당할 수 있는 디바이스(gntalloc)를 제공한다.
(참고 http://cateee.net/lkddb/web-lkddb/XEN_GRANT_DEV_ALLOC.html)
이를 통해 사용자 어플리케이션은 디바이스(gntalloc)을 통해 커널 메모리를 할당받아 다른 VM이 접근할수 있도록 access 권한을 주고 나서 이 페이지를 통해 메시지를 주고 받을 수 있다.
하지만 2.6.32.39 이후 버전부터 gntalloc device가 적용되어 있으므로 그 이전의 dom0를 사용하기 위해서는 직접 패치를 해줘야 했다.
여기서는 2.6.32.39버전의 dom0에 적용하기 위해 2.6.39.4버전에 있는 gntalloc 디바이스를 패치하도록 한다.
우선 2.6.39.4버전에서 2.6.32.39버전으로 복사해야할 파일들은 다음과 같다.
drivers/xen/gntalloc.c
include/xen/gntalloc.h
include/linux/atomic.h
그 다음 다음의 내용을 각 파일에 추가한다.
config 파일에 다음 내용 추가
CONFIG_XEN_GRANT_DEV_ALLOC=m
drivers/xen/Makefile 파일에 다음 내용 추가
obj-$(CONFIG_XEN_GRANT_DEV_ALLOC) += xen-gntalloc.o
xen-gntalloc-y := gntalloc.o
drivesr/xen/Kconfig 파일에 다음 내용 추가
config XEN_GRANT_DEV_ALLOC
tristate "User-space grant reference allocator driver"
depends on XEN
default m
help
Allows userspace processes to create pages with access granted
to other domains. This can be used to implement frontend drivers
or as part of an inter-domain shared memory channel.
이제 다 됐다.
컴파일이 성공적으로 되었다면 drivers/xen 아래에 xen-gntalloc* 파일이 생겼을 것이다.
그리고 dom0 를 재부팅하고 나서 /dev/xen 아래에 gntalloc 이 보인다면 끝!!!!
'Software Engineering > Linux' 카테고리의 다른 글
[nodejs] 우분투에 최신 버전 Nodejs 설치하기 (0) | 2014.11.05 |
---|---|
[Xen] PCI Passthrough (0) | 2012.11.15 |
[Xen] User space 에서 hypercall 사용하기 (0) | 2012.10.16 |
[Xen] hypercall 추가하기 (0) | 2012.10.11 |
[Xen] Error: Device 0 (vif) could not be connected. Hotplug scripts not working (0) | 2012.10.03 |