[Spice-devel] [PATCH 8/9] RFC: add the NBD channel

Marc-André Lureau marcandre.lureau at gmail.com
Mon Nov 18 02:28:32 PST 2013


See spice.proto RFC
---
 server/reds.c | 7 +++++++
 spice-common  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/server/reds.c b/server/reds.c
index 7809439..d9e04de 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3592,6 +3592,7 @@ SPICE_GNUC_VISIBLE void spice_server_char_device_wakeup(SpiceCharDeviceInstance*
 #define SUBTYPE_SMARTCARD "smartcard"
 #define SUBTYPE_USBREDIR "usbredir"
 #define SUBTYPE_PORT "port"
+#define SUBTYPE_NBD "nbd"
 
 const char *spice_server_char_device_recognized_subtypes_list[] = {
     SUBTYPE_VDAGENT,
@@ -3599,6 +3600,7 @@ const char *spice_server_char_device_recognized_subtypes_list[] = {
     SUBTYPE_SMARTCARD,
 #endif
     SUBTYPE_USBREDIR,
+    SUBTYPE_NBD,
     NULL,
 };
 
@@ -3665,6 +3667,9 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
     else if (strcmp(char_device->subtype, SUBTYPE_USBREDIR) == 0) {
         dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_USBREDIR);
     }
+    else if (strcmp(char_device->subtype, SUBTYPE_NBD) == 0) {
+        dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_NBD);
+    }
     else if (strcmp(char_device->subtype, SUBTYPE_PORT) == 0) {
         dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_PORT);
     }
@@ -3701,6 +3706,7 @@ static void spice_server_char_device_remove_interface(SpiceBaseInstance *sin)
     }
 #endif
     else if (strcmp(char_device->subtype, SUBTYPE_USBREDIR) == 0 ||
+             strcmp(char_device->subtype, SUBTYPE_NBD) == 0 ||
              strcmp(char_device->subtype, SUBTYPE_PORT) == 0) {
         spicevmc_device_disconnect(char_device);
     } else {
@@ -4204,6 +4210,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_channel_security(SpiceServer *s, const c
         [ SPICE_CHANNEL_SMARTCARD] = "smartcard",
 #endif
         [ SPICE_CHANNEL_USBREDIR ] = "usbredir",
+        [ SPICE_CHANNEL_NBD ] = "nbd",
     };
     int i;
 
diff --git a/spice-common b/spice-common
index 7e8ba10..4dbf0a0 160000
--- a/spice-common
+++ b/spice-common
@@ -1 +1 @@
-Subproject commit 7e8ba10779a3fb11d587e8a59fe389acd2412dd0
+Subproject commit 4dbf0a0b733cc1fd19989403342f2fa928ab591f
-- 
1.8.3.1



More information about the Spice-devel mailing list