Skip to contentSkip to conversation

how to setup a watchdog?

Qemu-devel lejeczek 3 participants 3 messages Jan 18, 2016 – Jan 30, 2016

lore
Share & tools
lore

lejeczek

author
#0 lore raw

apologies I bother devel, but..
I tried to get help on libvirt mailing list but not luck, then qemu, still nothing I hope maybe somebody here?

I'm trying Qemu's watchdog.
My understanding was that hardware (here qemu's watchdog) would take action, eg. cold reboot the system if there is no ping from the OS watchdog, so I thought stopping watchdog service in VM should be a quick test, right?

I have this in the guest:

    <watchdog model='i6300esb' action='reset'>
      <address type='pci' domain='0x0000' bus='0x00' 
slot='0x08' function='0x0'/>
    </watchdog>

and I see /dev/watchdog in my guest. Yet nothing happens, guest(linux) runs uninterrupted. I must be missing something, an expert said it's config problem, is it really is?

many thanks

#1 lore raw

Hi,

Am 18.01.2016 um 12:43 schrieb lejeczek:

Quoted 8 lines

I'm trying Qemu's watchdog.
My understanding was that hardware (here qemu's watchdog) would take action, eg. cold reboot the system if there is no ping from the OS watchdog, so I
thought stopping watchdog service in VM should be a quick test, right?

I have this in the guest:

Quoted 8 lines
    <watchdog model='i6300esb' action='reset'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </watchdog>

and I see /dev/watchdog in my guest. Yet nothing happens, guest(linux) runs uninterrupted.
I must be missing something, an expert said it's config problem, is it really is?

Probably reading linux/Documentation/watchdog/watchdog-api.txt should give you some extra hints.

AFAIK you need to open that device file at least once, either with the sample program included in the Linux source tree, or by another program like (Debian) watchdog or systemd (man 5 systemd-system.conf -> RuntimeWatchdogSec)

cat /dev/watchdog # will print an error about the read(), but the
important thing (opening the file) has been done
dmesg | grep watchdog # will print "i6300esb: Unexpected close, not
stopping watchdog!" to show you that the watchdog is still running and will trigger the reboot, as it has gone through the shutdown protocol, which can be used to disable the watchdog again

After ~1m my test VM rebooted.

Philipp

#2 lore raw
In reply to lejeczek
Quoted 19 lines · lejeczek

apologies I bother devel, but..
I tried to get help on libvirt mailing list but not luck, then qemu, still nothing
I hope maybe somebody here?

I'm trying Qemu's watchdog.
My understanding was that hardware (here qemu's watchdog) would take action, eg. cold reboot the system if there is no ping from the OS watchdog, so I
thought stopping watchdog service in VM should be a quick test, right?

I have this in the guest:

    <watchdog model='i6300esb' action='reset'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
function='0x0'/>
    </watchdog>
Quoted 4 lines

and I see /dev/watchdog in my guest. Yet nothing happens, guest(linux) runs uninterrupted.
I must be missing something, an expert said it's config problem, is it really is?

Sorry for the late response.

If your guest is Linux, you must also run the watchdog daemon in the guest. The watchdog device's timer isn't primed until it is opened and set up by the watchdog daemon.

There is basically no watchdog framework or support in Windows, so you'll have to write the software and driver yourself.

Rich.

Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top