[Spice-devel,v5,8/8] Support QXL remove on spice_server_remove_interface

Submitted by Frediano Ziglio on Dec. 5, 2016, 12:16 p.m.

Details

Message ID 49b710998ff2f3a0a9d804404bf2421cd8c83255.1480940153.git-series.fziglio@redhat.com
State Accepted
Headers show
Series "Start cleaning objects on destruction" ( rev: 7 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 5, 2016, 12:16 p.m.
Allow to dynamically remove QXL interfaces. This could be used to
support hot swapping of QXL cards.
This code is actually not used in any way.
QXL interfaces are destroyed by spice_server_destroy automatically.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
---
 server/reds.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index d350331..6064a6d 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3321,6 +3321,13 @@  SPICE_GNUC_VISIBLE int spice_server_remove_interface(SpiceBaseInstance *sin)
         SpiceCharDeviceInstance *char_device = SPICE_CONTAINEROF(sin, SpiceCharDeviceInstance, base);
         reds = red_char_device_get_server(char_device->st);
         spice_server_char_device_remove_interface(reds, sin);
+    } else if (strcmp(interface->type, SPICE_INTERFACE_QXL) == 0) {
+        QXLInstance *qxl;
+
+        qxl = SPICE_CONTAINEROF(sin, QXLInstance, base);
+        reds = red_qxl_get_server(qxl->st);
+        reds->qxl_instances = g_list_remove(reds->qxl_instances, qxl);
+        red_qxl_destroy(qxl);
     } else {
         spice_warning("VD_INTERFACE_REMOVING unsupported");
         return -1;

Comments

On Mon, 2016-12-05 at 12:16 +0000, Frediano Ziglio wrote:
> Allow to dynamically remove QXL interfaces. This could be used to
> support hot swapping of QXL cards.
> This code is actually not used in any way.
> QXL interfaces are destroyed by spice_server_destroy automatically.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

Looks like the rest of these patches have already been acked



> ---
>  server/reds.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index d350331..6064a6d 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3321,6 +3321,13 @@ SPICE_GNUC_VISIBLE int
> spice_server_remove_interface(SpiceBaseInstance *sin)
>          SpiceCharDeviceInstance *char_device =
> SPICE_CONTAINEROF(sin, SpiceCharDeviceInstance, base);
>          reds = red_char_device_get_server(char_device->st);
>          spice_server_char_device_remove_interface(reds, sin);
> +    } else if (strcmp(interface->type, SPICE_INTERFACE_QXL) == 0) {
> +        QXLInstance *qxl;
> +
> +        qxl = SPICE_CONTAINEROF(sin, QXLInstance, base);
> +        reds = red_qxl_get_server(qxl->st);
> +        reds->qxl_instances = g_list_remove(reds->qxl_instances,
> qxl);
> +        red_qxl_destroy(qxl);
>      } else {
>          spice_warning("VD_INTERFACE_REMOVING unsupported");
>          return -1;