[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Andres Lagar-Cavilla" <andres@xxxxxxxxxxxxxxxx>
  • Date: Thu, 26 Jan 2012 08:19:55 -0800
  • Cc: olaf@xxxxxxxxx
  • Delivery-date: Thu, 26 Jan 2012 16:20:15 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=message-id :in-reply-to:references:date:subject:from:to:cc:reply-to :mime-version:content-type:content-transfer-encoding; q=dns; s= lagarcavilla.org; b=vpczBwV0AAaJGq3MZfpVgjUo50LzhnGRRByWNNJiM4Vg ok2jDNMhlEM1WEy13373OrxwkdRL3PIe5Dl2LDHt6fAMhgEo0v6oYMz/o/COLwpI YiK59jCO3JU+bI3vCCmON+k9Z6JB70SOOUkoo6/hRWDTa0UvFMBO19Evfxoa2PY=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

> Date: Thu, 26 Jan 2012 14:36:30 +0100
> From: Olaf Hering <olaf@xxxxxxxxx>
> To: xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-devel] [PATCH] tools/libxc: handle fallback in
>       linux_privcmd_map_foreign_bulk properly
> Message-ID: <aa0d678fece208975984.1327584990@xxxxxxxxxxxx>
> Content-Type: text/plain; charset="us-ascii"
>
> # HG changeset patch
> # User Olaf Hering <olaf@xxxxxxxxx>
> # Date 1327584962 -3600
> # Node ID aa0d678fece208975984e8e59ca223c07fc50c06
> # Parent  89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
> 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>

Thanks,
Andres
>
> diff -r 89fdabcf315f -r aa0d678fece2 tools/libxc/xc_linux_osdep.c
> --- a/tools/libxc/xc_linux_osdep.c
> +++ b/tools/libxc/xc_linux_osdep.c
> @@ -217,6 +217,7 @@ static void *linux_privcmd_map_foreign_b
>
>      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 @@ static void *linux_privcmd_map_foreign_b
>              } 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.