[libvirt] [PATCH 2/2] Add support for QEMU migration to use SASL authentication
Daniel P. Berrange
berrange at redhat.com
Wed Apr 30 13:21:36 UTC 2014
On Tue, Apr 29, 2014 at 04:44:09PM +0000, sahid wrote:
> From a43dc307c3014d70a01035313cd763ee13e9d219 Mon Sep 17 00:00:00 2001
> From: Sahid Orentino Ferdjaoui <sahid.ferdjaoui at cloudwatt.com>
> Date: Fri, 11 Apr 2014 19:17:47 +0000
> Subject: [PATCH 2/2] Add support for QEMU migration to use SASL authentication
>
> This commit provides the ability to virDomainMigrateToURI to
> check for SASL credentials when attempts to migrate a domain
> with the driver QEMU.
>
> Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui at cloudwatt.com>
> ---
> src/qemu/qemu_migration.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 3d005a0..a9f7fea 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -4020,6 +4020,18 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver,
> }
>
>
> +static int virConnectCredType[] = {
> + VIR_CRED_AUTHNAME,
> + VIR_CRED_PASSPHRASE,
> +};
> +
> +
> +static virConnectAuth virConnectAuthConfig = {
> + .credtype = virConnectCredType,
> + .ncredtype = ARRAY_CARDINALITY(virConnectCredType),
> +};
> +
> +
> static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
> virConnectPtr sconn,
> virDomainObjPtr vm,
> @@ -4053,7 +4065,7 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
> */
>
> qemuDomainObjEnterRemote(vm);
> - dconn = virConnectOpen(dconnuri);
> + dconn = virConnectOpenAuth(dconnuri, &virConnectAuthConfig, 0);
> qemuDomainObjExitRemote(vm);
> if (dconn == NULL) {
> virReportError(VIR_ERR_OPERATION_FAILED,
> --
> 1.9.0
ACK, I've tested this with p2p migration + SASL and it is sufficient to
let you configure a /etc/libvirt/auth.conf to make migration succeeed.
Will push it shortly.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list