From: "Daniel P. Berrange" <berrange@redhat.com>
To: Osier Yang <jyang@redhat.com>
Cc: libvir-list@redhat.com, kvm@vger.kernel.org,
penberg@cs.helsinki.fi, levinsasha928@gmail.com,
gorcunov@gmail.com, mingo@elte.hu, asias.hejun@gmail.com
Subject: Re: [libvirt] [PATCH 4/7] kvmtool: Add hook support for kvmtool domain
Date: Tue, 6 Dec 2011 14:48:51 +0000 [thread overview]
Message-ID: <20111206144851.GF7937@redhat.com> (raw)
In-Reply-To: <1321012626-31713-6-git-send-email-jyang@redhat.com>
On Fri, Nov 11, 2011 at 07:57:03PM +0800, Osier Yang wrote:
> Just like QEMU and LXC, kvm driver intends to support running hook
> script before domain starting and after domain shutdown too.
> ---
> src/util/hooks.c | 11 ++++++++++-
> src/util/hooks.h | 8 ++++++++
> 2 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/src/util/hooks.c b/src/util/hooks.c
> index 110a94b..765cb68 100644
> --- a/src/util/hooks.c
> +++ b/src/util/hooks.c
> @@ -52,12 +52,14 @@ VIR_ENUM_DECL(virHookDaemonOp)
> VIR_ENUM_DECL(virHookSubop)
> VIR_ENUM_DECL(virHookQemuOp)
> VIR_ENUM_DECL(virHookLxcOp)
> +VIR_ENUM_DECL(virHookKvmToolOp)
>
> VIR_ENUM_IMPL(virHookDriver,
> VIR_HOOK_DRIVER_LAST,
> "daemon",
> "qemu",
> - "lxc")
> + "lxc",
> + "kvmtool")
>
> VIR_ENUM_IMPL(virHookDaemonOp, VIR_HOOK_DAEMON_OP_LAST,
> "start",
> @@ -79,6 +81,10 @@ VIR_ENUM_IMPL(virHookLxcOp, VIR_HOOK_LXC_OP_LAST,
> "start",
> "stopped")
>
> +VIR_ENUM_IMPL(virHookKvmToolOp, VIR_HOOK_KVMTOOL_OP_LAST,
> + "start",
> + "stopped")
> +
> static int virHooksFound = -1;
>
> /**
> @@ -230,6 +236,9 @@ virHookCall(int driver, const char *id, int op, int sub_op, const char *extra,
> case VIR_HOOK_DRIVER_LXC:
> opstr = virHookLxcOpTypeToString(op);
> break;
> + case VIR_HOOK_DRIVER_KVMTOOL:
> + opstr = virHookKvmToolOpTypeToString(op);
> + break;
> }
> if (opstr == NULL) {
> virHookReportError(VIR_ERR_INTERNAL_ERROR,
> diff --git a/src/util/hooks.h b/src/util/hooks.h
> index fd7411c..69081c4 100644
> --- a/src/util/hooks.h
> +++ b/src/util/hooks.h
> @@ -31,6 +31,7 @@ enum virHookDriverType {
> VIR_HOOK_DRIVER_DAEMON = 0, /* Daemon related events */
> VIR_HOOK_DRIVER_QEMU, /* QEmu domains related events */
> VIR_HOOK_DRIVER_LXC, /* LXC domains related events */
> + VIR_HOOK_DRIVER_KVMTOOL, /* KVMTOOL domains related events */
>
> VIR_HOOK_DRIVER_LAST,
> };
> @@ -67,6 +68,13 @@ enum virHookLxcOpType {
> VIR_HOOK_LXC_OP_LAST,
> };
>
> +enum virHookKvmToolOpType {
> + VIR_HOOK_KVMTOOL_OP_START, /* domain is about to start */
> + VIR_HOOK_KVMTOOL_OP_STOPPED, /* domain has stopped */
> +
> + VIR_HOOK_KVMTOOL_OP_LAST,
> +};
> +
> int virHookInitialize(void);
>
> int virHookPresent(int driver);
Trivial, ACK
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2011-12-06 14:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 11:56 [libvirt] (no subject) Osier Yang
2011-11-11 11:30 ` [libvirt] Add driver support for Native Linux KVM Tool Osier Yang
2011-11-11 11:56 ` [libvirt] [PATCH 1/7] kvmtool: Add configure support Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH] kvm tools: Introduce an ENV variable for the state dir Osier Yang
2011-12-06 14:39 ` Daniel P. Berrange
2011-12-09 7:18 ` Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 2/7] kvmtool: Add documents Osier Yang
2011-12-06 14:47 ` Daniel P. Berrange
2011-11-11 11:57 ` [libvirt] [PATCH 3/7] kvmtool: Add new enums and error codes for the driver Osier Yang
2011-12-06 14:47 ` Daniel P. Berrange
2011-11-11 11:57 ` [libvirt] [PATCH 4/7] kvmtool: Add hook support for kvmtool domain Osier Yang
2011-12-06 14:48 ` Daniel P. Berrange [this message]
2011-11-11 11:57 ` [libvirt] [PATCH 5/7] kvmtool: Add new domain type Osier Yang
2011-12-06 14:46 ` Daniel P. Berrange
2011-12-09 7:22 ` Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 6/7] conf: Set source type of the stub console Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 7/7] kvmtool: Implementation for kvm tool driver Osier Yang
2011-12-06 14:55 ` Daniel P. Berrange
2011-12-09 7:30 ` Osier Yang
2011-12-06 14:38 ` [libvirt] (no subject) Daniel P. Berrange
2011-12-07 6:21 ` Sasha Levin
2011-12-07 9:16 ` Daniel P. Berrange
2011-12-09 12:45 ` Osier Yang
2011-12-09 12:41 ` Osier Yang
2011-12-09 12:30 ` Osier Yang
2011-12-10 17:56 ` Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111206144851.GF7937@redhat.com \
--to=berrange@redhat.com \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=jyang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=libvir-list@redhat.com \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.