[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] migration: Truncate state file in xen-save-devices-state
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH] migration: Truncate state file in xen-save-devices-state |
Date: |
Wed, 23 Sep 2020 19:59:09 +0100 |
User-agent: |
Mutt/1.14.6 (2020-07-11) |
* Dr. David Alan Gilbert (dgilbert@redhat.com) wrote:
> * Dov Murik (dovmurik@linux.vnet.ibm.com) wrote:
> > When running the xen-save-devices-state QMP command, if the filename
> > already exists it will be truncated before dumping the devices' state
> > into it.
> >
> > Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
> > ---
>
> OK, that looks fine to me, so:
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Queued
> >
> > Note that I found the above issue while trying to debug
> > xen-load-devices-state which simply fails (prints "Configuration section
> > missing" to stderr) directly after xen-save-devices-state (in the same
> > VM). I wonder if I should file a bug report as-is or investigate some
> > more. Advice welcome.
>
> I don't try the xen-* commands normally; I've cc'ing in Stefano and
> Anthony.
>
> Dave
>
> >
> > -Dov
> >
> > ---
> > migration/savevm.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/migration/savevm.c b/migration/savevm.c
> > index 304d98ff78..e1b26672cc 100644
> > --- a/migration/savevm.c
> > +++ b/migration/savevm.c
> > @@ -2803,7 +2803,8 @@ void qmp_xen_save_devices_state(const char *filename,
> > bool has_live, bool live,
> > vm_stop(RUN_STATE_SAVE_VM);
> > global_state_store_running();
> >
> > - ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT, 0660,
> > errp);
> > + ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT | O_TRUNC,
> > + 0660, errp);
> > if (!ioc) {
> > goto the_end;
> > }
> > --
> > 2.20.1
> >
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK