qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Qemu Developers <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH v2 1/7] tests/libqos/fw_cfg: Document io_fw_cfg_init to drop io_fw_cfg_uninit
Date: Tue, 8 Oct 2019 18:18:26 +0800	[thread overview]
Message-ID: <CAKXe6S+LB-YQ7AsypDbKvSAzCo_omQq4jJiBLtp6xci8c8w7mw@mail.gmail.com> (raw)
In-Reply-To: <20191007151905.32766-2-philmd@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

Philippe Mathieu-Daudé <philmd@redhat.com> 于2019年10月7日周一 下午11:19写道:

> Document io_fw_cfg_init() return value must be released
> with g_free(). Directly calling g_free() we don't really
> need io_fw_cfg_uninit(): remove it.
>
> This partly reverts commit 0729d833d6d6:
> "tests/libqos: Add io_fw_cfg_uninit()"
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>

Reviewed-by: Li Qiang <liq3ea@gmail.com>



> ---
>  tests/libqos/fw_cfg.c |  5 -----
>  tests/libqos/fw_cfg.h | 11 +++++++++--
>  2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c
> index 1f46258f96..37c3f2cf4d 100644
> --- a/tests/libqos/fw_cfg.c
> +++ b/tests/libqos/fw_cfg.c
> @@ -157,8 +157,3 @@ QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base)
>
>      return fw_cfg;
>  }
> -
> -void io_fw_cfg_uninit(QFWCFG *fw_cfg)
> -{
> -    g_free(fw_cfg);
> -}
> diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h
> index 13325cc4ff..15604040bd 100644
> --- a/tests/libqos/fw_cfg.h
> +++ b/tests/libqos/fw_cfg.h
> @@ -36,8 +36,15 @@ size_t qfw_cfg_get_file(QFWCFG *fw_cfg, const char
> *filename,
>
>  QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base);
>  void mm_fw_cfg_uninit(QFWCFG *fw_cfg);
> +/**
> + * io_fw_cfg_init():
> + * @qts: The #QTestState that will be referred to by the QFWCFG object.
> + * @base: The I/O address of the fw_cfg device in the guest.
> + *
> + * Returns a newly allocated QFWCFG object which must be released
> + * with a call to g_free() when no longer required.
> + */
>  QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base);
> -void io_fw_cfg_uninit(QFWCFG *fw_cfg);
>
>  static inline QFWCFG *pc_fw_cfg_init(QTestState *qts)
>  {
> @@ -46,7 +53,7 @@ static inline QFWCFG *pc_fw_cfg_init(QTestState *qts)
>
>  static inline void pc_fw_cfg_uninit(QFWCFG *fw_cfg)
>  {
> -    io_fw_cfg_uninit(fw_cfg);
> +    g_free(fw_cfg);
>  }
>
>  #endif
> --
> 2.21.0
>
>

[-- Attachment #2: Type: text/html, Size: 2896 bytes --]

  reply	other threads:[~2019-10-08 10:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 15:18 [PATCH v2 0/7] fw_cfg: Run tests on big-endian Philippe Mathieu-Daudé
2019-10-07 15:18 ` [PATCH v2 1/7] tests/libqos/fw_cfg: Document io_fw_cfg_init to drop io_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-08 10:18   ` Li Qiang [this message]
2019-10-07 15:19 ` [PATCH v2 2/7] tests/libqos/fw_cfg: Document mm_fw_cfg_init to drop mm_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-08 10:20   ` Li Qiang
2019-10-07 15:19 ` [PATCH v2 3/7] tests/libqos/fw_cfg: Document pc_fw_cfg_init to drop pc_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-08 10:27   ` Li Qiang
2019-10-07 15:19 ` [PATCH v2 4/7] tests/fw_cfg: Let the tests use a context Philippe Mathieu-Daudé
2019-10-08 14:12   ` Li Qiang
2019-10-07 15:19 ` [PATCH v2 5/7] tests/libqos/fw_cfg: Pass QTestState as argument Philippe Mathieu-Daudé
2019-10-08 14:44   ` Li Qiang
2019-10-07 15:19 ` [PATCH v2 6/7] tests/fw_cfg: Declare one QFWCFG for all tests Philippe Mathieu-Daudé
2019-10-08 14:56   ` Li Qiang
2019-10-07 15:19 ` [PATCH v2 7/7] tests/fw_cfg: Run the tests on big-endian targets Philippe Mathieu-Daudé
2019-10-07 18:33   ` Laszlo Ersek
2019-10-08 15:04   ` Li Qiang
2019-10-08 15:14     ` Philippe Mathieu-Daudé
2019-10-08 15:56       ` Li Qiang
2019-10-08 20:27     ` Laszlo Ersek
2019-10-08 20:35       ` Peter Maydell
2019-10-09  0:35       ` Li Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKXe6S+LB-YQ7AsypDbKvSAzCo_omQq4jJiBLtp6xci8c8w7mw@mail.gmail.com \
    --to=liq3ea@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).