[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly
# HG changeset patch # User Olaf Hering <olaf@xxxxxxxxx> # Date 1327689175 0 # Node ID cdb1e4a3845024c474141e6962ca0a8ace062d55 # Parent 8c0ef22c10096bc2afe50a2487e17242bfd21fb4 tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly If the first ioctl fails with ENOENT it means the command is known. If a second attempt to map each gfn happens to fail then there is no need to run the fallback code. Some gfns are paged and the fallback code would not fix the failure. Instead return the EINVAL to the caller. Signed-off-by: Olaf Hering <olaf@xxxxxxxxx> Acked-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- diff -r 8c0ef22c1009 -r cdb1e4a38450 tools/libxc/xc_linux_osdep.c --- a/tools/libxc/xc_linux_osdep.c Fri Jan 27 18:23:42 2012 +0000 +++ b/tools/libxc/xc_linux_osdep.c Fri Jan 27 18:32:55 2012 +0000 @@ -217,6 +217,7 @@ rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx); + /* Command was recognized, some gfn in arr are in paging state */ if ( rc < 0 && errno == ENOENT ) { for ( i = rc = 0; rc == 0 && i < num; i++ ) @@ -235,8 +236,8 @@ } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT ); } } - - if ( rc < 0 && errno == EINVAL && (int)num > 0 ) + /* Command was not recognized, use fall back */ + else if ( rc < 0 && errno == EINVAL && (int)num > 0 ) { /* * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |