[libvirt] [PATCH 4/5] Add a qemuDomainAppendLog method for writing to the domain logfile
Eric Blake
eblake at redhat.com
Thu May 5 21:01:59 UTC 2011
On 05/05/2011 05:51 AM, Daniel P. Berrange wrote:
> The qemuDomainAppendLog method allows writing a formatted string
> to the end of the domain logfile, optionally opening it if needed.
>
> * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
> qemuDomainAppendLog
> ---
> src/qemu/qemu_domain.c | 37 +++++++++++++++++++++++++++++++++++++
> src/qemu/qemu_domain.h | 4 ++++
> 2 files changed, 41 insertions(+), 0 deletions(-)
>
> +++ b/src/qemu/qemu_domain.c
> @@ -888,3 +888,40 @@ qemuDomainOpenLog(struct qemud_driver *driver, virDomainObjPtr vm, off_t pos)
> }
>
>
> +ATTRIBUTE_FMT_PRINTF(4, 5)
> +int qemuDomainAppendLog(struct qemud_driver *driver,
If you put the ATTRIBUTE_FMT_PRINTF in the .h, then you don't need to
copy it here. Plus, it will actually cause the compiler to do checking
for files other than qemu_domain.c.
> +++ b/src/qemu/qemu_domain.h
> @@ -131,5 +131,9 @@ void qemuDomainObjCheckNetTaint(struct qemud_driver *driver,
>
> int qemuDomainCreateLog(struct qemud_driver *driver, virDomainObjPtr vm, bool append);
> int qemuDomainOpenLog(struct qemud_driver *driver, virDomainObjPtr vm, off_t pos);
> +int qemuDomainAppendLog(struct qemud_driver *driver,
> + virDomainObjPtr vm,
> + int logFD,
> + const char *fmt, ...);
ACK with the ATTRIBUTE moved to the .h.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110505/866b26e3/attachment-0001.sig>
More information about the libvir-list
mailing list