X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_mem.c;h=b30b3447ab21f0280b6312fccd7b0cc2a40e0d4a;hb=471edd59ca70371e97cbad759e1710433f35990d;hp=82f33c2ab89b3bb402c626ab35997ef80bff9c24;hpb=e8e3ec0355b791d6f729df796d0155bccca85090;p=palacios.git diff --git a/linux_usr/v3_mem.c b/linux_usr/v3_mem.c index 82f33c2..b30b344 100644 --- a/linux_usr/v3_mem.c +++ b/linux_usr/v3_mem.c @@ -655,7 +655,7 @@ static int offline_memory(unsigned long long mem_size_bytes, return -1; } - status_buf[BUF_SIZE]=0; + status_buf[BUF_SIZE-1]=0; VPRINTF("Checking offlined block %d (%s)...", i + reg_start, fname); @@ -665,11 +665,17 @@ static int offline_memory(unsigned long long mem_size_bytes, int j = 0; int major = (i + reg_start) / 8; int minor = (i + reg_start) % 8; + char * pos; bitmap[major] &= ~(0x1 << minor); // mark the block as not removable in bitmap mem_ready = 0; // Keep searching + // remove trailing newline + if ((pos=strchr(status_buf, '\n')) != NULL) { + *pos = '\0'; + } + EPRINTF("ERROR - block status is '%s'\n", status_buf); // Unwind space @@ -808,7 +814,7 @@ static int write_offlined() fclose(off); if (!(off=fopen(offname,"w+"))) { // truncate - EPRINTF("Cannot open %s for writing!\n"); + EPRINTF("Cannot open %s for writing!\n",offname); return -1; }