From patchwork Tue May 22 09:56:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ronnie sahlberg X-Patchwork-Id: 160580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8AB9EB6F9F for ; Tue, 22 May 2012 20:01:59 +1000 (EST) Received: from localhost ([::1]:44871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWluf-00077S-Ba for incoming@patchwork.ozlabs.org; Tue, 22 May 2012 06:01:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWluU-00076X-Jc for qemu-devel@nongnu.org; Tue, 22 May 2012 06:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWluO-0005Hn-9n for qemu-devel@nongnu.org; Tue, 22 May 2012 06:01:46 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:41715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWluO-0005H2-2A for qemu-devel@nongnu.org; Tue, 22 May 2012 06:01:40 -0400 Received: by dadv2 with SMTP id v2so9737294dad.4 for ; Tue, 22 May 2012 03:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=ZF5rf09FeFbrn4YjyxEcEpCgJf9qOMx4g209ivy+s1c=; b=XZxS7KMeNJVqT1UPnaSbAXDz2RwuflkuGHfB7ZkNGKXLsPqsiytRcnKOoVuNfYgftt O3eLi2cH/+FmovwG6vuCPdjV+acWUBoBueN4+YqFLKDdLbL6mZCAAYTYvfm9ssEk9w5E Vm/JFExQEUZB/czNe+mXIgB3Nz/jZXATGHl+6Zwak4PeDpJ61rX8qowLo9vmRJZZ1H1g rtZjLYSTkQNcvJESaDLeSRA5poiYAZotLqcjzK4M6ztoFkUglTvkNCSm7TH+DCBJ+GMp n9VzOxoH1lnJ5ym/4MUFdsoE+bXHYCAXGaBG/FncYPp24o4QXF5bd8omXLCc2h3tw7gI 0t8Q== Received: by 10.68.228.170 with SMTP id sj10mr10352325pbc.106.1337680897571; Tue, 22 May 2012 03:01:37 -0700 (PDT) Received: from ronniesahlberg@gmail.com (CPE-138-130-106-226.lns3.cht.bigpond.net.au. [138.130.106.226]) by mx.google.com with ESMTPS id jv6sm26206696pbc.40.2012.05.22.03.01.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 May 2012 03:01:36 -0700 (PDT) Received: by ronniesahlberg@gmail.com (sSMTP sendmail emulation); Tue, 22 May 2012 19:56:48 +1000 From: Ronnie Sahlberg To: qemu-devel@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com Date: Tue, 22 May 2012 19:56:36 +1000 Message-Id: <1337680596-8485-1-git-send-email-ronniesahlberg@gmail.com> X-Mailer: git-send-email 1.7.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: Ronnie Sahlberg Subject: [Qemu-devel] [PATCH] ISCSI: We need to call qemu_notify_event() everytime we update which events we need to be notified for. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Otherwise, If we add an event for -is-writeable but the socket is already writeable there may be a short delay before the event callback is actually triggered. Those delays would in particular hurt performance during BIOS boot and when the GRUB bootloader reads the kernel and initrd. Signed-off-by: Ronnie Sahlberg --- block/iscsi.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index d37c4ee..f956824 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -109,6 +109,13 @@ iscsi_set_events(IscsiLun *iscsilun) (iscsi_which_events(iscsi) & POLLOUT) ? iscsi_process_write : NULL, iscsi_process_flush, iscsilun); + + /* If we just added the event for writeable we must call + and the socket is already writeable the callback might + not be invoked until after a short delay unless we call + qemu_notify_event(). + */ + qemu_notify_event(); } static void