[libvirt] [PATCH 3/3] qemu: XMLToNative: Parse XML as INACTIVE

Jim Fehlig jfehlig at suse.com
Thu Mar 13 22:27:34 UTC 2014


Cole Robinson wrote:
> Right now we are parsing the XML as though it's live, which for example
> will choke on hardcoded XML like:
>
>   <seclabel type='dynamic' model='selinux' relabel='yes'/>
>
> Erroring with:
>
>   $ sudo virsh domxml-to-native qemu-argv f
>   error: XML error: security label is missing
> ---
>  src/qemu/qemu_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index a01739c..89f443f 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -5812,7 +5812,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
>          goto cleanup;
>  
>      def = virDomainDefParseString(xmlData, caps, driver->xmlopt,
> -                                  QEMU_EXPECTED_VIRT_TYPES, 0);
> +                                  QEMU_EXPECTED_VIRT_TYPES,
> +                                  VIR_DOMAIN_XML_INACTIVE);
>   

Seems like this would be a good change for other drivers that support
connectDomainXMLToNative.

Regards,
Jim




More information about the libvir-list mailing list