~ubuntu-branches/ubuntu/karmic/libvirt/karmic-proposed

« back to all changes in this revision

Viewing changes to src/domain_event.h

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-02-11 01:01:42 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090211010142-8zrm7z1u6ryfhkiq
Tags: 0.6.0-1ubuntu1
* Merge with Debian experimental. Remaining changes:
  - debian/control:
    + Don't build-depend on QEmu.
    + Add "XS-Debian-" prefix to Debian's Vcs headers.
    + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables
      to Depends of libvirt-bin.
    + s/interract/interact/g
    + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg,
      since we used to ship them as such.
  - Rename libvirt group to libvirtd.
  - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge
    before at least one interface has been added to it.
  - dont_clobber_existing_bridges.patch: Assign the name of the virtual
    bridge dynamically to avoid interfering with existing bridges.
  - better_default_uri_virsh.patch: Default to qemu:///system if the
    user has write access to the libvirt socket, otherwise
    qemu:///session.
  - We call libxen-dev libxen3-dev, so change all references.
  - Included (but did not enable) opennebula patch (since it's not in
    main yet).

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "internal.h"
24
24
 
25
 
 
26
25
#ifndef __DOMAIN_EVENT_H__
27
26
#define __DOMAIN_EVENT_H__
28
27
 
 
28
#include "domain_conf.h"
 
29
 
29
30
struct _virDomainEventCallback {
30
31
    virConnectPtr conn;
31
32
    virConnectDomainEventCallback cb;
32
33
    void *opaque;
33
34
    virFreeCallback freecb;
34
 
 
 
35
    int deleted;
35
36
};
36
37
typedef struct _virDomainEventCallback virDomainEventCallback;
37
38
typedef virDomainEventCallback *virDomainEventCallbackPtr;
58
59
int virDomainEventCallbackListRemoveConn(virConnectPtr conn,
59
60
                                         virDomainEventCallbackListPtr cbList);
60
61
 
 
62
int virDomainEventCallbackListMarkDelete(virConnectPtr conn,
 
63
                                         virDomainEventCallbackListPtr cbList,
 
64
                                         virConnectDomainEventCallback callback);
 
65
int virDomainEventCallbackListPurgeMarked(virDomainEventCallbackListPtr cbList);
 
66
 
61
67
/**
62
68
 * Dispatching domain events that come in while
63
69
 * in a call / response rpc
64
70
 */
65
71
struct _virDomainEvent {
66
 
    virDomainPtr dom;
67
 
    int event;
 
72
    int id;
 
73
    char *name;
 
74
    unsigned char uuid[VIR_UUID_BUFLEN];
 
75
    int type;
68
76
    int detail;
69
77
};
70
78
typedef struct _virDomainEvent virDomainEvent;
77
85
typedef struct _virDomainEventQueue virDomainEventQueue;
78
86
typedef virDomainEventQueue *virDomainEventQueuePtr;
79
87
 
80
 
int virDomainEventCallbackQueuePush(virDomainEventQueuePtr evtQueue,
81
 
                                    virDomainPtr dom,
82
 
                                    int event,
83
 
                                    int detail);
 
88
virDomainEventQueuePtr virDomainEventQueueNew(void);
 
89
 
 
90
virDomainEventPtr virDomainEventNew(int id, const char *name, const unsigned char *uuid, int type, int detail);
 
91
virDomainEventPtr virDomainEventNewFromDom(virDomainPtr dom, int type, int detail);
 
92
virDomainEventPtr virDomainEventNewFromObj(virDomainObjPtr obj, int type, int detail);
 
93
virDomainEventPtr virDomainEventNewFromDef(virDomainDefPtr def, int type, int detail);
 
94
 
 
95
int virDomainEventQueuePush(virDomainEventQueuePtr evtQueue,
 
96
                            virDomainEventPtr event);
84
97
 
85
98
virDomainEventPtr
86
 
virDomainEventCallbackQueuePop(virDomainEventQueuePtr evtQueue);
 
99
virDomainEventQueuePop(virDomainEventQueuePtr evtQueue);
87
100
 
 
101
void virDomainEventFree(virDomainEventPtr event);
88
102
void virDomainEventQueueFree(virDomainEventQueuePtr queue);
89
103
 
 
104
typedef void (*virDomainEventDispatchFunc)(virConnectPtr conn,
 
105
                                           virDomainEventPtr event,
 
106
                                           virConnectDomainEventCallback cb,
 
107
                                           void *cbopaque,
 
108
                                           void *opaque);
 
109
void virDomainEventDispatchDefaultFunc(virConnectPtr conn,
 
110
                                       virDomainEventPtr event,
 
111
                                       virConnectDomainEventCallback cb,
 
112
                                       void *cbopaque,
 
113
                                       void *opaque);
 
114
 
 
115
void virDomainEventDispatch(virDomainEventPtr event,
 
116
                            virDomainEventCallbackListPtr cbs,
 
117
                            virDomainEventDispatchFunc dispatch,
 
118
                            void *opaque);
 
119
void virDomainEventQueueDispatch(virDomainEventQueuePtr queue,
 
120
                                 virDomainEventCallbackListPtr cbs,
 
121
                                 virDomainEventDispatchFunc dispatch,
 
122
                                 void *opaque);
90
123
 
91
124
#endif