From patchwork Mon Jun 13 17:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 69907 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1656839qgf; Mon, 13 Jun 2016 10:37:54 -0700 (PDT) X-Received: by 10.55.155.193 with SMTP id d184mr16192235qke.152.1465839473981; Mon, 13 Jun 2016 10:37:53 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id p94si15811810qkp.93.2016.06.13.10.37.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jun 2016 10:37:53 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5DHZ6XA001245; Mon, 13 Jun 2016 13:35:06 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u5DHZ5lO031786 for ; Mon, 13 Jun 2016 13:35:05 -0400 Received: from [10.3.116.214] (ovpn-116-214.phx2.redhat.com [10.3.116.214]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5DHZ49B028967; Mon, 13 Jun 2016 13:35:05 -0400 To: Jovanka Gulicoska , libvir-list@redhat.com References: <1465835923-9197-1-git-send-email-jovanka.gulicoska@gmail.com> From: Cole Robinson Message-ID: Date: Mon, 13 Jun 2016 13:35:04 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1465835923-9197-1-git-send-email-jovanka.gulicoska@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: Re: [libvirt] [PATCH v2 0/6] Introducing storage pool lifecycle event APIs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com On 06/13/2016 12:38 PM, Jovanka Gulicoska wrote: > Changes follow comments on v1 patches. > > Introducing implementation of storage pool event APIs. Code changes > follow network event APIs. > > Implemented functions: virStoragePoolEventRegisterAny(), > virStoragePoolEventDeregisterAny(), virStoragePoolLifeCycleEventNew(), > introduced STARTED, STOPPED, DEFINE, UNDEFINE and REFRESHED. > > STARTED signal is emiited in storagePoolCreateXML() and storagePoolCreate() > DEFINED signal is emitted in storagePoolDefineXML() > UNDEFINED signal is emitted in storagePoolUndefine() > STOPPED signal is emitted in storagePoolDestroy() and storagePoolRefresh() > REFRESHED signal is emitted in storagePoolRefresh() > > There are also test as well as unittests for the new functions and signals. > > This is part of a GSOC project: Asynchronous lifecycle events for storage objects > As part of the project there should also be implementation for > storage volume events. > For now there's no signal when volumes are created or deleted, > they can also be implemented, but probably the easiest way is to have > apps watch for REFRESH signal, and later extend storage driver code to > refresh a pool after volume APIs are called. > > Jovanka Gulicoska (6): > Introduce storage lifecycle event APIs > conf: add storage_event handling > test: implement storage lifecycle event APIs > remote: implement storage lifecycle event APIs > storage: implement storage lifecycle event APIs > event-test: support storage lifecycle event APIs > > daemon/libvirtd.h | 2 + > daemon/remote.c | 201 +++++++++++++++++++++++++++++- > examples/object-events/event-test.c | 46 ++++++- > include/libvirt/libvirt-storage.h | 94 ++++++++++++++ > src/Makefile.am | 5 + > src/conf/storage_conf.h | 4 + > src/conf/storage_event.c | 237 ++++++++++++++++++++++++++++++++++++ > src/conf/storage_event.h | 60 +++++++++ > src/datatypes.h | 13 ++ > src/driver-storage.h | 14 +++ > src/libvirt-storage.c | 125 +++++++++++++++++++ > src/libvirt_private.syms | 5 + > src/libvirt_public.syms | 7 ++ > src/remote/remote_driver.c | 128 +++++++++++++++++++ > src/remote/remote_protocol.x | 43 ++++++- > src/remote_protocol-structs | 16 +++ > src/storage/storage_driver.c | 110 +++++++++++++++++ > src/test/test_driver.c | 71 +++++++++++ > tests/objecteventtest.c | 177 +++++++++++++++++++++++++++ > 19 files changed, 1355 insertions(+), 3 deletions(-) > create mode 100644 src/conf/storage_event.c > create mode 100644 src/conf/storage_event.h > I just reviewed the diff between v1 and v2 and made a couple small changes, diff attached. I copied the docstring from the network events since your version still had several typos, and fixed one spacing issue in comments in the test driver. Otherwise it looks like all my review bits were addressed, so this looks good to me. Let's give it some time to see if anyone else has comments, otherwise I'll push it at the end of the week (with those minor changes) Thanks, Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/include/libvirt/libvirt-storage.h b/include/libvirt/libvirt-storage.h index bc8cee5..f593385 100644 --- a/include/libvirt/libvirt-storage.h +++ b/include/libvirt/libvirt-storage.h @@ -412,11 +412,10 @@ typedef enum { * @opaque: application specified data * * A generic storage pool event callback handler, for use with - * virConnectStoragePoolEventRegisterAny(). - * Spcific events usually have a customization with extra paramenters, - * often with @opaque being passed in a different specific possition; - * use VIR_STORAGE_POOL_EVENT_CALLBACK() when registering an - * appropriate handler. + * virConnectStoragePoolEventRegisterAny(). Specific events usually + * have a customization with extra parameters, often with @opaque being + * passed in a different parameter position; use + * VIR_STORAGE_POOL_EVENT_CALLBACK() when registering an appropriate handler. */ typedef void (*virConnectStoragePoolEventGenericCallback)(virConnectPtr conn, virStoragePoolPtr pool, diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 3b1e004..8994f83 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -6820,8 +6820,8 @@ static virStorageDriver testStorageDriver = { .connectListDefinedStoragePools = testConnectListDefinedStoragePools, /* 0.5.0 */ .connectListAllStoragePools = testConnectListAllStoragePools, /* 0.10.2 */ .connectFindStoragePoolSources = testConnectFindStoragePoolSources, /* 0.5.0 */ - .connectStoragePoolEventRegisterAny = testConnectStoragePoolEventRegisterAny, /*1.3.6*/ - .connectStoragePoolEventDeregisterAny = testConnectStoragePoolEventDeregisterAny, /*1.3.6*/ + .connectStoragePoolEventRegisterAny = testConnectStoragePoolEventRegisterAny, /* 1.3.6 */ + .connectStoragePoolEventDeregisterAny = testConnectStoragePoolEventDeregisterAny, /* 1.3.6 */ .storagePoolLookupByName = testStoragePoolLookupByName, /* 0.5.0 */ .storagePoolLookupByUUID = testStoragePoolLookupByUUID, /* 0.5.0 */ .storagePoolLookupByVolume = testStoragePoolLookupByVolume, /* 0.5.0 */