[PATCH] Add domain ref checking to isMigratable

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1205340424 25200 # Node ID 42b808d88849cbc642af67b2769b120624f66a42 # Parent b739fc9b13320e07a39f3932396c8411c2d4ad75 Add domain ref checking to isMigratable Tested by adding an invalid key to the ComputerSystem REF, which would pass before. It now fails and points out the offending key, as expected. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r b739fc9b1332 -r 42b808d88849 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Mar 11 13:28:04 2008 -0700 +++ b/src/Virt_VSMigrationService.c Wed Mar 12 09:47:04 2008 -0700 @@ -38,6 +38,7 @@ #include "Virt_VSMigrationService.h" #include "Virt_HostSystem.h" +#include "Virt_ComputerSystem.h" #include "Virt_VSMigrationSettingData.h" #define CIM_JOBSTATE_STARTING 3 @@ -276,6 +277,7 @@ static CMPIStatus vs_migratable(const CM CMPIBoolean isMigratable = 0; uint16_t type; virDomainPtr dom = NULL; + CMPIInstance *dominst; s = get_msd_values(ref, destination, argsin, &type, &dconn); if (s.rc != CMPI_RC_OK) @@ -296,6 +298,10 @@ static CMPIStatus vs_migratable(const CM "No such domain"); goto out; } + + s = get_domain_by_ref(_BROKER, ref, &dominst); + if (s.rc != CMPI_RC_OK) + goto out; s = check_caps(conn, dconn); if (s.rc != CMPI_RC_OK)

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1205340424 25200 # Node ID 42b808d88849cbc642af67b2769b120624f66a42 # Parent b739fc9b13320e07a39f3932396c8411c2d4ad75 Add domain ref checking to isMigratable
Tested by adding an invalid key to the ComputerSystem REF, which would pass before. It now fails and points out the offending key, as expected.
Signed-off-by: Dan Smith <danms@us.ibm.com>
diff -r b739fc9b1332 -r 42b808d88849 src/Virt_VSMigrationService.c
Virt_VSMigrationService doesn't link to Virt_ComputerSystem, so I get a symbol error when I tried to test this. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

KR> Virt_VSMigrationService doesn't link to Virt_ComputerSystem, so I KR> get a symbol error when I tried to test this. You're right, it doesn't. Interestingly, I had the migration indication subscribed, which had the migration provider loaded, hence no symbol error. Replacement on the way. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (2)
-
Dan Smith
-
Kaitlin Rupert