On 03/30/2016 11:14 AM, Martin Kletzander wrote:
Put it into separate function called qemuDomainPrepareChannel() and
call
it from the new qemuProcessPrepareDomain().
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_command.c | 25 +++----------------------
src/qemu/qemu_command.h | 5 ++---
src/qemu/qemu_domain.c | 19 +++++++++++++++++++
src/qemu/qemu_domain.h | 4 ++++
src/qemu/qemu_process.c | 12 ++++++++----
5 files changed, 36 insertions(+), 29 deletions(-)
[...]
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 403f01e75e46..645e1232d2f9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4639,3 +4639,22 @@ qemuDomainDiskByName(virDomainDefPtr def,
return ret;
}
Two blank lines between functions.
ACK with that.
John
+
+int
+qemuDomainPrepareChannel(virDomainChrDefPtr channel,
+ const char *domainChannelTargetDir)
+{
+ if (channel->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
+ channel->source.type == VIR_DOMAIN_CHR_TYPE_UNIX &&
+ !channel->source.data.nix.path) {
+ if (virAsprintf(&channel->source.data.nix.path,
+ "%s/%s", domainChannelTargetDir,
+ channel->target.name ? channel->target.name
+ : "unknown.sock") < 0)
+ return -1;
+
+ channel->source.data.nix.listen = true;
+ }
+
+ return 0;
+}