| Summary: | i6300esb expires immediately from second time | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Shaolong Hu <shu> | |
| Component: | qemu-kvm | Assignee: | Richard W.M. Jones <rjones> | |
| Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 6.3 | CC: | juzhang, michen, mkenneth, mzhan, rbalakri, rpacheco, virt-maint, xfu | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1046559 (view as bug list) | Environment: | ||
| Last Closed: | 2016-06-27 15:41:28 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 1046559 | |||
|
Description
Shaolong Hu
2012-01-30 03:50:17 UTC
I'll just note here that 'echo 0 > /dev/watchdog' is not a valid way to use the watchdog API. See this document for a description of the API: http://www.mjmwired.net/kernel/Documentation/watchdog/watchdog-api.txt Using following code to test again, still hit the problem.
"-d" - open watchdog then disable it
"-e" - open watchdog, enable it again (equals to open, optional), wait for reset
"" - without any parameter, open watchdog then keep it from expiration
/*
* Watchdog Driver Test Program
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/watchdog.h>
int fd;
/*
* This function simply sends an IOCTL to the driver, which in turn ticks
* the PC Watchdog card to reset its internal timer so it doesn't trigger
* a computer reset.
*/
static void keep_alive(void)
{
int dummy;
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
printf("Keep it alive\n");
}
static void timeleft(void)
{
int timeleft=0;
ioctl(fd, WDIOC_GETTIMELEFT, &timeleft);
printf("The time left is %d seconds\n", timeleft);
}
/*
* The main program. Run the program with "-d" to disable the card,
* or "-e" to enable the card then wait for reset, without any parameter, it enable the card then keep it alive.
*/
int main(int argc, char *argv[])
{
int flags;
int timeout;
struct watchdog_info ident;
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -1) {
fprintf(stderr, "Watchdog device not enabled.\n");
fflush(stderr);
exit(-1);
}
ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
printf("The timeout is %d seconds\n", timeout);
timeout=10;
ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
printf("The timeout is set to %d seconds\n", timeout);
ioctl(fd, WDIOC_GETSUPPORT, &ident);
printf("The driver is %s \n", ident.identity);
if (argc > 1) {
if (!strncasecmp(argv[1], "-d", 2)) {
flags = WDIOS_DISABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card disabled.\n");
fflush(stderr);
exit(0);
} else if (!strncasecmp(argv[1], "-e", 2)) {
flags = WDIOS_ENABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card enabled.\n");
fflush(stderr);
while(1) {
timeleft();
sleep(1);
}
} else {
fprintf(stderr, "-d to disable, -e to enable.\n");
fprintf(stderr, "run by itself to tick the card.\n");
fflush(stderr);
exit(0);
}
} else {
fprintf(stderr, "Watchdog Ticking Away!\n");
fflush(stderr);
}
while(1) {
keep_alive();
sleep(1);
}
}
Have to be note here, this time it may expire immediately from third or forth time, no regular pattern. if watchdog action is reset, after guest reboot, everything works fine, seems action pause and debug is virtual machine unique action, so fix this or not would be a judgemental call, i am fine with moving this to 6.4 or closing as won't fix. Since RHEL 6.3 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. Closing this as WONTFIX, although I believe that this is probably working upstream and just needs to be retested. |