~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to node/handlers_default.c

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        /* try stopping the KVM domain */
148
148
        conn = check_hypervisor_conn();
149
149
        if (conn) {
150
 
                virDomainPtr dom = virDomainLookupByName(*conn, instanceId);
 
150
                sem_p(hyp_sem);
 
151
                virDomainPtr dom = virDomainLookupByName(*conn, instanceId);
 
152
                sem_v(hyp_sem);
151
153
                if (dom) {
152
154
                        /* also protect 'destroy' commands, just in case */
153
155
                        sem_p (hyp_sem);
156
158
                        if (err==0) {
157
159
                                logprintfl (EUCAINFO, "destroyed domain for instance %s\n", instanceId);
158
160
                        }
 
161
                        sem_p(hyp_sem);
159
162
                        virDomainFree(dom); /* necessary? */
 
163
                        sem_v(hyp_sem);
160
164
                } else {
161
165
                        if (instance->state != BOOTING)
162
166
                                logprintfl (EUCAWARN, "warning: domain %s to be terminated not running on hypervisor\n", instanceId);
164
168
        } 
165
169
 
166
170
        /* change the state and let the monitoring_thread clean up state */
167
 
        change_state (instance, SHUTOFF);
 
171
    sem_p (inst_sem);
 
172
    if (instance->state==BOOTING) {
 
173
        change_state (instance, CANCELED);
 
174
    } else {
 
175
        change_state (instance, SHUTOFF);
 
176
    }
 
177
    sem_v (inst_sem);
168
178
        *previousState = instance->stateCode;
169
179
        *shutdownState = instance->stateCode;
170
180
 
318
328
        } else {
319
329
                ret = 0;
320
330
                logprintfl (EUCAINFO, "StartNetwork(): SUCCESS return from vnetStartNetwork %d\n", rc);
 
331
                if (brname) free(brname);
321
332
        }
322
333
        logprintfl (EUCAINFO, "StartNetwork(): done\n");
323
334