Teach virt-aa-helper to use TEMPLATE.qemu if the domain is kvm or kqemu

This commit is contained in:
Cédric Bosdonnat 2014-10-28 14:42:34 -06:00
parent 00331bfbc9
commit 16d2bc8b98

View File

@ -341,15 +341,25 @@ create_profile(const char *profile, const char *profile_name,
int tlen, plen; int tlen, plen;
int fd; int fd;
int rc = -1; int rc = -1;
const char *driver_name = NULL;
if (virFileExists(profile)) { if (virFileExists(profile)) {
vah_error(NULL, 0, _("profile exists")); vah_error(NULL, 0, _("profile exists"));
goto end; goto end;
} }
switch (virtType) {
case VIR_DOMAIN_VIRT_QEMU:
case VIR_DOMAIN_VIRT_KQEMU:
case VIR_DOMAIN_VIRT_KVM:
driver_name = "qemu";
break;
default:
driver_name = virDomainVirtTypeToString(virtType);
}
if (virAsprintfQuiet(&template, "%s/TEMPLATE.%s", APPARMOR_DIR "/libvirt", if (virAsprintfQuiet(&template, "%s/TEMPLATE.%s", APPARMOR_DIR "/libvirt",
virDomainVirtTypeToString(virtType)) < 0) { driver_name) < 0) {
vah_error(NULL, 0, _("template name exceeds maximum length")); vah_error(NULL, 0, _("template name exceeds maximum length"));
goto end; goto end;
} }