On Sun, Nov 14, 2010 at 08:52:37PM +0200, Gleb Natapov wrote: > > > + > > > + len = strlen(bootpath); > > > + list = qemu_realloc(list, total + len + 1); > > > + list[total++] = len; > > > + memcpy(&list[total], bootpath, len); > > > + total += len; > > > + c++; > > > + qemu_free(bootpath); > > > > Man, is this tricky. > > > Nah, not at all. I think it will be easier if we don't try to do this in one pass. 1. pass: calculate total length and # of devices 2. allocate 2. pass fill in > -- > Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html