return LB_STATUS_SUCCESS;
}
+ if (package_is_fault(inst->info)) {
+ ErrPrint("Package is faulted(%s), Delete it\n", inst->id);
+ inst->requested_state = INST_DESTROYED;
+ }
+
switch (inst->state) {
case INST_ACTIVATED:
case INST_REQUEST_TO_REACTIVATE:
DbgPrint("Req. to DESTROYED (%s)\n", package_name(inst->info));
instance_state_reset(inst);
instance_destroy(inst, INSTANCE_DESTROY_DEFAULT);
- ret = 1;
break;
default:
break;
const char *pkgname;
const char *id;
struct inst_info *inst;
+ const struct pkg_info *pkg;
int ret;
client = client_find_by_rpc_handle(handle);
* Trust the package name which are sent by the client.
* The package has to be a livebox package name.
*/
- ret = validate_request(pkgname, id, &inst, NULL);
+ ret = validate_request(pkgname, id, &inst, &pkg);
if (ret != LB_STATUS_SUCCESS) {
goto out;
}
+ if (package_is_fault(pkg)) {
+ DbgPrint("Faulted package. will be deleted soon: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
if (instance_client(inst) != client) {
if (instance_has_client(inst, client)) {
struct deleted_item *item;