From a9090a94bb4a8dae61eb79428a5769916d621940 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 29 Oct 2014 06:50:50 +0000 Subject: OvmfPkg/XenBusDxe: Add XenStore client implementation XenStore is a key/value database, which is running on another virtual machine. It can be accessed through shared memory. This is a client implementation. Change in V3: - moving xs_wire.h from patch #1 to this patch - fix return value of XenStoreListDirectory - Use a timeout to print a debug message if the other side of the xenstore ring does not notify through the event channel. This is done with the new XenStoreWaitForEvent function. - Have XenStoreReadReply check status of XenStoreProcessMessage and return an error if needed. - Have XenStoreTalkv return the status of XenStoreReadReply. - Have a loop to check for the quiescent of the response ring in the XenStoreInitComms function. (with a timeout of 5 seconds) - use the recently introduced XenStore 'closing' feature. Change in V2: - Change comment style, from freebsd to ovmf - Fix type of EventChannel - Fix debug print, no more cast - Implement XenStoreDeinit. - Clean up comments - Fix few codding style issue - Add FAIL xenstore status value. Origin: FreeBSD 10.0 License: This patch adds several files under the MIT licence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16267 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/XenBusDxe/XenBusDxe.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OvmfPkg/XenBusDxe/XenBusDxe.c') diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c index edeb20ef38..679fe3b592 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.c +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c @@ -31,6 +31,7 @@ #include "XenHypercall.h" #include "GrantTable.h" +#include "XenStore.h" /// @@ -346,6 +347,9 @@ XenBusDxeDriverBindingStart ( XenGrantTableInit (Dev, MmioAddr); + Status = XenStoreInit (Dev); + ASSERT_EFI_ERROR (Status); + Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_CALLBACK, NotifyExitBoot, (VOID*) Dev, @@ -399,6 +403,7 @@ XenBusDxeDriverBindingStop ( XENBUS_DEVICE *Dev = mMyDevice; gBS->CloseEvent (Dev->ExitBootEvent); + XenStoreDeinit (Dev); XenGrantTableDeinit (Dev); gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid, -- cgit v1.2.3