#include "lxc_container.h"
#include "virnodesuspend.h"
#include "virstring.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_LXC
virCapsPtr caps;
virCapsGuestPtr guest;
virArch altArch;
+ char *lxc_path = NULL;
if ((caps = virCapabilitiesNew(virArchFromHost(),
0, 0)) == NULL)
goto error;
}
+ if (!(lxc_path = virFileFindResource("libvirt_lxc",
+ "src",
+ LIBEXECDIR)))
+ goto error;
+
if ((guest = virCapabilitiesAddGuest(caps,
"exe",
caps->host.arch,
- LIBEXECDIR "/libvirt_lxc",
+ lxc_path,
NULL,
0,
NULL)) == NULL)
if ((guest = virCapabilitiesAddGuest(caps,
"exe",
altArch,
- LIBEXECDIR "/libvirt_lxc",
+ lxc_path,
NULL,
0,
NULL)) == NULL)
goto error;
}
+ VIR_FREE(lxc_path);
+
if (driver) {
/* Security driver data */
const char *doi, *model, *label, *type;
return caps;
error:
+ VIR_FREE(lxc_path);
virObjectUnref(caps);
return NULL;
}