diff options
| author | Richard W.M. Jones <rjones@redhat.com> | 2012-07-23 12:45:31 +0100 |
|---|---|---|
| committer | Richard W.M. Jones <rjones@redhat.com> | 2012-07-23 12:45:31 +0100 |
| commit | ef75c4c568e8e855f133b4a577c6629932aae49a (patch) | |
| tree | dafcedc1e5e2a793aa119443dbb152a60a396382 /src | |
| parent | 524bb29526050e140d0ffb314c78b20d1aaf6078 (diff) | |
launch: libvirt: Enforce minimum version of libvirt 0.9.13.
Diffstat (limited to 'src')
| -rw-r--r-- | src/launch-libvirt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 8d696232..7b84c8ce 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -99,6 +99,7 @@ static void libvirt_error (guestfs_h *g, const char *fs, ...); static int launch_libvirt (guestfs_h *g, const char *libvirt_uri) { + unsigned long version; virConnectPtr conn = NULL; virDomainPtr dom = NULL; char *capabilities = NULL; @@ -117,6 +118,18 @@ launch_libvirt (guestfs_h *g, const char *libvirt_uri) return -1; } + /* Check minimum required version of libvirt. The libvirt backend + * is new and not the default, so we can get away with forcing + * people who want to try it to have a reasonably new version of + * libvirt, so we don't have to work around any bugs in libvirt. + */ + virGetVersion (&version, NULL, NULL); + debug (g, "libvirt version = %lu", version); + if (version < 9013) { + error (g, _("you need a newer version of libvirt to use the 'libvirt' attach-method")); + return -1; + } + guestfs___launch_send_progress (g, 0); TRACE0 (launch_libvirt_start); |
