"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote: > No need - ADD_ARG() owns the pointer - ADD_ARG_LIT() strdups, hence why > I changed it. Ah. glad you didn't add it ;-) >> BTW, can you outline what you do to test this? >> and I'll see about adding something to exercise the new code. > > There's two parts to testing > > - The ARGV for QEMU - trivially to add more datafiles to qemuxml2argvtest.c I've just done that. > - The monitor interaction > > We have no way to testing monitor interaction, and definitely do not want > to be in the business of running real QEMU instances to test this. What > I think we should do is to create a fake / mock QEMU binary in the tests > directory, which simulates the monitor console. It would output pre-defined > responses for each of the monitor commands we care about. This would let > us unit test each of the individual functions that process monitor commands > in isolation. It actally might be best to just use a self-pipe in the test > case and have a thread to provide the server end of the monitor - that > would let us trivially tell it what response we want to get back to each > command we're about to test. Sounds reasonable. -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list