[libvirt] [PATCH v2 2/3] capabilities: add baselabel per sec driver/virt type to secmodel

Daniel P. Berrange berrange at redhat.com
Fri Sep 6 11:05:06 UTC 2013


On Thu, Sep 05, 2013 at 01:49:44PM +0200, Giuseppe Scrivano wrote:
>      for (i = 0; sec_managers[i]; i++) {
> +        virCapsHostSecModelPtr sm = &caps->host.secModels[i];
>          doi = virSecurityManagerGetDOI(sec_managers[i]);
>          model = virSecurityManagerGetModel(sec_managers[i]);
> -        if (VIR_STRDUP(caps->host.secModels[i].model, model) < 0 ||
> -            VIR_STRDUP(caps->host.secModels[i].doi, doi) < 0)
> +        label = virSecurityManagerGetBaseLabel(sec_managers[i]);

You need to call this twice, once for kvm and once for qemu
since different labels will be used

> +        if (VIR_STRDUP(sm->model, model) < 0 ||
> +            VIR_STRDUP(sm->doi, doi) < 0 ||
> +            virCapabilitiesHostSecModelAddBaseLabel(sm, "kvm", label) < 0 ||
> +            virCapabilitiesHostSecModelAddBaseLabel(sm, "qemu", label) < 0)

And pass in the different labels here.

Also, you need to update the lxc_driver code to set this metadata since
it uses sVirt too.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list