[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] pre_parse and strcmp

Hey Jan,

I've been digging a bit in the Xen code to figure out how to use the xen.cfg
file as it seemed not to work at all for me.

I finally narrowed it down to the fact that the file, while looking OK:

[root@localhost fedora]# more XEN.CFG 


options="console=vga,com1 com1=115200,8n1,pci,0 loglvl=all noreboot 
guest_loglvl=all iommu=verbose,no-intremap,debug"

kernel=vmlinuz-3.17.0-rc7+ root=/dev/mapper/fedora-root console=hvc0


Was typed up by me on the EFI shell instead of written from Linux.

Which means:
[root@localhost fedora]# file *.cfg
grub.cfg: ASCII text
xen.cfg:  Little-endian UTF-16 Unicode text, with CRLF, CR line terminators

Ends up looking at so (this is right before pre_parse, with a function that 
each character and then if it sees an control it prints _):

 _c_o_m_1_=_1_1_5_2_0_0_,_8_n_1_,_p_c_i_,_0_ _l_o_g_l_v_l_=_a_l_l_ 
_n_o_r_e_b_o_o_t_ _g_u_e_s_t___l_o_g_l_v_l_=_a_l_l_ 

Which pre_parse deals with - it replaces all of those pesky control ones to \0.

That means the 'get_value' is asked to find the 'default' in global, and
while it finds '[' it uses 'strncmp' to see if the 'default' is there.
The value that is there is 'd_e_f_a_u_l_t' (_ replaces the \0
character) which of course does not match with 'default'.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.