[Spice-commits] 2 commits - server/reds.c server/red_worker.c

Alon Levy alon at kemper.freedesktop.org
Wed Jul 11 06:34:40 PDT 2012


 server/red_worker.c |   32 ++++++++++++++++----------------
 server/reds.c       |   52 ++++++++++++++++++++++++++--------------------------
 2 files changed, 42 insertions(+), 42 deletions(-)

New commits:
commit d7968ee5006d769da387301697be83cf341abdfb
Author: Alon Levy <alevy at redhat.com>
Date:   Wed Jul 11 14:41:33 2012 +0300

    server/reds: fix wrong spice_error in d2c99b59

diff --git a/server/reds.c b/server/reds.c
index c8b5fc4..c33c86c 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -547,7 +547,7 @@ void reds_unregister_channel(RedChannel *channel)
         ring_remove(&channel->link);
         reds->num_of_channels--;
     } else {
-        spice_error("not found");
+        spice_warning("not found");
     }
 }
 
@@ -789,7 +789,7 @@ static int vdi_port_read_buf_process(int port, VDIReadBuf *buf)
     case VDP_SERVER_PORT:
         return FALSE;
     default:
-        spice_error("invalid port");
+        spice_warning("invalid port");
         reds_agent_remove();
         return FALSE;
     }
@@ -1037,7 +1037,7 @@ void reds_fill_channels(SpiceMsgChannels *channels_info)
 
     channels_info->num_of_channels = used_channels;
     if (used_channels != reds->num_of_channels) {
-        spice_error("sent %d out of %d", used_channels, reds->num_of_channels);
+        spice_warning("sent %d out of %d", used_channels, reds->num_of_channels);
     }
 }
 
@@ -1167,7 +1167,7 @@ void reds_on_main_mouse_mode_request(void *message, size_t size)
         reds_set_mouse_mode(SPICE_MOUSE_MODE_SERVER);
         break;
     default:
-        spice_error("unsupported mouse mode");
+        spice_warning("unsupported mouse mode");
     }
 }
 
@@ -1180,12 +1180,12 @@ typedef struct WriteQueueInfo {
 
 void reds_marshall_migrate_data_item(SpiceMarshaller *m, MainMigrateData *data)
 {
-    spice_error("not implemented");
+    spice_warning("not implemented");
 }
 
 void reds_on_main_receive_migrate_data(MainMigrateData *data, uint8_t *end)
 {
-    spice_error("not implemented");
+    spice_warning("not implemented");
 }
 
 static int sync_write(RedsStream *stream, const void *in_buf, size_t n)
@@ -1249,12 +1249,12 @@ static int reds_send_link_ack(RedLinkInfo *link)
     ack.caps_offset = sizeof(SpiceLinkReply);
 
     if (!(link->tiTicketing.rsa = RSA_new())) {
-        spice_error("RSA nes failed");
+        spice_warning("RSA nes failed");
         return FALSE;
     }
 
     if (!(bio = BIO_new(BIO_s_mem()))) {
-        spice_error("BIO new failed");
+        spice_warning("BIO new failed");
         return FALSE;
     }
 
@@ -1496,7 +1496,7 @@ static void openssl_init(RedLinkInfo *link)
     link->tiTicketing.bn = BN_new();
 
     if (!link->tiTicketing.bn) {
-        spice_error("OpenSSL BIGNUMS alloc failed");
+        spice_warning("OpenSSL BIGNUMS alloc failed");
     }
 
     BN_set_word(link->tiTicketing.bn, f4);
@@ -1538,7 +1538,7 @@ void reds_on_client_migrate_complete(RedClient *client)
     mcc = red_client_get_main(client);
     mig_client = reds_mig_target_client_find(client);
     if (!mig_client) {
-        spice_error("mig target client was not found");
+        spice_warning("mig target client was not found");
         return;
     }
 
@@ -1556,10 +1556,10 @@ void reds_on_client_migrate_complete(RedClient *client)
         channel = reds_find_channel(mig_link->link_msg->channel_type,
                                     mig_link->link_msg->channel_id);
         if (!channel) {
-            spice_error("client %p channel (%d, %d) (type, id) wasn't found",
-                        client,
-                        mig_link->link_msg->channel_type,
-                        mig_link->link_msg->channel_id);
+            spice_warning("client %p channel (%d, %d) (type, id) wasn't found",
+                          client,
+                          mig_link->link_msg->channel_type,
+                          mig_link->link_msg->channel_id);
             continue;
         }
         reds_channel_do_link(channel, client, mig_link->link_msg, mig_link->stream);
@@ -1642,7 +1642,7 @@ static void reds_handle_ticket(void *opaque)
 
         if (strlen(taTicket.password) == 0) {
             reds_send_link_result(link, SPICE_LINK_ERR_PERMISSION_DENIED);
-            spice_error("Ticketing is enabled, but no password is set. "
+            spice_warning("Ticketing is enabled, but no password is set. "
                         "please set a ticket first");
             reds_link_free(link);
             return;
@@ -1650,9 +1650,9 @@ static void reds_handle_ticket(void *opaque)
 
         if (expired || strncmp(password, taTicket.password, SPICE_MAX_PASSWORD_LENGTH) != 0) {
             if (expired) {
-                spice_error("Ticket has expired");
+                spice_warning("Ticket has expired");
             } else {
-                spice_error("Invalid password");
+                spice_warning("Invalid password");
             }
             reds_send_link_result(link, SPICE_LINK_ERR_PERMISSION_DENIED);
             reds_link_free(link);
@@ -1693,7 +1693,7 @@ static ssize_t reds_stream_sasl_write(RedsStream *s, const void *buf, size_t nby
                           (const char **)&s->sasl.encoded,
                           &s->sasl.encodedLength);
         if (err != SASL_OK) {
-            spice_error("sasl_encode error: %d", err);
+            spice_warning("sasl_encode error: %d", err);
             return -1;
         }
 
@@ -1702,7 +1702,7 @@ static ssize_t reds_stream_sasl_write(RedsStream *s, const void *buf, size_t nby
         }
 
         if (!s->sasl.encoded) {
-            spice_error("sasl_encode didn't return a buffer!");
+            spice_warning("sasl_encode didn't return a buffer!");
             return 0;
         }
 
@@ -1754,7 +1754,7 @@ static ssize_t reds_stream_sasl_read(RedsStream *s, uint8_t *buf, size_t nbyte)
                       (char *)encoded, n,
                       &decoded, &decodedlen);
     if (err != SASL_OK) {
-        spice_error("sasl_decode error: %d", err);
+        spice_warning("sasl_decode error: %d", err);
         return -1;
     }
 
@@ -1836,8 +1836,8 @@ static char *addr_to_string(const char *format,
                            host, sizeof(host),
                            serv, sizeof(serv),
                            NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
-        spice_error("Cannot resolve address %d: %s",
-                    err, gai_strerror(err));
+        spice_warning("Cannot resolve address %d: %s",
+                      err, gai_strerror(err));
         return NULL;
     }
 
@@ -1923,14 +1923,14 @@ static void reds_handle_auth_sasl_step(void *opaque)
                            &serveroutlen);
     if (err != SASL_OK &&
         err != SASL_CONTINUE) {
-        spice_error("sasl step failed %d (%s)",
-                    err, sasl_errdetail(sasl->conn));
+        spice_warning("sasl step failed %d (%s)",
+                      err, sasl_errdetail(sasl->conn));
         goto authabort;
     }
 
     if (serveroutlen > SASL_DATA_MAX_LEN) {
-        spice_error("sasl step reply data too long %d",
-                    serveroutlen);
+        spice_warning("sasl step reply data too long %d",
+                      serveroutlen);
         goto authabort;
     }
 
commit 75a49edce3c85cadaf6907e7a81e848f68808cee
Author: Alon Levy <alevy at redhat.com>
Date:   Wed Jul 11 14:41:06 2012 +0300

    server/red_worker: fix wrong spice_error in commit 706232a8

diff --git a/server/red_worker.c b/server/red_worker.c
index c492443..ac9baf2 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1212,7 +1212,7 @@ static inline void validate_surface(RedWorker *worker, uint32_t surface_id)
 {
     spice_warn_if(surface_id >= worker->n_surfaces);
     if (!worker->surfaces[surface_id].context.canvas) {
-        spice_error("failed on %d", surface_id);
+        spice_warning("failed on %d", surface_id);
         spice_warn_if(!worker->surfaces[surface_id].context.canvas);
     }
 }
@@ -3422,7 +3422,7 @@ static inline int red_current_add(RedWorker *worker, Ring *ring, Drawable *drawa
                 if (!((DrawItem *)sibling)->container_root) {
                     container = __new_container(worker, (DrawItem *)sibling);
                     if (!container) {
-                        spice_error("create new container failed");
+                        spice_warning("create new container failed");
                         region_destroy(&exclude_rgn);
                         return FALSE;
                     }
@@ -4321,7 +4321,7 @@ static void red_draw_qxl_drawable(RedWorker *worker, Drawable *drawable)
         break;
     }
     default:
-        spice_error("invalid type");
+        spice_warning("invalid type");
     }
 }
 
@@ -4880,7 +4880,7 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *
             }
 #ifdef DEBUG
             /* alert: accessing message.data is insecure */
-            spice_error("MESSAGE: %s", message.data);
+            spice_warning("MESSAGE: %s", message.data);
 #endif
             release_info_ext.group_id = ext_cmd.group_id;
             release_info_ext.info = message.release_info;
@@ -5914,7 +5914,7 @@ static inline int red_glz_compress_image(DisplayChannelClient *dcc,
     zlib_data->data.bufs_head = zlib_data->data.bufs_tail;
 
     if (!zlib_data->data.bufs_head) {
-        spice_error("failed to allocate zlib compress buffer");
+        spice_warning("failed to allocate zlib compress buffer");
         goto glz;
     }
 
@@ -6077,7 +6077,7 @@ static int red_jpeg_compress_image(DisplayChannelClient *dcc, SpiceImage *dest,
     jpeg_data->data.bufs_head = jpeg_data->data.bufs_tail;
 
     if (!jpeg_data->data.bufs_head) {
-        spice_error("failed to allocate compress buffer");
+        spice_warning("failed to allocate compress buffer");
         return FALSE;
     }
 
@@ -8088,7 +8088,7 @@ static inline uint8_t *red_get_image_line(RedWorker *worker, SpiceChunks *chunks
     }
 
     if (chunk->len - *offset < stride) {
-        spice_error("bad chunk alignment");
+        spice_warning("bad chunk alignment");
         return NULL;
     }
     ret = chunk->data + *offset;
@@ -9725,8 +9725,8 @@ static SpiceWatch *worker_watch_add(int fd, int event_mask, SpiceWatchFunc func,
         }
     }
     if (i == MAX_EVENT_SOURCES) {
-        spice_error("ERROR could not add a watch for channel type %u id %u",
-                   rcc->channel->type, rcc->channel->id);
+        spice_warning("could not add a watch for channel type %u id %u",
+                      rcc->channel->type, rcc->channel->id);
         return NULL;
     }
 
@@ -10027,7 +10027,7 @@ static void display_channel_create(RedWorker *worker, int migrate)
             display_channel_handle_migrate_data,
             display_channel_handle_migrate_data_get_serial
             ))) {
-        spice_error("failed to create display channel");
+        spice_warning("failed to create display channel");
         return;
     }
     display_channel = worker->display_channel;
@@ -10624,7 +10624,7 @@ static void dev_destroy_primary_surface(RedWorker *worker, uint32_t surface_id)
     spice_warn_if(surface_id != 0);
 
     if (!worker->surfaces[surface_id].context.canvas) {
-        spice_error("double destroy of primary surface");
+        spice_warning("double destroy of primary surface");
         return;
     }
 
@@ -10921,7 +10921,7 @@ void handle_dev_set_compression(void *opaque, void *payload)
         spice_info("ic off");
         break;
     default:
-        spice_error("ic invalid");
+        spice_warning("ic invalid");
     }
 #ifdef COMPRESS_STAT
     print_compress_stats(worker->display_channel);
@@ -10954,7 +10954,7 @@ void handle_dev_set_streaming_video(void *opaque, void *payload)
             spice_info("sv off");
             break;
         default:
-            spice_error("sv invalid");
+            spice_warning("sv invalid");
     }
 }
 
@@ -11000,8 +11000,8 @@ void handle_dev_loadvm_commands(void *opaque, void *payload)
             if (red_get_cursor_cmd(&worker->mem_slots, ext[i].group_id,
                                    cursor_cmd, ext[i].cmd.data)) {
                 /* XXX allow failure in loadvm? */
-                spice_error("failed loadvm command type (%d)",
-                            ext[i].cmd.type);
+                spice_warning("failed loadvm command type (%d)",
+                              ext[i].cmd.type);
                 continue;
             }
             qxl_process_cursor(worker, cursor_cmd, ext[i].group_id);
@@ -11013,7 +11013,7 @@ void handle_dev_loadvm_commands(void *opaque, void *payload)
             red_process_surface(worker, surface_cmd, ext[i].group_id, TRUE);
             break;
         default:
-            spice_error("unhandled loadvm command type (%d)", ext[i].cmd.type);
+            spice_warning("unhandled loadvm command type (%d)", ext[i].cmd.type);
             break;
         }
     }


More information about the Spice-commits mailing list