From: Don Slutz <[email protected]>

Signed-off-by: Don Slutz <[email protected]>
---
 defs.h   | 2 +-
 memory.c | 4 ++--
 remote.c | 8 ++++++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/defs.h b/defs.h
index 108ffc1..4cb2113 100755
--- a/defs.h
+++ b/defs.h
@@ -5536,7 +5536,7 @@ int remote_memory_used(void);
 void remote_exit(void);
 int remote_execute(void);
 void remote_clear_pipeline(void);
-int remote_memory_read(int, char *, int, physaddr_t);
+int remote_memory_read(int, char *, int, physaddr_t, int);
 
 /*
  *  gnu_binutils.c
diff --git a/memory.c b/memory.c
index d936b53..5ec454d 100755
--- a/memory.c
+++ b/memory.c
@@ -2492,7 +2492,7 @@ write_lkcd_dumpfile(int fd, void *bufptr, int cnt, ulong 
addr, physaddr_t paddr)
 int
 read_daemon(int fd, void *bufptr, int cnt, ulong vaddr, physaddr_t paddr) 
 {
-       if (remote_memory_read(pc->rmfd, bufptr, cnt, paddr) == cnt)
+       if (remote_memory_read(pc->rmfd, bufptr, cnt, paddr, -1) == cnt)
                return cnt;
 
        if (!IS_VMALLOC_ADDR(vaddr) || DUMPFILE())
@@ -2506,7 +2506,7 @@ read_daemon(int fd, void *bufptr, int cnt, ulong vaddr, 
physaddr_t paddr)
          *  the only alternative is to read it from /dev/kmem.
          */
 
-       if (BITS32() && remote_memory_read(pc->rkfd, bufptr, cnt, vaddr) == cnt)
+       if (BITS32() && remote_memory_read(pc->rkfd, bufptr, cnt, vaddr, -1) == 
cnt)
                 return cnt;
 
        return READ_ERROR;
diff --git a/remote.c b/remote.c
index e64f2bd..823aba0 100755
--- a/remote.c
+++ b/remote.c
@@ -2271,8 +2271,10 @@ remote_proc_version(char *buf)
         sprintf(sendbuf, "PROC_VERSION");
         remote_tcp_write_string(pc->sockfd, sendbuf);
         remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 & 
REMOTE_NIL);
-        if (STREQ(recvbuf, "<FAIL>"))
+        if (STREQ(recvbuf, "<FAIL>")) {
+               buf[0] = 0;
                 return FALSE;
+       }
         strcpy(buf, recvbuf);
        return TRUE;
 }
@@ -3460,7 +3462,7 @@ remote_memory_dump(int verbose)
  *  a page in length.
  */
 int 
-remote_memory_read(int rfd, char *buffer, int cnt, physaddr_t address)
+remote_memory_read(int rfd, char *buffer, int cnt, physaddr_t address, int 
vcpu)
 {
         char sendbuf[BUFSIZE];
        char datahdr[DATA_HDRSIZE];
@@ -3479,6 +3481,8 @@ remote_memory_read(int rfd, char *buffer, int cnt, 
physaddr_t address)
                 sprintf(sendbuf, "READ_LKCD %d %lx %d", rfd, addr, cnt);
         else if (pc->flags & REM_S390D)
                 sprintf(sendbuf, "READ_S390D %d %lx %d", rfd, addr, cnt);
+        else if (vcpu >= 0)
+                sprintf(sendbuf, "READ_LIVE %d %lx %d %d", rfd, addr, cnt, 
vcpu);
         else
                 sprintf(sendbuf, "READ_LIVE %d %lx %d", rfd, addr, cnt);
 
-- 
1.8.4

--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to