From: Jack Lange Date: Tue, 11 Aug 2009 21:47:47 +0000 (-0500) Subject: improved debugging X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=5b56e669e95075b07c1f7c7d77b4e37311b6a4c2 improved debugging --- diff --git a/palacios/src/palacios/svm_io.c b/palacios/src/palacios/svm_io.c index 4c85ec7..3f71bc1 100644 --- a/palacios/src/palacios/svm_io.c +++ b/palacios/src/palacios/svm_io.c @@ -65,7 +65,7 @@ int v3_handle_svm_io_in(struct guest_info * info) { int read_size = 0; if (hook == NULL) { - PrintError("Hook Not present for in on port %x\n", io_info->port); + PrintError("Hook Not present for in on port 0x%x\n", io_info->port); // error, we should not have exited on this port return -1; } @@ -83,7 +83,7 @@ int v3_handle_svm_io_in(struct guest_info * info) { if (hook->read(io_info->port, &(info->vm_regs.rax), read_size, hook->priv_data) != read_size) { // not sure how we handle errors..... - PrintError("Read Failure for in on port %x\n", io_info->port); + PrintError("Read Failure for in on port 0x%x\n", io_info->port); return -1; } @@ -126,7 +126,7 @@ int v3_handle_svm_io_ins(struct guest_info * info) { if (hook == NULL) { - PrintError("Hook Not present for ins on port %x\n", io_info->port); + PrintError("Hook Not present for ins on port 0x%x\n", io_info->port); // error, we should not have exited on this port return -1; } @@ -217,7 +217,7 @@ int v3_handle_svm_io_ins(struct guest_info * info) { if (hook->read(io_info->port, (char *)host_addr, read_size, hook->priv_data) != read_size) { // not sure how we handle errors..... - PrintError("Read Failure for ins on port %x\n", io_info->port); + PrintError("Read Failure for ins on port 0x%x\n", io_info->port); return -1; } @@ -245,7 +245,7 @@ int v3_handle_svm_io_out(struct guest_info * info) { int write_size = 0; if (hook == NULL) { - PrintError("Hook Not present for out on port %x\n", io_info->port); + PrintError("Hook Not present for out on port 0x%x\n", io_info->port); // error, we should not have exited on this port return -1; } @@ -263,7 +263,7 @@ int v3_handle_svm_io_out(struct guest_info * info) { if (hook->write(io_info->port, &(info->vm_regs.rax), write_size, hook->priv_data) != write_size) { // not sure how we handle errors..... - PrintError("Write Failure for out on port %x\n", io_info->port); + PrintError("Write Failure for out on port 0x%x\n", io_info->port); return -1; } @@ -304,7 +304,7 @@ int v3_handle_svm_io_outs(struct guest_info * info) { if (hook == NULL) { - PrintError("Hook Not present for outs on port %x\n", io_info->port); + PrintError("Hook Not present for outs on port 0x%x\n", io_info->port); // error, we should not have exited on this port return -1; } @@ -390,7 +390,7 @@ int v3_handle_svm_io_outs(struct guest_info * info) { if (hook->write(io_info->port, (char*)host_addr, write_size, hook->priv_data) != write_size) { // not sure how we handle errors..... - PrintError("Write Failure for outs on port %x\n", io_info->port); + PrintError("Write Failure for outs on port 0x%x\n", io_info->port); return -1; } diff --git a/palacios/src/palacios/vmm_io.c b/palacios/src/palacios/vmm_io.c index 9f44fbd..793a0f3 100644 --- a/palacios/src/palacios/vmm_io.c +++ b/palacios/src/palacios/vmm_io.c @@ -129,16 +129,18 @@ int v3_hook_io_port(struct guest_info * info, uint_t port, io_hook->priv_data = priv_data; if (insert_io_hook(info, io_hook)) { - V3_Free(io_hook); - return -1; + PrintError("Could not insert IO hook for port %d\n", port); + V3_Free(io_hook); + return -1; } if (info->io_map.update_map(info, port, ((read == NULL) ? 0 : 1), ((write == NULL) ? 0 : 1)) == -1) { - V3_Free(io_hook); - return -1; + PrintError("Could not update IO map for port %d\n", port); + V3_Free(io_hook); + return -1; }