qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Xiaodong Gong <gordongong0350@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Xiaodong Gong <gongxiaodong1@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] block:Fix FIXED base vpc be probed to raw format
Date: Wed, 11 Feb 2015 13:39:43 +0000	[thread overview]
Message-ID: <20150211133943.GA6101@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CAL9N-M2NoD+nGh67mVEVDWrfAgsY7iPjoE19ncnwFMNvwjt_tQ@mail.gmail.com>

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

On Tue, Feb 10, 2015 at 11:04:31PM +0800, Xiaodong Gong wrote:
> On Mon, Feb 9, 2015 at 10:54 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> 
> > On Sun, Feb 08, 2015 at 08:39:52PM +0800, Xiaodong Gong wrote:
> > > When open the vpc snapshot based FIXED format, its backing file,
> > > this FIXED vpc image, could be probed as a raw image, because that
> > > the find_image_format just checkout the first sector.
> > >
> > > Add a re-probe for the last sector to FIXED base vpc image,when get
> > > a NULL or raw driver in first sector probe.
> > >
> > > Signed-off-by: Xiaodong Gong <gongxiaodong1@huawei.com>
> > > ---
> > >  block.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++-------
> > >  1 file changed, 48 insertions(+), 7 deletions(-)
> >
> > This approach is likely to cause issues because it makes no distiction
> > between headers and footers.  Most image formats only have a header and
> > would now be misdetected if a raw image had a header in its last sector.
> >
> > When a vpc image has a backing file, does it make sense to set the
> > bs->backing_format to "vpc"?  That way we'll try to open the backing
> > file as a vpc image without probing.
> >
> > Stefan
> >
> 
> 
> It works, but this probing of format sounds good . Giving a argument of bs
> to bdrv_probe and each of funtion of probe get it's own checking method is
> better, but the foot-print of patch is longer.

I'm not suggesting a longer patch.

Can the vpc .bdrv_open() code that loads the backing filename also set
bs->backing_format to "vpc" so QEMU will always use vpc for the backing
file?

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-02-11 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 12:39 [Qemu-devel] [PATCH] block:Fix FIXED base vpc be probed to raw format Xiaodong Gong
2015-02-09 14:54 ` Stefan Hajnoczi
2015-02-10 15:04   ` Xiaodong Gong
2015-02-11 13:39     ` Stefan Hajnoczi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-02-14  2:13 Xiaodong Gong
2015-02-15 13:41 ` Xiaodong Gong

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=20150211133943.GA6101@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=gongxiaodong1@huawei.com \
    --cc=gordongong0350@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).