The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8066
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) ===
From 39eb834ea368507e2f1dbfab7b0ef156ce7bc60d Mon Sep 17 00:00:00 2001 From: Daniel Segal <dlem...@gmail.com> Date: Tue, 20 Oct 2020 20:55:59 +0300 Subject: [PATCH] add new "restarted" event to reboot section of onStop in both lxc and qemu --- lxd/instance/drivers/driver_lxc.go | 2 ++ lxd/instance/drivers/driver_qemu.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go index ac307d6d1e..ccb8945587 100644 --- a/lxd/instance/drivers/driver_lxc.go +++ b/lxd/instance/drivers/driver_lxc.go @@ -2914,6 +2914,8 @@ func (c *lxc) onStop(args map[string]string) error { if target == "reboot" { // Start the container again err = c.Start(false) + c.state.Events.SendLifecycle(c.project, "container-restarted", + fmt.Sprintf("/1.0/containers/%s", c.name), nil) return } diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go index 5aebe9509c..d1436b9263 100644 --- a/lxd/instance/drivers/driver_qemu.go +++ b/lxd/instance/drivers/driver_qemu.go @@ -545,6 +545,8 @@ func (vm *qemu) onStop(target string) error { if target == "reboot" { err = vm.Start(false) + vm.state.Events.SendLifecycle(vm.project, "virtual-machine-restarted", + fmt.Sprintf("/1.0/virtual-machines/%s", vm.name), nil) } else if vm.ephemeral { // Destroy ephemeral virtual machines err = vm.Delete()
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel