On 2016/2/26 20:53, Peter Maydell wrote:
On 26 February 2016 at 12:31, Shannon Zhao <zhaoshengl...@huawei.com> wrote:
So how about below patch? I've tested it and it works both for ACPI and
DT. Could you help verify if it works for you? Thanks.

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 15658f4..4d45ea2 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -558,11 +558,20 @@ static void create_rtc(const VirtBoardInfo *vbi,
qemu_irq *pic)
      g_free(nodename);
  }

+#define GPIO_KEY_LATENCY 500 /* 500ms */

I don't understand why a 500ms pulse is better than a short one.

Oh, I just pick a value which seems like a real latency for pressing a button. What's your suggestion?

+static QEMUTimer *gpio_key_timer;

This is state, and must be migrated somehow.

Ah, yes. So is it fine if we move this timer and the notifier virt_system_powerdown_notifier to VirtMachineState?

Thanks,
--
Shannon

Reply via email to