[libvirt] [PATCH v2 6/7] Support for faking emulator in qemuxml2argv tests

Eric Blake eblake at redhat.com
Tue Apr 20 17:42:22 UTC 2010


On 04/20/2010 06:42 AM, Jiri Denemark wrote:
> The problem is RelaxNG schema for domain XML only allows for absolute
> path be used within <emulator/>. To workaround it, an extra '/' must be
> add at the beginning of the path. That is, instead of "./qemu.sh" or
> "../emulator/qemu.sh" one would use "/./qemu.sh" or
> "/../emulator/qemu.sh". The extra slash is removed before further
> processing. I don't like this workaround, it's very ugly but it's the
> best option I was able to come up with. Relaxing domain XML schema is
> not an option IMO.

Yeah, it's a hack, but I think you have documented enough justification
for it.

> +    if (vmdef->emulator && STRPREFIX(vmdef->emulator, "/.")) {
> +        if (!(emulator = strdup(vmdef->emulator + 1)))
> +            goto fail;
> +        free(vmdef->emulator);
> +        vmdef->emulator = NULL;
> +        if (virAsprintf(&vmdef->emulator, "%s/qemuxml2argvdata/%s",
> +                        abs_srcdir, emulator) < 0)
> +            goto fail;
> +    }

Do we want to reject the case if vmdef->emulator exists, but does not
start with "/."?

This is the first patch where I'm not sure if it should be applied if we
decide that patch 7 should be TCK-only.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100420/5480db79/attachment-0001.sig>


More information about the libvir-list mailing list