mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
Teach virt-aa-helper to use TEMPLATE.qemu if the domain is kvm or kqemu
This commit is contained in:
parent
00331bfbc9
commit
16d2bc8b98
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user