From 461a448c15c0fc690d51f65496b0575c8ccd5e59 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 11 Nov 2014 16:42:49 +0100 Subject: [PATCH] feature #3175: Review VirtualMachine method scope --- include/VirtualMachine.h | 98 +++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 97ffc59e9b..5386027026 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -1055,12 +1055,6 @@ public: // ------------------------------------------------------------------------ // Network Leases & Disk Images // ------------------------------------------------------------------------ - /** - * Get all network leases for this Virtual Machine - * @return 0 if success - */ - int get_network_leases(string &error_str); - /** * Releases all network leases taken by this Virtual Machine */ @@ -1076,46 +1070,6 @@ public: */ static int release_network_leases(VectorAttribute const * nic, int vmid); - /** - * Acquires the security groups of this NIC - * - * @param vm_id Virtual Machine oid - * @param nic NIC to get the security groups from - * @param rules Security Group rules will be added at the end of this vector - * @param error_str Returns the error reason, if any - * @return 0 on success, -1 otherwise - */ - static int get_security_groups( - int vm_id, - VectorAttribute const * nic, - vector &rules, - string &error_str); - - /** - * Releases the security groups of this NIC - * - * @param vm_id Virtual Machine oid - * @param nic NIC to release the security groups - * @param error_str Returns the error reason, if any - * @return 0 on success, -1 otherwise - */ - static int release_security_groups( - int vm_id, VectorAttribute const * nic, string &error_str); - - /** - * Returns a set of the security group IDs of this NIC - * @param nic NIC to get the security groups from - * @return a set of security group IDs - */ - static set nic_security_groups(VectorAttribute const * nic); - - /** - * Get all disk images for this Virtual Machine - * @param error_str Returns the error reason, if any - * @return 0 if success - */ - int get_disk_images(string &error_str); - /** * Releases all disk images taken by this Virtual Machine */ @@ -1244,7 +1198,7 @@ public: * @param image_id id of the image being saved * @return IMAGE_ID on success, -1 otherwise */ - int get_disk_hot_info(int& image_id, int& disk_id, string& source); + //int get_disk_hot_info(int& image_id, int& disk_id, string& source); /** * Generate a DISK attribute to be attached to the VM. @@ -1714,6 +1668,56 @@ private: */ void merge_nic_defaults(VectorAttribute* nic); + // ------------------------------------------------------------------------- + // NIC & DISK Management Helpers + // ------------------------------------------------------------------------- + /** + * Get all network leases for this Virtual Machine + * @return 0 if success + */ + int get_network_leases(string &error_str); + + /** + * Acquires the security groups of this NIC + * + * @param vm_id Virtual Machine oid + * @param nic NIC to get the security groups from + * @param rules Security Group rules will be added at the end of this vector + * @param error_str Returns the error reason, if any + * @return 0 on success, -1 otherwise + */ + static int get_security_groups( + int vm_id, + VectorAttribute const * nic, + vector &rules, + string &error_str); + + /** + * Releases the security groups of this NIC + * + * @param vm_id Virtual Machine oid + * @param nic NIC to release the security groups + * @param error_str Returns the error reason, if any + * @return 0 on success, -1 otherwise + */ + static int release_security_groups( + int vm_id, VectorAttribute const * nic, string &error_str); + + /** + * Returns a set of the security group IDs of this NIC + * @param nic NIC to get the security groups from + * @return a set of security group IDs + */ + static set nic_security_groups(VectorAttribute const * nic); + + /** + * Get all disk images for this Virtual Machine + * @param error_str Returns the error reason, if any + * @return 0 if success + */ + int get_disk_images(string &error_str); + + protected: