[libvirt] [v1.2.9-maint] Teach virt-aa-helper to use TEMPLATE.qemu if the domain is kvm or kqemu

(cherry picked from commit 16d2bc8b98563f801f111795250515fcbd39ab46) --- Succesfully tested on Debian at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786652 src/security/virt-aa-helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 9afc8db..1f299a0 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -341,15 +341,25 @@ create_profile(const char *profile, const char *profile_name, int tlen, plen; int fd; int rc = -1; + const char *driver_name = NULL; if (virFileExists(profile)) { vah_error(NULL, 0, _("profile exists")); 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", - virDomainVirtTypeToString(virtType)) < 0) { + driver_name) < 0) { vah_error(NULL, 0, _("template name exceeds maximum length")); goto end; } -- 2.1.4

On 06/13/2015 02:48 AM, Guido Günther wrote:
(cherry picked from commit 16d2bc8b98563f801f111795250515fcbd39ab46) --- Succesfully tested on Debian at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786652
src/security/virt-aa-helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
ACK. In general, if there are not any backport conflicts and it fixes a bug, you can go ahead and push maintenance branch backports right away. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Sat, Jun 13, 2015 at 11:10:57AM -0600, Eric Blake wrote:
On 06/13/2015 02:48 AM, Guido Günther wrote:
(cherry picked from commit 16d2bc8b98563f801f111795250515fcbd39ab46) --- Succesfully tested on Debian at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786652
src/security/virt-aa-helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
ACK. In general, if there are not any backport conflicts and it fixes a bug, you can go ahead and push maintenance branch backports right away.
Good to know! Pushed now. Thanks. -- Guido
participants (2)
-
Eric Blake
-
Guido Günther