connect.h 1.18 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 15
    GDBusConnection *bus;
    const gchar *uri;
    const gchar *connectPath;
    gchar *domainPath;
16
    gchar *interfacePath;
17
    gchar *networkPath;
18
    gchar *nodeDevPath;
19
    gchar *nwfilterPath;
20
    gchar *secretPath;
21
    gchar *storagePoolPath;
22
    gchar *storageVolPath;
23
    virConnectPtr connection;
24
    GMutex lock;
25

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

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

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

void
46
virtDBusConnectListFree(virtDBusConnect **connectList);