mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
lib/launch-libvirt.c: Don't store libvirt_version in handle
We no longer use the libvirt version anywhere, except when reporting the version. Remove this from the handle. Simplify the remaining code. In particular: * don't bother parsing the libvirt version, just print what virGetVersion gives us * guestfs_int_version_from_libvirt is dead code, so it can be removed
This commit is contained in:
committed by
rwmjones
parent
48bad58024
commit
d8b08eac38
@@ -813,7 +813,6 @@ struct rusage;
|
||||
extern int guestfs_int_wait4 (guestfs_h *g, pid_t pid, int *status, struct rusage *rusage, const char *errmsg);
|
||||
|
||||
/* version.c */
|
||||
extern void guestfs_int_version_from_libvirt (struct version *v, int vernum);
|
||||
extern void guestfs_int_version_from_values (struct version *v, int maj, int min, int mic);
|
||||
extern int guestfs_int_version_from_x_y (guestfs_h *g, struct version *v, const char *str);
|
||||
extern int guestfs_int_version_from_x_y_re (guestfs_h *g, struct version *v, const char *str, const pcre2_code *re);
|
||||
|
||||
@@ -124,7 +124,6 @@ struct backend_libvirt_data {
|
||||
bool selinux_norelabel_disks;
|
||||
char name[DOMAIN_NAME_LEN]; /* random name */
|
||||
bool is_kvm; /* false = qemu, true = kvm (from capabilities)*/
|
||||
struct version libvirt_version; /* libvirt version */
|
||||
struct secret *secrets; /* list of secrets */
|
||||
size_t nr_secrets;
|
||||
char *uefi_code; /* UEFI (firmware) code and variables. */
|
||||
@@ -341,12 +340,8 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
|
||||
}
|
||||
|
||||
virGetVersion (&version_number, NULL, NULL);
|
||||
guestfs_int_version_from_libvirt (&data->libvirt_version, version_number);
|
||||
debug (g, "libvirt version = %lu (%d.%d.%d)",
|
||||
version_number,
|
||||
data->libvirt_version.v_major,
|
||||
data->libvirt_version.v_minor,
|
||||
data->libvirt_version.v_micro);
|
||||
debug (g, "libvirt version = %lu", version_number);
|
||||
|
||||
guestfs_int_launch_send_progress (g, 0);
|
||||
|
||||
/* Create a random name for the guest. */
|
||||
|
||||
@@ -38,14 +38,6 @@ COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0)
|
||||
|
||||
static int version_from_x_y_or_x (guestfs_h *g, struct version *v, const char *str, const pcre2_code *re, bool allow_only_x);
|
||||
|
||||
void
|
||||
guestfs_int_version_from_libvirt (struct version *v, int vernum)
|
||||
{
|
||||
v->v_major = vernum / 1000000UL;
|
||||
v->v_minor = vernum / 1000UL % 1000UL;
|
||||
v->v_micro = vernum % 1000UL;
|
||||
}
|
||||
|
||||
void
|
||||
guestfs_int_version_from_values (struct version *v, int maj, int min, int mic)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user