* src/conf.c: documentation cleanups from Jim Meyering

* tests/conftest.c: Use fwrite, not printf, since the
  result buffer is not NUL-terminatedi, from Jim Meyering.
* tests/qemuxml2argvtest.c: Initialize vm.migrateFrom[0],
  to avoid "read-uninitialized" error from within
  qemudBuildCommandLinei, from Jim Meyering.
Daniel
This commit is contained in:
Daniel Veillard 2007-10-19 08:29:13 +00:00
parent 171afdf694
commit 69b9fcf297
4 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,12 @@
Fri Oct 19 10:24:52 CEST 2007 Daniel Veillard <veillard@redhat.com>
* src/conf.c: documentation cleanups from Jim Meyering
* tests/conftest.c: Use fwrite, not printf, since the
result buffer is not NUL-terminated.
* tests/qemuxml2argvtest.c: Initialize vm.migrateFrom[0],
to avoid "read-uninitialized" error from within
qemudBuildCommandLine.
Wed Oct 17 11:27:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* libvirt.spec.in (BuildRequires): Add "qemu" (Jim Meyering).

View File

@ -1,7 +1,7 @@
/**
* conf.c: parser for a subset of the Python encoded Xen configuration files
*
* Copyright (C) 2006 Red Hat, Inc.
* Copyright (C) 2006, 2007 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
@ -916,7 +916,7 @@ error:
/**
* __virConfWriteMem:
* @memory: pointer to the memory to store the config file
* @len: pointer to the lenght in byte of the store, on output the size
* @len: pointer to the length in bytes of the store, on output the size
* @conf: the conf
*
* Writes a configuration file back to a memory area. @len is an IN/OUT

View File

@ -24,7 +24,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "Failed to serialize %s back\n", argv[1]);
exit(3);
}
printf("%s", buffer);
virConfFree(conf);
if (fwrite(buffer, len, 1, stdout) != len) {
fprintf(stderr, "Write failed\n");
exit(1);
}
exit(0);
}

View File

@ -40,6 +40,7 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd) {
vm.qemuVersion = 0 * 1000 * 100 + (8 * 1000) + 1;
vm.qemuCmdFlags = QEMUD_CMD_FLAG_VNC_COLON |
QEMUD_CMD_FLAG_NO_REBOOT;
vm.migrateFrom[0] = '\0';
vmdef->vncActivePort = vmdef->vncPort;