From a2f0b6b81da87d3189211e23a874f12d46865903 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 12 Aug 2010 10:01:31 -0400 Subject: [PATCH] Fix tunnelled migration with qemu running as qemu:qemu. The problem is that on the source of the migration, libvirtd is responsible for creating the unix socket over which the data will flow. Since libvirtd is running as root, this file will be created as root. When the qemu process running as qemu:qemu goes to access the unix file to write data to it, it will get permission denied and fail. Make sure to change the owner of the unix file to qemu:qemu. Thanks to Justin Clift for testing this patch out for me. Signed-off-by: Chris Lalancette --- src/qemu/qemu_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2dbb624206..aa14a0624e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10985,6 +10985,13 @@ static int doTunnelMigrate(virDomainPtr dom, goto cleanup; } + if (chown(unixfile, qemu_driver->user, qemu_driver->group) < 0) { + virReportSystemError(errno, + _("Cannot change unix socket '%s' owner"), + unixfile); + goto cleanup; + } + /* check that this qemu version supports the unix migration */ if (qemudExtractVersionInfo(vm->def->emulator, NULL, &qemuCmdFlags) < 0) { qemuReportError(VIR_ERR_INTERNAL_ERROR, -- 2.39.5