mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
dummy: Add default dummy socket
fake-ipmistack uses a default socket at /tmp/.ipmi_dummy. Use it when IPMI_DUMMY_SOCK environment variable is not set.
This commit is contained in:
parent
329ebdff84
commit
3aade24297
@ -180,9 +180,8 @@ ipmi_dummyipmi_open(struct ipmi_intf *intf)
|
||||
|
||||
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
|
||||
if (dummy_sock_path == NULL) {
|
||||
lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
|
||||
intf->opened = 1;
|
||||
return intf->fd;
|
||||
lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Using " IPMI_DUMMY_DEFAULTSOCK);
|
||||
dummy_sock_path = IPMI_DUMMY_DEFAULTSOCK;
|
||||
}
|
||||
|
||||
if (intf->opened == 1) {
|
||||
@ -218,12 +217,7 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
|
||||
static struct ipmi_rs rsp;
|
||||
struct dummy_rq req_dummy;
|
||||
struct dummy_rs rsp_dummy;
|
||||
char *dummy_sock_path;
|
||||
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
|
||||
if (dummy_sock_path == NULL) {
|
||||
lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
|
||||
lprintf(LOG_ERR, "dummy failed on intf check.");
|
||||
return NULL;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef IPMI_DUMMYIPMI_H
|
||||
# define IPMI_DUMMYIPMI_H
|
||||
|
||||
#define IPMI_DUMMY_DEFAULTSOCK "/tmp/.ipmi_dummy"
|
||||
|
||||
struct dummy_rq {
|
||||
struct {
|
||||
uint8_t netfn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user