From: Owen Smith Date: Fri, 27 Sep 2013 08:20:53 +0000 (+0100) Subject: [CA-115411] Skip XS_* responses that are not supported in the windows frontend. X-Git-Tag: 8.1.0-rc1~169^2^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fa425ff6a74bda2675b3c246388ed523166606ca;p=pvdrivers%2Fwin%2Fxenbus.git [CA-115411] Skip XS_* responses that are not supported in the windows frontend. Add a warning displaying the type, but otherwise do nothing with unknown responses. (v2) Updated whitespace/tabbing and capitalization Signed-off-by: Owen Smith --- diff --git a/src/xenbus/store.c b/src/xenbus/store.c index 2e8953e..bee8589 100644 --- a/src/xenbus/store.c +++ b/src/xenbus/store.c @@ -421,6 +421,29 @@ __StoreReceiveSegment( return (Segment->Offset == Segment->Length) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } +static FORCEINLINE BOOLEAN +__StoreIgnoreHeaderType( + IN ULONG Type + ) +{ + switch (Type) { + case XS_DEBUG: + case XS_GET_PERMS: + case XS_INTRODUCE: + case XS_RELEASE: + case XS_GET_DOMAIN_PATH: + case XS_MKDIR: + case XS_SET_PERMS: + case XS_IS_DOMAIN_INTRODUCED: + case XS_RESUME: + case XS_SET_TARGET: + case XS_RESTRICT: + return TRUE; + default: + return FALSE; + } +} + static FORCEINLINE BOOLEAN __StoreVerifyHeader( struct xsd_sockmsg *Header @@ -439,7 +462,8 @@ __StoreVerifyHeader( Header->type != XS_WRITE && Header->type != XS_RM && Header->type != XS_WATCH_EVENT && - Header->type != XS_ERROR) { + Header->type != XS_ERROR && + !__StoreIgnoreHeaderType(Header->type)) { Error("UNRECOGNIZED TYPE 0x%08x\n", Header->type); Valid = FALSE; } @@ -736,6 +760,12 @@ __StoreProcessResponse( Response = &Context->Response; + if (__StoreIgnoreHeaderType(Response->Header.type)) { + Warning("IGNORING RESPONSE TYPE %08X\n", Response->Header.type); + __StoreResetResponse(Context); + return; + } + if (Response->Header.type == XS_WATCH_EVENT) { __StoreProcessWatchEvent(Context); __StoreResetResponse(Context);