All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: sstabellini@kernel.org, Paul Durrant <paul@xen.org>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Dov Murik <dovmurik@linux.vnet.ibm.com>
Subject: Re: [PATCH] migration: Truncate state file in xen-save-devices-state
Date: Tue, 29 Sep 2020 00:47:11 +0200	[thread overview]
Message-ID: <20200928224711.GY1482@mail-itl> (raw)
In-Reply-To: <20200928164618.GK2024@perard.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On Mon, Sep 28, 2020 at 05:46:18PM +0100, Anthony PERARD wrote:
> On Mon, Sep 21, 2020 at 12:17:23PM +0100, Dr. David Alan Gilbert 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>
> > > ---
> > >  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;
> > >      }
> 
> Hi Marek,
> 
> Do you know if the above patch is going to work in a linux stubdomain?
> Can we truncate the "save file" which seems to be stubdomain's console 1?

No, truncate won't work on the stubdomain's console. I mean, the
operation won't fail, but the actual file connected to the console on
the other end won't get truncated. But I think in case of stubdomain,
toolstack should connect the console to an empty file, so it shouldn't
be a problem.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-09-28 22:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  9:48 [PATCH] migration: Truncate state file in xen-save-devices-state Dov Murik
2020-09-21 11:17 ` Dr. David Alan Gilbert
2020-09-21 12:28   ` Dov Murik
2020-09-21 17:56     ` Dr. David Alan Gilbert
2020-09-21 23:46       ` Stefano Stabellini
2020-09-23 18:59   ` Dr. David Alan Gilbert
2020-09-28 16:46   ` Anthony PERARD via
2020-09-28 22:47     ` Marek Marczykowski-Górecki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200928224711.GY1482@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=anthony.perard@citrix.com \
    --cc=dgilbert@redhat.com \
    --cc=dovmurik@linux.vnet.ibm.com \
    --cc=paul@xen.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sstabellini@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.