From patchwork Wed May 26 14:09:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 53637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE013B6EFF for ; Thu, 27 May 2010 01:29:10 +1000 (EST) Received: from localhost ([127.0.0.1]:57984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHIXb-00055d-UA for incoming@patchwork.ozlabs.org; Wed, 26 May 2010 11:29:07 -0400 Received: from [140.186.70.92] (port=45301 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHHN9-0003Jp-VJ for qemu-devel@nongnu.org; Wed, 26 May 2010 10:14:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHHIr-00045M-9G for qemu-devel@nongnu.org; Wed, 26 May 2010 10:09:50 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:39026) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHHIr-00044Y-2k for qemu-devel@nongnu.org; Wed, 26 May 2010 10:09:49 -0400 Received: by mail-ww0-f45.google.com with SMTP id 39so860125wwb.4 for ; Wed, 26 May 2010 07:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=Zp4rh58hbm49ndhMD2B2T28htvEQ+GgNC3PUqYWmQm0=; b=bk8VxBxc/LutqwSJG+pnNZt37NF4AclzFJ+Ses1eajkTxxYUIsOMtIWHtETlV1IdGV 31Q+awQ4LFceYpY5FmTkk2xmDVXCJz5/8K4ZBc4v2B3XdUGlVbLFg3CA+jHG/utvZcEp ZC7l78CMZKObfre5SvSUenMUSgxHpjr+obikk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=UBTRz4PjFbuk50hvVXGWir0mJeINKszsEcrEImyPoc6WnY8ptw/yOEm7foKDAieb8G /8BIXAoYfxm0zKJg2Lr7CuoQ0tLkKaciMJYnQ49gpr5hsGuQDMp5sd1M8Z/yduh+xua6 7V2ADRByaKpLZl7qIVJgZlIwp84XGKYfca1LI= Received: by 10.227.151.143 with SMTP id c15mr8439561wbw.135.1274882988700; Wed, 26 May 2010 07:09:48 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com [209.132.186.34]) by mx.google.com with ESMTPS id u32sm318964wbc.11.2010.05.26.07.09.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 07:09:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 26 May 2010 16:09:32 +0200 Message-Id: <1274882978-9875-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1274882978-9875-1-git-send-email-pbonzini@redhat.com> References: <1274882978-9875-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/8] add event_notifier_set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- event_notifier.c | 7 +++++++ event_notifier.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/event_notifier.c b/event_notifier.c index 2c73555..3f50568 100644 --- a/event_notifier.c +++ b/event_notifier.c @@ -38,6 +38,13 @@ int event_notifier_get_fd(EventNotifier *e) return e->fd; } +int event_notifier_set(EventNotifier *e) +{ + uint64_t value = 1; + int r = write(e->fd, &value, sizeof(value)); + return r == sizeof(value); +} + int event_notifier_test_and_clear(EventNotifier *e) { uint64_t value; diff --git a/event_notifier.h b/event_notifier.h index 24117ea..8d5735f 100644 --- a/event_notifier.h +++ b/event_notifier.h @@ -10,6 +10,7 @@ struct EventNotifier { int event_notifier_init(EventNotifier *, int active); void event_notifier_cleanup(EventNotifier *); int event_notifier_get_fd(EventNotifier *); +int event_notifier_set(EventNotifier *); int event_notifier_test_and_clear(EventNotifier *); int event_notifier_test(EventNotifier *);