hypervisor: waitSandbox is waitVM

renaming...

Signed-off-by: Manohar Castelino <mcastelino@apple.com>
This commit is contained in:
Manohar Castelino 2021-09-20 17:09:13 -07:00 committed by Eric Ernst
parent a6385c8fde
commit fd24a695bf
3 changed files with 9 additions and 8 deletions

View File

@ -459,7 +459,7 @@ func (a *Acrn) startSandbox(ctx context.Context, timeoutSecs int) error {
}
a.state.PID = PID
if err = a.waitSandbox(ctx, timeoutSecs); err != nil {
if err = a.waitVM(ctx, timeoutSecs); err != nil {
a.Logger().WithField("acrn wait failed:", err).Debug()
return err
}
@ -467,9 +467,9 @@ func (a *Acrn) startSandbox(ctx context.Context, timeoutSecs int) error {
return nil
}
// waitSandbox will wait for the Sandbox's VM to be up and running.
func (a *Acrn) waitSandbox(ctx context.Context, timeoutSecs int) error {
span, _ := katatrace.Trace(ctx, a.Logger(), "waitSandbox", acrnTracingTags, map[string]string{"sandbox_id": a.id})
// waitVM will wait for the Sandbox's VM to be up and running.
func (a *Acrn) waitVM(ctx context.Context, timeoutSecs int) error {
span, _ := katatrace.Trace(ctx, a.Logger(), "waitVM", acrnTracingTags, map[string]string{"sandbox_id": a.id})
defer span.End()
if timeoutSecs < 0 {

View File

@ -899,6 +899,7 @@ type hypervisor interface {
setConfig(config *HypervisorConfig) error
createSandbox(ctx context.Context, id string, networkNS NetworkNamespace, hypervisorConfig *HypervisorConfig) error
startSandbox(ctx context.Context, timeout int) error
// If wait is set, don't actively stop the sandbox:
// just perform cleanup.
StopVM(ctx context.Context, waitOnly bool) error

View File

@ -851,7 +851,7 @@ func (q *qemu) startSandbox(ctx context.Context, timeout int) error {
return fmt.Errorf("failed to launch qemu: %s, error messages from qemu log: %s", err, strErr)
}
err = q.waitSandbox(ctx, timeout)
err = q.waitVM(ctx, timeout)
if err != nil {
return err
}
@ -888,9 +888,9 @@ func (q *qemu) bootFromTemplate() error {
return q.waitMigration()
}
// waitSandbox will wait for the Sandbox's VM to be up and running.
func (q *qemu) waitSandbox(ctx context.Context, timeout int) error {
span, _ := katatrace.Trace(ctx, q.Logger(), "waitSandbox", qemuTracingTags, map[string]string{"sandbox_id": q.id})
// waitVM will wait for the Sandbox's VM to be up and running.
func (q *qemu) waitVM(ctx context.Context, timeout int) error {
span, _ := katatrace.Trace(ctx, q.Logger(), "waitVM", qemuTracingTags, map[string]string{"sandbox_id": q.id})
defer span.End()
if timeout < 0 {