qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 5/6] tests/libqtest: Move global_test wrapper


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 5/6] tests/libqtest: Move global_test wrapper function into a separate header
Date: Wed, 4 Sep 2019 19:51:30 +0100
User-agent: Mutt/1.12.1 (2019-06-15)

On Wed, Sep 04, 2019 at 03:00:46PM +0200, Thomas Huth wrote:
> diff --git a/tests/libqtest-single.h b/tests/libqtest-single.h
> new file mode 100644
> index 0000000000..49259558a5
> --- /dev/null
> +++ b/tests/libqtest-single.h
> @@ -0,0 +1,311 @@
> +/*
> + * QTest - wrappers for test with single QEMU instances
> + *
> + * Copyright IBM, Corp. 2012
> + * Copyright Red Hat, Inc. 2012
> + * Copyright SUSE LINUX Products GmbH 2013
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef LIBQTEST_SINGLE_H
> +#define LIBQTEST_SINGLE_H
> +
> +/**
> + * qtest_start:
> + * @args: other arguments to pass to QEMU
> + *
> + * Start QEMU and assign the resulting #QTestState to a global variable.
> + * The global variable is used by "shortcut" functions documented below.
> + *
> + * Returns: #QTestState instance.
> + */
> +static inline QTestState *qtest_start(const char *args)
> +{
> +    global_qtest = qtest_init(args);

Where are global_qtest and qtest_init() declared?  I would expect
compilation to fail if a .c file included just "libqtest-single.h".
Missing #include?

If this header is not supposed to be included by .c files, please
include at least a comment or use a magic #define + #ifdef to prevent
inclusion.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]