[libvirt] [PATCH 1/3] tests: Don't crash when creating the config object fails
Eric Blake
eblake at redhat.com
Mon Apr 7 22:34:57 UTC 2014
On 04/07/2014 02:02 AM, Guido Günther wrote:
> As observed when building in a chroot and QEMU_USER doesn't exist
> ---
> tests/qemuargv2xmltest.c | 3 +++
> tests/qemuxml2argvtest.c | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
> index 6d7e23e..4cc3749 100644
> --- a/tests/qemuargv2xmltest.c
> +++ b/tests/qemuargv2xmltest.c
> @@ -128,6 +128,9 @@ mymain(void)
> int ret = 0;
>
> driver.config = virQEMUDriverConfigNew(false);
> + if (driver.config == NULL)
> + return EXIT_FAILURE;
> +
Still a failure, but at least better than a crash.
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140407/29d55909/attachment-0001.sig>
More information about the libvir-list
mailing list