[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] conf: Fix parsing of seclabels without model

On 08/30/2012 02:12 PM, Jiri Denemark wrote:
On Thu, Aug 30, 2012 at 13:19:31 -0300, Marcelo Cerri wrote:
With this patch libvirt tries to assign a model to seclabels when model
is missing. Libvirt will look up at host's capabilities and assign a
model in order to each seclabel that doesn't have a model assigned.

This patch fixes:

1. The problem with existing guests that have a seclabel defined in its XML.
2. A XML parse error when a guest is restored.

Signed-off-by: Marcelo Cerri <mhcerri linux vnet ibm com>
  src/conf/domain_conf.c | 56 ++++++++++++++++++++++++++------------------------
  1 file changed, 29 insertions(+), 27 deletions(-)

I think this is trying to fix the issue at a wrong place. It's not that XML
generated by older libvirtd is not correctly parsed by current libvirtd. The
problem is that *current* libvirtd creates an XML that it cannot parse back.
Thus we should rather fix the code that formats the XML.

I don't agree. If you save a domain using the latest libvirt and using an earlier version (I used v0.9.10) and then check the XML included in each save file, you'll see something similar to this for the latest libvirt version:

  <seclabel type='dynamic' model='selinux' relabel='yes'>

  <seclabel type='dynamic' model='dac' relabel='yes'>

And this for v0.9.10:

  <seclabel type='dynamic' model='selinux' relabel='yes'>

The biggest difference is the seclabel for DAC.

On that front, I'm concerned about migration compatibility of this new
security driver code. If we just blindly emit <seclabel type='dynamic'
model='dac' relabel='yes'> element into the XML, I'm pretty sure an older
libvirtd will complain about it even though the element was not used to do
anything special that would be done anyway (that is, if labels are the default

Not sure if I understood you point. I can't find a scenario that an older libvirtd will try to parse a XML generated by an earlier libvirtd version. I think that this will only happen if you save a guest, downgrade libvirt and then restore the guest.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]