Bug#923873: Please increase MAX_CONFIG_LINE, otherwise ipmi_sim is not practically useable

2019-03-14 Thread Noël Köthe
Salut Thomas,

Am Donnerstag, den 14.03.2019, 00:18 +0100 schrieb Thomas Goirand:
> In #924465, the release team has pre-approved this patch. If you do not
> react to this bug, I will NMU it to the delayed queue (5 days) tomorrow.

Thanks for your work. Just go ahead and upload without delay.

Thanks again.

Regards

Noël


signature.asc
Description: This is a digitally signed message part


Bug#923873: Please increase MAX_CONFIG_LINE, otherwise ipmi_sim is not practically useable

2019-03-13 Thread Thomas Goirand
In #924465, the release team has pre-approved this patch. If you do not
react to this bug, I will NMU it to the delayed queue (5 days) tomorrow.

Cheers,

Thomas Goirand (zigo)



Bug#923873: Please increase MAX_CONFIG_LINE, otherwise ipmi_sim is not practically useable

2019-03-06 Thread Thomas Goirand
Package: openipmi
Version: 2.0.25-2
Severity: important
Tags: patch

Dear maintainer,

I've been using ipmi_sim, shipped by OpenIPMI, to simulate IPMI on my VMs. In
such configuration, ipmi_sim is started this way:

/usr/bin/ipmi_sim -n -c /path-to/ipmi-sim/vm-config.conf \
-f /path-to/ipmisim1.emu

ipmisim1.emu, for me, has this content:

mc_setbmc 0x20
mc_add 0x20 0 no-device-sdrs 0x23 9 8 0x9f 0x1291 0xf02 persist_sdr
sel_enable 0x20 1000 0x0a
sensor_add 0x20 0 1 0x01 0x01
sensor_set_value 0x20 0 1 0x60 0
sensor_set_threshold 0x20 0 1 settable 111000 0xa0 0x90 0x70 00 00 00
sensor_set_event_support 0x20 0 1 enable scanning per-state \
0001100 0001100 \
0001100 0001100
mc_enable 0x20


My virtual machine needs lots of options, like 3 hard drives, 4 ethernet, etc.
(I'm virtualizing an OpenStack deployment for the PoC my work, so I have a
working OpenStack platform on a single machine). In such situation, the
virtual machine command line is quite big: it's longer than MAX_CONFIG_LINE,
which is set in lanserv/OpenIPMI/serv.h.

Here's an example vm-config.conf:

name "ipmisim1"
set_working_mc 0x20
  startlan 1
addr 0.0.0.0 9008
priv_limit admin
allowed_auths_callback none md2 md5 straight
allowed_auths_user none md2 md5 straight
allowed_auths_operator none md2 md5 straight
allowed_auths_admin none md2 md5 straight
guid a123456789abcdefa123456789abcdef
  endlan
  serial 15 localhost 9108 codec VM
  startcmd "qemu-system-x86_64 -enable-kvm -m size=7G -smp cpus=4 -cpu 
host,+vmx,+spec-ctrl -vnc :8 -pidfile /var/run/oci-poc/sn-7.pid -daemonize 
-drive 
if=virtio,file=/var/lib/openstack-cluster-installer-poc/runtime/slave-node-7-vda.qcow2,index=0,media=disk,format=qcow2
 -drive 
if=virtio,file=/var/lib/openstack-cluster-installer-poc/runtime/slave-node-7-vdb.qcow2,index=1,media=disk,format=qcow2
 -drive 
if=virtio,file=/var/lib/openstack-cluster-installer-poc/runtime/slave-node-7-vdc.qcow2,index=2,media=disk,format=qcow2
 -boot n -device e1000,netdev=net0,mac=08:00:27:06:CC:C7 -netdev 
tap,id=net0,ifname=ocivm7eth0 -device e1000,netdev=net1,mac=08:00:27:06:DC:C7 
-netdev tap,id=net1,ifname=ocivm7eth1 -device 
e1000,netdev=net2,mac=08:00:27:06:EC:C7 -netdev tap,id=net2,ifname=ocivm7eth2 
-device e1000,netdev=net3,mac=08:00:27:06:FC:C7 -netdev 
tap,id=net3,ifname=ocivm7eth3 -smbios type=3,manufacturer=OCI,serial=C7 
-chardev socket,id=ipmi0,host=localhost,port=9108,reconnect=10 -device 
ipmi-bmc-extern,chardev=ipmi0,id=bmc0 -device isa-ipmi-kcs,bmc=bmc0,irq=5"
  startnow true
  user 1 true  """test" user 10   none md2 md5 straight
  user 2 true  "ipmiusr" "test" admin10   none md2 md5 straight

As you can see, startcmd's content is a WAY longer than 1024 chars for me. As
a result, ipmi_sim just exits, as the line is truncated in its memory.

After some debug, it was easy to find the solution:

--- openipmi-2.0.25.orig/lanserv/OpenIPMI/serv.h
+++ openipmi-2.0.25/lanserv/OpenIPMI/serv.h
@@ -474,7 +474,7 @@ int chan_init(channel_t *chan);
 void sysinfo_init(sys_data_t *sys);
 
 
-#define MAX_CONFIG_LINE 1024
+#define MAX_CONFIG_LINE 10240 
 
 const char *mystrtok(char *str, const char *delim, char **next);


Please do this in the package, and please, get this patch into Buster.

If you don't have time, please allow me to NMU this change.

Cheers,

Thomas Goirand (zigo)