mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47: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");
|
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
|
||||||
if (dummy_sock_path == NULL) {
|
if (dummy_sock_path == NULL) {
|
||||||
lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
|
lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Using " IPMI_DUMMY_DEFAULTSOCK);
|
||||||
intf->opened = 1;
|
dummy_sock_path = IPMI_DUMMY_DEFAULTSOCK;
|
||||||
return intf->fd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intf->opened == 1) {
|
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;
|
static struct ipmi_rs rsp;
|
||||||
struct dummy_rq req_dummy;
|
struct dummy_rq req_dummy;
|
||||||
struct dummy_rs rsp_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) {
|
if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
|
||||||
lprintf(LOG_ERR, "dummy failed on intf check.");
|
lprintf(LOG_ERR, "dummy failed on intf check.");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef IPMI_DUMMYIPMI_H
|
#ifndef IPMI_DUMMYIPMI_H
|
||||||
# define IPMI_DUMMYIPMI_H
|
# define IPMI_DUMMYIPMI_H
|
||||||
|
|
||||||
|
#define IPMI_DUMMY_DEFAULTSOCK "/tmp/.ipmi_dummy"
|
||||||
|
|
||||||
struct dummy_rq {
|
struct dummy_rq {
|
||||||
struct {
|
struct {
|
||||||
uint8_t netfn;
|
uint8_t netfn;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user