Changeset 8353
- Timestamp:
- 06/02/10 11:35:38 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Migrate-Tools/src/client/sysint/mgmt-migrate.sm
r8346 r8353 22 22 extern job_context_id pint_client_sm_context; 23 23 24 static int mgmt_migrate_comp_fn( 25 void *v_p, struct PVFS_server_resp *resp, int i); 24 26 25 27 %% … … 29 31 state init{ 30 32 run mgmt_migrate_init; 31 default => validate_inputs 32 } 33 34 //Validate inputs- filename, destination server 35 state validate_inputs{ 36 run mgmt_migrate_validate_inputs; 37 success => migrate_setup_msgpair; 38 default => cleanup; 39 } 40 41 //Setup a PVFS_mgmt_migrate request 33 default => migrate_setup_msgpair; 34 } 42 35 43 36 state migrate_setup_msgpair{ … … 60 53 61 54 %% 55 62 56 63 57 PVFS_error PVFS_imgmt_migrate( … … 71 65 PINT_smcb *smcb = NULL; 72 66 PINT_client_sm *sm_p = NULL; 67 68 gossip_debug(GOSSIP_CLIENT_DEBUG, 69 "PVFS_imgmt_migrate entered\n"); 70 71 72 73 if ((ref.handle == PVFS_HANDLE_NULL) || 74 (ref.fs_id == PVFS_FS_ID_NULL)) 75 { 76 gossip_err("invalid (NULL) required argument\n"); 77 return ret; 78 } 79 73 80 74 81 PINT_smcb_alloc(&smcb, PVFS_MGMT_MIGRATE, … … 80 87 return -PVFS_ENOMEM; 81 88 } 82 83 89 84 90 sm_p = PINT_sm_frame(smcb, PINT_CURRENT_FRAME); 85 91 PINT_init_msgarray_params(sm_p, ref.fs_id); 86 92 PINT_init_sysint_credentials(sm->cred_p, credentials); 93 87 94 /* fill in stuff in the union */ 95 88 96 sm_p->error_code = 0; 89 97 sm_p->object_ref = ref; … … 106 114 107 115 ret = PVFS_imgmt_migrate(credentials, &op_id, hints) 108 109 110 116 if(ret) 117 { 118 PVFS_perror_gossip("PVFS_imgmt_migrate call", ret); 119 error = ret; 120 } 121 else 122 { 123 ret = PVFS_mgmt_wait(op_id, "migrate", &error); 124 if (ret) 125 { 126 PVFS_perror_gossip("PVFS_mgmt_wait call", ret); 127 error = ret; 128 } 129 } 111 130 112 131 … … 115 134 } 116 135 /************************************************************************/ 136 137 static int mgmt_migrate_comp_fn( 138 void *v_p, struct PVFS_server_resp *resp, int i) 139 { 140 /*need to know what this does */ 141 gossip_debug(GOSSIP_CLIENT_DEBUG, "mgmt_migrate_comp_fn\n"); 142 143 144 return resp->status; 145 } 146 117 147 118 148 static PINT_sm_action mgmt_migrate_init( … … 124 154 } 125 155 126 static PINT_sm_action mgmt_migrate_validate_inputs(127 struct PINT_smcb *smcb, job_status_s js_p)128 {129 PVFS_error ret = PVFS_sys_lookup(fs_id, name //needs to be looked at and fixed up130 credentials, PVFS_sysresp_lookup,131 int32_t follow_link, hints);132 133 134 }135 136 156 static PINT_sm_action mgmt_migrate_setup_msgpair( 137 157 struct PINT_smcb *smcb, job_status_s js_p) 138 158 { 159 gossip_debug(GOSSIP_CLIENT_DEBUG, "mgmt_migrate_setup_msgpair called\n"); 160 139 161 struct PINT_client_sm *sm_p = PINT_sm_frame(smbc, PINT_FRAME_CURRET); 140 162 int ret = -PVFS_EINVAL; … … 154 176 155 177 /*stuff here as well */ 156 178 179 msg_p->comp_fn = mgmt_migrate_comp_fn; 180 157 181 ret = PINT_cached_config_map_to_server( 158 182 &msg_p->svr_addr, msg_p->handle, msg_p->fs_id); … … 168 192 return SM_ACTION_COMPLETE; 169 193 } 194 195 196 static PINT_sm_action mgmt_migrate_cleanup( 197 struct PINT_smcb *smcb, job_status_s js_p) 198 { 199 stuct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_CURRENT_FRAME); 200 201 gossip_debug(GOSSIP_CLIENT_DEBUG, 202 "mgmt_migrate state: mgmt_migrate_cleanup\n"); 203 204 sm_p->error_code = js_p->error_code; 205 206 /*do something involving cache or free allocated stuff*/ 207 208 PINT_SET_OP_COMPLETE; 209 return SM_ACTION_TERMINATE; 210 } 211 212 /* 213 * Local variables: 214 * mode: c 215 * c-indent-level: 4 216 * c-basic-offset: 4 217 * End: 218 * 219 * vim: ft=c ts=8 sts=4 sw=4 expandtab 220 */
