Re: [spice-server v2] sound: do not change volume or mute state on migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Dec 04, 2017 at 09:09:22AM +0100, Victor Toso wrote:
> From: Victor Toso <me@xxxxxxxxxxxxxx>
> 
> On migration, Qemu notify spice-server with the current Guest volume
> and mute state values which currently is handled forwarding these
> values to the client.
> 
> This patch is a complement of f10de4bc084fcc - Here, volume was
> jumping regardless of guest's volume value.
> 
> Resolves: rhbz#1425443
> Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>

JFYI, did not test this version just yet.

The infra that I had for playing around with migration is not working
at the moment, so I'm setting up everything in another machine to test
this soon. I don't see why it wouldn't work but better safe than sorry.

Cheers,

> ---
>  server/sound.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/server/sound.c b/server/sound.c
> index b1bfaaaa..fc3d8f4a 100644
> --- a/server/sound.c
> +++ b/server/sound.c
> @@ -823,6 +823,7 @@ static void snd_channel_set_volume(SndChannel *channel,
>  {
>      SpiceVolumeState *st = &channel->volume;
>      SndChannelClient *client = snd_channel_get_client(channel);
> +    RedChannelClient *rcc;
>  
>      st->volume_nchannels = nchannels;
>      g_free(st->volume);
> @@ -831,6 +832,10 @@ static void snd_channel_set_volume(SndChannel *channel,
>      if (!client || nchannels == 0)
>          return;
>  
> +    rcc = RED_CHANNEL_CLIENT(client);
> +    if (red_client_during_migrate_at_target(red_channel_client_get_client(rcc)))
> +        return;
> +
>      snd_set_command(client, SND_VOLUME_MASK);
>      snd_send(client);
>  }
> @@ -846,12 +851,17 @@ static void snd_channel_set_mute(SndChannel *channel, uint8_t mute)
>  {
>      SpiceVolumeState *st = &channel->volume;
>      SndChannelClient *client = snd_channel_get_client(channel);
> +    RedChannelClient *rcc;
>  
>      st->mute = mute;
>  
>      if (!client)
>          return;
>  
> +    rcc = RED_CHANNEL_CLIENT(client);
> +    if (red_client_during_migrate_at_target(red_channel_client_get_client(rcc)))
> +        return;
> +
>      snd_set_command(client, SND_MUTE_MASK);
>      snd_send(client);
>  }
> -- 
> 2.15.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]