]> xenbits.xensource.com Git - libvirt.git/commit
testCompareXMLToArgvValidateSchema: Construct @vm from scratch
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 21 May 2020 18:55:01 +0000 (20:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 May 2020 09:17:17 +0000 (11:17 +0200)
commit69daa2ea8ac166f23ea62fa51c43e24c9adc0128
treed05d26932e0eb467db620c04e08f952e01816750
parentd265171b5784657dccb5215d28a72b213553db0a
testCompareXMLToArgvValidateSchema: Construct @vm from scratch

Currently, the @vm is passed in as an argument and
testCompareXMLToArgvCreateArgs() is called over it which means
under the hood qemuProcessPrepareDomain() is called. But at the
point where ValidateSchema() is called, the domain object is
already 'prepared', i.e. all device aliases are assigned and so
on. But our code is not prepared to 'prepare' a domain twice - it
simply overwrites all the pointers leading to a memory leak.

Fortunately, this is only the problem of this test.

Resolve this by constructing the domain object from scratch.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemuxml2argvtest.c