Re: [Qemu-devel] [PATCH v4 3/4] dump: do not dump non-existent guest memory
* Laurent Vivier (lviv...@redhat.com) wrote: > On 13/09/2017 16:27, Cornelia Huck wrote: > > On Wed, 13 Sep 2017 16:20:35 +0200 > > Laurent Vivierwrote: > > > >> From: Cornelia Huck > >> > >> It does not really make sense to dump memory that is not there. > >> > >> Moreover, that fixes a segmentation fault when calling dump-guest-memory > >> with no filter for a machine with no memory defined. > >> > >> New behaviour is: > >> > >> (qemu) dump-guest-memory /dev/null > >> dump: no guest memory to dump > >> (qemu) dump-guest-memory /dev/null 0 4096 > >> dump: no guest memory to dump > >> > >> Signed-off-by: Cornelia Huck > >> Tested-by: Laurent Vivier > >> Reviewed-by: Laurent Vivier > >> Reviewed-by: Greg Kurz > >> Reviewed-by: Peter Xu > >> --- > >> dump.c | 6 ++ > >> 1 file changed, 6 insertions(+) > > > > You need to supply your s-o-b as well, no? > > > > I was wondering... theoretically, yes, so: > > Signed-off-by: Laurent Vivier Thanks. Dave > Thanks, > Laurent -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK
Re: [Qemu-devel] [PATCH v4 3/4] dump: do not dump non-existent guest memory
On 13/09/2017 16:27, Cornelia Huck wrote: > On Wed, 13 Sep 2017 16:20:35 +0200 > Laurent Vivierwrote: > >> From: Cornelia Huck >> >> It does not really make sense to dump memory that is not there. >> >> Moreover, that fixes a segmentation fault when calling dump-guest-memory >> with no filter for a machine with no memory defined. >> >> New behaviour is: >> >> (qemu) dump-guest-memory /dev/null >> dump: no guest memory to dump >> (qemu) dump-guest-memory /dev/null 0 4096 >> dump: no guest memory to dump >> >> Signed-off-by: Cornelia Huck >> Tested-by: Laurent Vivier >> Reviewed-by: Laurent Vivier >> Reviewed-by: Greg Kurz >> Reviewed-by: Peter Xu >> --- >> dump.c | 6 ++ >> 1 file changed, 6 insertions(+) > > You need to supply your s-o-b as well, no? > I was wondering... theoretically, yes, so: Signed-off-by: Laurent Vivier Thanks, Laurent
Re: [Qemu-devel] [PATCH v4 3/4] dump: do not dump non-existent guest memory
On Wed, 13 Sep 2017 16:20:35 +0200 Laurent Vivierwrote: > From: Cornelia Huck > > It does not really make sense to dump memory that is not there. > > Moreover, that fixes a segmentation fault when calling dump-guest-memory > with no filter for a machine with no memory defined. > > New behaviour is: > > (qemu) dump-guest-memory /dev/null > dump: no guest memory to dump > (qemu) dump-guest-memory /dev/null 0 4096 > dump: no guest memory to dump > > Signed-off-by: Cornelia Huck > Tested-by: Laurent Vivier > Reviewed-by: Laurent Vivier > Reviewed-by: Greg Kurz > Reviewed-by: Peter Xu > --- > dump.c | 6 ++ > 1 file changed, 6 insertions(+) You need to supply your s-o-b as well, no?
[Qemu-devel] [PATCH v4 3/4] dump: do not dump non-existent guest memory
From: Cornelia HuckIt does not really make sense to dump memory that is not there. Moreover, that fixes a segmentation fault when calling dump-guest-memory with no filter for a machine with no memory defined. New behaviour is: (qemu) dump-guest-memory /dev/null dump: no guest memory to dump (qemu) dump-guest-memory /dev/null 0 4096 dump: no guest memory to dump Signed-off-by: Cornelia Huck Tested-by: Laurent Vivier Reviewed-by: Laurent Vivier Reviewed-by: Greg Kurz Reviewed-by: Peter Xu --- dump.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/dump.c b/dump.c index a79773d0f7..d2093e141b 100644 --- a/dump.c +++ b/dump.c @@ -1536,6 +1536,12 @@ static void dump_init(DumpState *s, int fd, bool has_format, fprintf(stderr, "DUMP: total memory to dump: %lu\n", s->total_size); #endif +/* it does not make sense to dump non-existent memory */ +if (!s->total_size) { +error_setg(errp, "dump: no guest memory to dump"); +goto cleanup; +} + s->start = get_start_block(s); if (s->start == -1) { error_setg(errp, QERR_INVALID_PARAMETER, "begin"); -- 2.13.5