Skip to content

shutdown command changes for none communicator to make wait before sh… #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

anshulsharma-hashicorp
Copy link
Contributor

…utdown

DELETE THIS PART BEFORE SUBMITTING

In order to have a good experience with our community, we recommend that you
read the contributing guidelines for making a PR, and understand the lifecycle
of a Packer Plugin PR:

https://github.com/hashicorp/packer-plugin-qemu/blob/main/.github/CONTRIBUTING.md#opening-an-pull-request


Description

What code changed, and why?

Resolved Issues

If your PR resolves any open issue(s), please indicate them like this so they will be closed when your PR is merged:

Closes #xxx
Closes #xxx

Rollback Plan

If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@anshulsharma-hashicorp anshulsharma-hashicorp requested a review from a team as a code owner June 24, 2025 12:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the shutdown procedure for QEMU when the communicator type is "none" to ensure that a wait period is enforced before proceeding. The changes include updating the test expectations to reflect shutdown failure and revising the shutdown logic to wait for a specified timeout period.

  • Switch from verifying a successful shutdown to expecting a halt when no communicator is used.
  • Introduce a waiting mechanism using a cancel channel and goroutine based on the provided shutdown timeout.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
builder/qemu/step_shutdown_test.go Updated the test assertions to expect ActionHalt on shutdown error
builder/qemu/step_shutdown.go Revised the shutdown logic to support a waiting period for non-communicator types
Comments suppressed due to low confidence (1)

builder/qemu/step_shutdown_test.go:56

  • [nitpick] The test name 'Test_Shutdown_Null_failure' may no longer accurately describe the scenario given the updated expectation of halting for a shutdown failure; consider renaming it to reflect this behavior.
	if action != multistep.ActionHalt {

@jeepingben
Copy link

This appears to be a revert of #192 - There are no diffs between these files and the files from before #192 (https://github.com/hashicorp/packer-plugin-qemu/blob/6b9dbb3a8900f04997ba149d36d1874ce7d50977/builder/qemu/step_shutdown_test.go and https://github.com/hashicorp/packer-plugin-qemu/blob/6b9dbb3a8900f04997ba149d36d1874ce7d50977/builder/qemu/step_shutdown.go) .
I'd suggest using git revert and the generated commit message from that to make the history/blame output easier to follow.

@anshulsharma-hashicorp
Copy link
Contributor Author

This appears to be a revert of #192 - There are no diffs between these files and the files from before #192 (https://github.com/hashicorp/packer-plugin-qemu/blob/6b9dbb3a8900f04997ba149d36d1874ce7d50977/builder/qemu/step_shutdown_test.go and https://github.com/hashicorp/packer-plugin-qemu/blob/6b9dbb3a8900f04997ba149d36d1874ce7d50977/builder/qemu/step_shutdown.go) . I'd suggest using git revert and the generated commit message from that to make the history/blame output easier to follow.

here it is please check https://github.com/hashicorp/packer-plugin-qemu/pull/203/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants