qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 08/32] hd-geometry: Move disk geometry guessing


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 08/32] hd-geometry: Move disk geometry guessing back from block.c
Date: Wed, 04 Jul 2012 10:24:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

Am 03.07.2012 20:40, schrieb Blue Swirl:
> On Sat, Jun 30, 2012 at 5:50 AM, Markus Armbruster <address@hidden> wrote:
>> Blue Swirl <address@hidden> writes:
>>
>>> On Fri, Jun 29, 2012 at 3:34 PM, Markus Armbruster <address@hidden> wrote:
>>>> Commit f3d54fc4 factored it out of hw/ide.c for reuse.  Sensible,
>>>> except it was put into block.c.  Device-specific functionality should
>>>> be kept in device code, not the block layer.  Move it to
>>>> hw/hd-geometry.c, and make stylistic changes required to keep
>>>> checkpatch.pl happy.
>>>>
>>>> Signed-off-by: Markus Armbruster <address@hidden>
>>>> ---
>>>>  block.c          |  121 ------------------------------------------
>>>>  block.h          |    1 -
>>>>  blockdev.h       |    5 ++
>>>>  hw/Makefile.objs |    2 +-
>>>>  hw/hd-geometry.c |  153 
>>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>  hw/ide/core.c    |    2 +-
>>>>  hw/scsi-disk.c   |    4 +-
>>>>  hw/virtio-blk.c  |    2 +-
>>>>  8 files changed, 163 insertions(+), 127 deletions(-)
>>>>  create mode 100644 hw/hd-geometry.c
>> [...]
>>>> diff --git a/blockdev.h b/blockdev.h
>>>> index 260e16b..7b05945 100644
>>>> --- a/blockdev.h
>>>> +++ b/blockdev.h
>>>> @@ -62,4 +62,9 @@ void qmp_change_blockdev(const char *device, const char 
>>>> *filename,
>>>>                          bool has_format, const char *format, Error 
>>>> **errp);
>>>>  void do_commit(Monitor *mon, const QDict *qdict);
>>>>  int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
>>>> +
>>>> +/* Hard disk geometry */
>>>> +void hd_geometry_guess(BlockDriverState *bs,
>>>> +                       int *pcyls, int *pheads, int *psecs);
>>>
>>> I'd move this to a separate header under hw/.
>>
>> hw/hd-geometry.h?  Or a header collecting shared block device model
>> code, say hw/block-common.h?
> 
> I'd be happy with either.

I think block-common.h is better. We don't have that much block layer
specific guest-side code that it would make sense to split it up.

>>>> diff --git a/hw/hd-geometry.c b/hw/hd-geometry.c
>>>> new file mode 100644
>>>> index 0000000..9b22e3f
>>>> --- /dev/null
>>>> +++ b/hw/hd-geometry.c
>>>> @@ -0,0 +1,153 @@
>>>> +/*
>>>> + * Hard disk geometry utilities
>>>> + *
>>>> + * Copyright (c) 2003 Fabrice Bellard
>>>> + *
>>>> + * Permission is hereby granted, free of charge, to any person obtaining 
>>>> a copy
>>>> + * of this software and associated documentation files (the "Software"), 
>>>> to deal
>>>> + * in the Software without restriction, including without limitation the 
>>>> rights
>>>> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or 
>>>> sell
>>>> + * copies of the Software, and to permit persons to whom the Software is
>>>> + * furnished to do so, subject to the following conditions:
>>>> + *
>>>> + * The above copyright notice and this permission notice shall be 
>>>> included in
>>>> + * all copies or substantial portions of the Software.
>>>> + *
>>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
>>>> EXPRESS OR
>>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
>>>> MERCHANTABILITY,
>>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
>>>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
>>>> OTHER
>>>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
>>>> ARISING FROM,
>>>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
>>>> IN
>>>> + * THE SOFTWARE.
>>>> + */
>>
>> By the way, X11 license.  I'd very much prefer to put my contributions
>> under GPLv2+.  Is there an acceptable way to do that?
> 
> IANAL, but isn't MIT license compatible with GPL?

IANAL either, but as I understand it:

It is, otherwise distributing qemu would be illegal. But compatibility
means more or less that you can mix them within one project, it doesn't
mean you can convert from one to the other.

> Then maybe you could
> license your contributions under GPLv2+, for example with the same
> statement as GPLv2 to GPLv2+:
> "Contributions after 2012-mm-dd are licensed under the terms of the
> GNU GPL, version 2 or (at your option) any later version."
> 
> Though after that, the file would be dual licensed. Those who want to
> use the MIT version can use the file before the change.

This might be possible. (Though true dual-licensing would mean that the
whole code, including new parts, can be used under either license. This
isn't what we would be doing.) Or have a GPL header and after that add a
notice like "Portions of the code are licensed under the following
conditions: <old license header>".

In any case it's pretty clear to me that you're not allowed to drop the
MIT license header (and therefore blockdev.c still needs a fix)

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]