Skip to content

Add v2 computecore handle for live migration event callbacks#11

Closed
Kavya-Bharadwaj wants to merge 1 commit intorawahars:live_migration_poc_4from
Kavya-Bharadwaj:live_migration_poc_4_v2_callback_lm
Closed

Add v2 computecore handle for live migration event callbacks#11
Kavya-Bharadwaj wants to merge 1 commit intorawahars:live_migration_poc_4from
Kavya-Bharadwaj:live_migration_poc_4_v2_callback_lm

Conversation

@Kavya-Bharadwaj
Copy link
Copy Markdown
Collaborator

Add v2 computecore handle for live migration event callbacks

Open a separate v2 handle (computecore.dll) alongside the existing v1 handle
(vmcompute.dll) and register HcsSetComputeSystemCallback with
HcsEventOptionEnableLiveMigrationEvents to receive LM notifications without
replacing the legacy v1 callback used for standard system operations.

Changes:

  • computecore.go: Add explicit HCS_EVENT_TYPE values, String(), and
    HcsEventOptionEnableLiveMigrationEvents flag
  • callbackV2.go: New file - v2 callback handler with diagnostic logging
    to C:\Temp\hcs_lm_events.json
  • system.go: Add v2Handle, OpenV2Handle, registerCallbackV2,
    unregisterCallbackV2, closeV2; route LM APIs through v2Handle
  • vm.go: Call OpenV2Handle after system create/open

Open a second HCS compute system handle (via HcsOpenComputeSystem) and
register a v2 callback (via HcsSetComputeSystemCallback) dedicated to
receiving GroupLiveMigration event notifications. This avoids conflicting
with the legacy v1 callback registered on the primary handle.

Changes:
- Add HcsEventTypeGroupLiveMigration and related event type constants
  with explicit hex values, and HcsEventOptionEnableLiveMigrationEvents
- Add callbackV2.go: v2 callback watcher that dispatches live migration
  events to a buffered channel
- Add OpenV2Handle/closeV2/registerCallbackV2/unregisterCallbackV2 on
  System for lifecycle management of the v2 handle
- Expose LMNotificationChannel() for consumers to receive LM events
- Switch live migration API calls to use the v2 handle
- Wire up OpenV2Handle in vm2.NewVM at VM creation time
@Kavya-Bharadwaj Kavya-Bharadwaj force-pushed the live_migration_poc_4_v2_callback_lm branch from 8788d36 to c0bc5f4 Compare April 6, 2026 04:37
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.

1 participant