Comment 39 for bug 1393842

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I'm trying:

Index: libvirt/src/security/virt-aa-helper.c
===================================================================
--- libvirt.orig/src/security/virt-aa-helper.c
+++ libvirt/src/security/virt-aa-helper.c
@@ -939,6 +939,14 @@ add_file_path(virDomainDiskDefPtr disk,
 }

 static int
+is_qemu_guest_agent(virDomainChrDefPtr channel)
+{
+
+ return channels->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
+ STREQ_NULLABLE(channels->target.name, "org.qemu.guest_agent.0";
+}
+
+static int
 get_files(vahControl * ctl)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -1034,6 +1042,8 @@ get_files(vahControl * ctl)
              ctl->def->channels[i]->source.type == VIR_DOMAIN_CHR_TYPE_PIPE) &&
             ctl->def->channels[i]->source.data.file.path &&
             ctl->def->channels[i]->source.data.file.path[0] != '\0')
+ if (is_qemu_guest_agent(ctl->def->channels[i]))
+ virBufferAsprintf(buf, " capability mknod,\n");
             if (vah_add_file_chardev(&buf,
                                      ctl->def->channels[i]->source.data.file.path,
                                      "rw",