Re: [PATCH 1/4] test_driver: extract image saving code into a separate function

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

 



On Wed, May 29, 2019 at 02:22:56PM +0200, Ilias Stamatis wrote:
> Extracting the code logic for writing a test image to disk from
> testDomainSaveFlags into a separate function, allows us to reuse this
> code in other functions such as testDomainSaveImageDefineXML.
>
> Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
> ---
>  src/test/test_driver.c | 114 +++++++++++++++++++++++++----------------
>  1 file changed, 69 insertions(+), 45 deletions(-)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 2f58a1da95..e71b931790 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -1974,75 +1974,106 @@ testDomainGetTime(virDomainPtr dom ATTRIBUTE_UNUSED,
>
>  #define TEST_SAVE_MAGIC "TestGuestMagic"
>
> -static int
> -testDomainSaveFlags(virDomainPtr domain, const char *path,
> -                    const char *dxml, unsigned int flags)
> +
> +/**
> + * testDomainSaveImageWrite:
> + * @driver: test driver data
> + * @def: domain definition whose XML will be stored in the image
> + * @path: path of the save image
> + *
> + * Returns true on success, else false.
> + */
> +static bool

A minor nitpick, I'd probably prefer 'int' rather than 'bool', feels more
natural for the given function.

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

> +testDomainSaveImageWrite(testDriverPtr driver,
> +                         virDomainDefPtr def,
> +                         const char *path)
>  {

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux