[libvirt] [PATCH 4/7] Factor qemudMonitorSend() out of qemudMonitorCommandExtra()
Daniel Veillard
veillard at redhat.com
Mon Jul 27 08:50:23 UTC 2009
On Wed, Jul 22, 2009 at 10:57:33PM +0100, Mark McLoughlin wrote:
> Add a little helper function to write the monitor command followed by
> carriage return in a single write.
>
> This doesn't make any real difference, but allows us to more easily
> switch to using sendmsg() when using the monitor over a unix socket.
[...]
> +static int
> +qemudMonitorSend(const virDomainObjPtr vm,
> + const char *cmd)
> +{
> + char *full;
> + size_t len;
> + int ret = -1;
> +
> + if (virAsprintf(&full, "%s\r", cmd) < 0)
> + return -1;
Hum, we introduce an allocation here, and if it fails we really
should call the OOM errror centralized routine
Once done looks fine to me, ACK,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list