[PATCH 01/39] qemuDomainStorageSourceValidateDepth: Define chain depth as macro

Ján Tomko jtomko at redhat.com
Wed Apr 7 15:43:21 UTC 2021


On a Thursday in 2021, Peter Krempa wrote:
>The magic constant will be used in one more place.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_domain.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
>index 76e8903dbc..f818fce271 100644
>--- a/src/qemu/qemu_domain.c
>+++ b/src/qemu/qemu_domain.c
>@@ -7471,6 +7471,7 @@ qemuDomainStorageAlias(const char *device, int depth)
>  *
>  * Returns 0 on success and -1 if the chain is too deep. Error is reported.
>  */
>+#define QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH 200

This looks out of place, as if the comment was describing this constant
and not the function.

Consider moving it above the comment (since the comment still references
200 by number)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano


> int
> qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src,
>                                      int add,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210407/025a70b8/attachment-0001.sig>


More information about the libvir-list mailing list