[libvirt] [PATCH 1/4] test_driver: extract image saving code into a separate function
Erik Skultety
eskultet at redhat.com
Mon Jun 3 08:01:03 UTC 2019
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 at gmail.com>
> ---
> 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 at redhat.com>
> +testDomainSaveImageWrite(testDriverPtr driver,
> + virDomainDefPtr def,
> + const char *path)
> {
More information about the libvir-list
mailing list