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

[xen staging] tools/libs/light: Remove unnecessary libxl_list_vm() call



commit fe6cbbf163ec852d823379ab481c62044f92ea75
Author:     Costin Lupu <costin.lupu@xxxxxxxxx>
AuthorDate: Mon Apr 19 16:01:42 2021 +0300
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Apr 22 13:17:33 2021 +0100

    tools/libs/light: Remove unnecessary libxl_list_vm() call
    
    The removed lines were initially added by commit 314e64084d31, but the
    subsequent code which was using the nb_vm variable was later removed by
    commit 2ba368d13893, which makes these lines of code an overlooked
    reminiscence. Moreover, the call becomes very expensive when there is a
    considerable number of VMs (~1000 instances) running on the host.
    
    Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/libs/light/libxl_create.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 0c64268f66..43e9ba9c63 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -578,7 +578,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config 
*d_config,
                        uint32_t *domid, bool soft_reset)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    int ret, rc, nb_vm;
+    int ret, rc;
     const char *dom_type;
     char *uuid_string;
     char *dom_path, *vm_path, *libxl_path;
@@ -586,7 +586,6 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config 
*d_config,
     struct xs_permissions rwperm[1];
     struct xs_permissions noperm[1];
     xs_transaction_t t = 0;
-    libxl_vminfo *vm_list;
 
     /* convenience aliases */
     libxl_domain_create_info *info = &d_config->c_info;
@@ -869,14 +868,6 @@ retry_transaction:
                         ARRAY_SIZE(rwperm));
     }
 
-    vm_list = libxl_list_vm(ctx, &nb_vm);
-    if (!vm_list) {
-        LOGD(ERROR, *domid, "cannot get number of running guests");
-        rc = ERROR_FAIL;
-        goto out;
-    }
-    libxl_vminfo_list_free(vm_list, nb_vm);
-
     xs_write(ctx->xsh, t, GCSPRINTF("%s/uuid", vm_path), uuid_string, 
strlen(uuid_string));
     xs_write(ctx->xsh, t, GCSPRINTF("%s/name", vm_path), info->name, 
strlen(info->name));
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.