From: Arthur Gautier <baloo@gandi.net>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] vmdk: Fix cylinders number during convert
Date: Thu, 30 Oct 2014 15:28:20 +0100 [thread overview]
Message-ID: <20141030142820.GA27429@khany.gandi.net> (raw)
In-Reply-To: <20141030102720.GA29989@fam-t430.nay.redhat.com>
On Thu, Oct 30, 2014 at 06:27:20PM +0800, Fam Zheng wrote:
> On Thu, 10/30 10:09, Arthur Gautier wrote:
> > On Wed, Oct 29, 2014 at 09:28:52AM +0800, Fam Zheng wrote:
> > > On Tue, 10/28 16:00, Stefan Hajnoczi wrote:
> > > > On Thu, Oct 23, 2014 at 10:03:25AM +0200, Markus Armbruster wrote:
> > > > > Michael Tokarev <mjt@tls.msk.ru> writes:
> > > > >
> > > > > > On 10/22/2014 05:25 PM, Arthur Gautier wrote:
> > > > > >> We can not rely on int cast to get a correct number of cylinders. The
> > > > > >> cylinders information was wrong in 49.9999% of cases.
> > > > > >>
> > > > > >> This ensures the cylinders always gets the ceiling value.
> > > > > >
> > > > > > Good thing, especially the good probability :), and also a good patch
> > > > > > which comes with a test.
> > > > > >
> > > > > > But I wonder if anything can break this way? Migration, windows guest
> > > > > > being unable to find its partitions, something else?
> > >
> > > I'd like to hear an answer to this question too, so we know why it's right and
> > > worth to have.
> > >
> > Sincerely, I didn't tried myself.
> >
> > > > > >
> > > > > > And more. What-if our drive size in cylinders will be larger than
> > > > > > the size in bytes? The proposed div_round_up() will increase number
> > > > > > of cylinders, so size in CHS will be larger than size in bytes. Maybe
> > > > > > there was a reason why originally the size in cylinders was calculated
> > > > > > by truncating extra fractional part? What-if guest will try to access
> > > > > > the very last CHS which is incomplete?
> > >
> > > I don't remember a reason why truncating (I doubt there is any), OTOH I'm not
> > > sure what is the right thing to do if the guest tries to write to the last
> > > incomplete CHS either.
> > >
> > > Fam
> >
> > Maybe we can expand the disk to the size matching cylinders * sectors *
> > sector_size and issue a warning to the user? This way it will always be
> > safe.
> >
>
> Possible, but I don't know if it's worth it. Could you explain what doesn't
> work now, in order to show *why* you need this change?
>
> Thanks,
> Fam
Please take a look at the test in the patch. I have been able to
generate an image with a number of cylinders of zero which I believe is
wrong.
--
\o/ Arthur
G Gandi.net
next prev parent reply other threads:[~2014-10-31 15:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 13:25 [Qemu-devel] [PATCH] vmdk: Fix cylinders number during convert Arthur Gautier
2014-10-23 6:55 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-10-23 8:03 ` Markus Armbruster
2014-10-28 16:00 ` Stefan Hajnoczi
2014-10-29 1:28 ` Fam Zheng
2014-10-30 9:09 ` Arthur Gautier
2014-10-30 10:27 ` Fam Zheng
2014-10-30 14:28 ` Arthur Gautier [this message]
2014-10-31 2:52 ` Fam Zheng
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=20141030142820.GA27429@khany.gandi.net \
--to=baloo@gandi.net \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.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).