connect.h 1.15 KB
Newer Older
Lars Karlitski's avatar
Lars Karlitski committed
1 2
#pragma once

3 4
#define VIR_ENUM_SENTINELS

5 6
#include "util.h"

Lars Karlitski's avatar
Lars Karlitski committed
7 8
#include <libvirt/libvirt.h>

9 10
#define VIRT_DBUS_CONNECT_INTERFACE "org.libvirt.Connect"

11
struct virtDBusConnect {
12 13 14
    GDBusConnection *bus;
    const gchar *uri;
    const gchar *connectPath;
15
    gchar *nodeDevPath;
16
    gchar *domainPath;
17
    gchar *networkPath;
18
    gchar *nwfilterPath;
19
    gchar *secretPath;
20
    gchar *storagePoolPath;
21
    gchar *storageVolPath;
22
    virConnectPtr connection;
23
    GMutex lock;
24

25
    gint domainCallbackIds[VIR_DOMAIN_EVENT_ID_LAST];
26
    gint networkCallbackIds[VIR_NETWORK_EVENT_ID_LAST];
27
    gint nodeDevCallbackIds[VIR_NODE_DEVICE_EVENT_ID_LAST];
28
    gint secretCallbackIds[VIR_SECRET_EVENT_ID_LAST];
29
    gint storagePoolCallbackIds[VIR_STORAGE_POOL_EVENT_ID_LAST];
30
};
31
typedef struct virtDBusConnect virtDBusConnect;
Lars Karlitski's avatar
Lars Karlitski committed
32

33
void
Pavel Hrdina's avatar
Pavel Hrdina committed
34
virtDBusConnectNew(virtDBusConnect **connectp,
35 36 37 38
                   GDBusConnection *bus,
                   const gchar *uri,
                   const gchar *connectPath,
                   GError **error);
Pavel Hrdina's avatar
Pavel Hrdina committed
39

40
gboolean
41
virtDBusConnectOpen(virtDBusConnect *connect,
42
                    GError **error);
Pavel Hrdina's avatar
Pavel Hrdina committed
43 44

void
45
virtDBusConnectListFree(virtDBusConnect **connectList);