Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup based on cppcheck pass (Devices and Extensions)
[palacios.git] / palacios / src / devices / char_stream.c
index 2bde181..6019c2b 100644 (file)
@@ -37,14 +37,14 @@ struct stream_state {
 };
 
 
-static uint64_t  stream_input(struct v3_stream * stream, uint8_t * buf, uint64_t len) {
+static sint64_t  stream_input(struct v3_stream * stream, uint8_t * buf, sint64_t len) {
     struct stream_state * state = stream->guest_stream_data;
 
     return state->char_ops.input(state->vm, buf, len, state->push_fn_arg);
 
 }
 
-static uint64_t  stream_output(uint8_t * buf, uint64_t length, void * private_data) {
+static sint64_t  stream_output(uint8_t * buf, sint64_t length, void * private_data) {
     struct stream_state * state = (struct stream_state *)private_data;
    
     return v3_stream_output(state->stream, buf, length);
@@ -75,7 +75,7 @@ static int stream_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     state = (struct stream_state *)V3_Malloc(sizeof(struct stream_state));
 
     if (state == NULL) {
-       PrintError("Could not allocate stream backend device\n");
+       PrintError(vm, VCORE_NONE, "Could not allocate stream backend device\n");
        return -1;
     }
 
@@ -84,7 +84,7 @@ static int stream_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, state);
 
     if (dev == NULL) {
-       PrintError("Could not allocate device %s\n", dev_id);
+       PrintError(vm, VCORE_NONE, "Could not allocate device %s\n", dev_id);
        V3_Free(state);
        return -1;
     }
@@ -93,7 +93,7 @@ static int stream_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     state->stream = v3_stream_open(vm, stream_name, stream_input, state);
 
     if (state->stream == NULL) {
-       PrintError("Could not open stream %s\n", stream_name);
+       PrintError(vm, VCORE_NONE, "Could not open stream %s\n", stream_name);
        v3_remove_device(dev);
        return -1;
     }
@@ -104,7 +104,7 @@ static int stream_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     if (v3_dev_connect_char(vm, v3_cfg_val(frontend_cfg, "tag"), 
                            &(state->char_ops), frontend_cfg, 
                            state, &(state->push_fn_arg)) == -1) {
-       PrintError("Could not connect %s to frontend %s\n", 
+       PrintError(vm, VCORE_NONE, "Could not connect %s to frontend %s\n", 
                   dev_id, v3_cfg_val(frontend_cfg, "tag"));
        v3_remove_device(dev);
        return -1;