summaryrefslogtreecommitdiffstats
path: root/src/guestfs-internal.h
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-10-13 12:57:12 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-10-13 20:54:07 +0100
commitd83d17e9dbfb24496a0841fc2aed436181ca0341 (patch)
treed6e0bfc2ff4a694f731d47e6c8d386d5b61b02ce /src/guestfs-internal.h
parent07d0546f5d210d1cee048de8d42bdf58302f0d93 (diff)
downloadlibguestfs-d83d17e9dbfb24496a0841fc2aed436181ca0341.tar.gz
libguestfs-d83d17e9dbfb24496a0841fc2aed436181ca0341.tar.xz
libguestfs-d83d17e9dbfb24496a0841fc2aed436181ca0341.zip
New APIs: Model libvirt authentication events through the API.
This commit models libvirt authentication events through the API, adding one new event (GUESTFS_EVENT_LIBVIRT_AUTH) and several new APIs: guestfs_set_libvirt_supported_credentials guestfs_get_libvirt_requested_credentials guestfs_get_libvirt_requested_credential_prompt guestfs_get_libvirt_requested_credential_challenge guestfs_get_libvirt_requested_credential_defresult guestfs_set_libvirt_requested_credential See the documentation and example which shows how to use the new API. This commit also changes existing calls to virConnectOpen* within the library so that the new API is used. Also included is an example (but not a test, because it's hard to see how to automatically test the libvirt API).
Diffstat (limited to 'src/guestfs-internal.h')
-rw-r--r--src/guestfs-internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 784f7627..80906133 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -293,6 +293,16 @@ struct guestfs_h
int ml_debug_calls; /* Extra debug info on each FUSE call. */
#endif
+#ifdef HAVE_LIBVIRT
+ /* Used by src/libvirt-auth.c. */
+#define NR_CREDENTIAL_TYPES 9
+ unsigned int nr_supported_credentials;
+ int supported_credentials[NR_CREDENTIAL_TYPES];
+ const char *saved_libvirt_uri; /* Doesn't need to be freed. */
+ unsigned int nr_requested_credentials;
+ virConnectCredentialPtr requested_credentials;
+#endif
+
/**** Private data for attach-methods. ****/
/* NB: This cannot be a union because of a pathological case where
* the user changes attach-method while reusing the handle to launch
@@ -567,4 +577,9 @@ extern int guestfs___read_db_dump (guestfs_h *g, const char *dumpfile, void *opa
extern void guestfs___free_fuse (guestfs_h *g);
#endif
+/* libvirt-auth.c */
+#ifdef HAVE_LIBVIRT
+extern virConnectPtr guestfs___open_libvirt_connection (guestfs_h *g, const char *uri, unsigned int flags);
+#endif
+
#endif /* GUESTFS_INTERNAL_H_ */