Received: from eggs.gnu.org ([208.118.235.92]:44721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSk7y-00063N-5s for qemu-devel@nongnu.org; Fri, 11 May 2012 03:19:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSk7t-000139-D9 for qemu-devel@nongnu.org; Fri, 11 May 2012 03:19:01 -0400 Received: from nat28.tlf.novell.com ([130.57.49.28]:56695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSk7t-000131-3i for qemu-devel@nongnu.org; Fri, 11 May 2012 03:18:57 -0400 Message-Id: <4FACD9940200007800082F0D@nat28.tlf.novell.com> Date: Fri, 11 May 2012 08:19:16 +0100 From: "Jan Beulich" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part527CBC64.2__=" Subject: [Qemu-devel] [PATCH] qemu/xendisk: set maximum number of grants to be used List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xen-devel , qemu-devel@nongnu.org Cc: Stefano Stabellini This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part527CBC64.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Legacy (non-pvops) gntdev drivers may require this to be done when the number of grants intended to be used simultaneously exceeds a certain driver specific default limit. Signed-off-by: Jan Beulich --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -536,6 +536,10 @@ static void blk_alloc(struct XenDevice * if (xen_mode !=3D XEN_EMULATE) { batch_maps =3D 1; } + if (xc_gnttab_set_max_grants(xendev->gnttabdev, + max_requests * BLKIF_MAX_SEGMENTS_PER_REQUEST + 1) < 0) + xen_be_printf(xendev, 0, "xc_gnttab_set_max_grants failed: %s\n", + strerror(errno)); } =20 static int blk_init(struct XenDevice *xendev) --=__Part527CBC64.2__= Content-Type: text/plain; name="qemu-xendisk-set-max-grants.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-xendisk-set-max-grants.patch" qemu/xendisk: set maximum number of grants to be used=0A=0ALegacy = (non-pvops) gntdev drivers may require this to be done when the=0Anumber = of grants intended to be used simultaneously exceeds a certain=0Adriver = specific default limit.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/hw/xen_disk.c=0A+++ b/hw/xen_disk.c=0A@@ -536,6 +536,10 @@ = static void blk_alloc(struct XenDevice *=0A if (xen_mode !=3D = XEN_EMULATE) {=0A batch_maps =3D 1;=0A }=0A+ if (xc_gnttab_s= et_max_grants(xendev->gnttabdev,=0A+ max_requests * BLKIF_MAX_SE= GMENTS_PER_REQUEST + 1) < 0)=0A+ xen_be_printf(xendev, 0, "xc_gnttab= _set_max_grants failed: %s\n",=0A+ strerror(errno));= =0A }=0A =0A static int blk_init(struct XenDevice *xendev)=0A --=__Part527CBC64.2__=--