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

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

 



The magic constant will be used in one more place.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 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
 int
 qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src,
                                      int add,
@@ -7484,7 +7485,7 @@ qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src,

     nlayers += add;

-    if (nlayers > 200) {
+    if (nlayers > QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH) {
         if (diskdst)
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                            _("backing chains more than 200 layers deep are not "
-- 
2.29.2




[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