All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 0/3 v2] allow online resizing of block devices
Date: Wed, 19 Jan 2011 18:26:49 +0100	[thread overview]
Message-ID: <m3oc7cst2e.fsf@trasno.org> (raw)
In-Reply-To: <20110119170238.GA9615@lst.de> (Christoph Hellwig's message of "Wed, 19 Jan 2011 18:02:38 +0100")

Christoph Hellwig <hch@lst.de> wrote:
> This patchset adds support for online resizing of block devices.
>
> The first patch adds a new resize monitor command which call into
> the existing image resize code.  This is the meat of the series
> and probably needs quite a bit of review and help as I'm not sure
> about how to implement the error handling for monitor commands
> correctly.  Am I really supposed to add a new QERR_ definition
> for each possible error?  And if yes how am I supposed to define
> them?  The macros for them aren't exactly self-explaining.
>
> The second patch adds a way to tell drivers about a resize, and the
> third one adds a guest notification for config changes to virtio-blk
> which allows the guest to pick it up without a rescan.  I've just sent
> the corresponding Linux guest driver patch to Rusty.
>
> Changes from version 1 to version 2:
>  - also add a QMP command (block_resize)
>  - use the o format for the size in the monitor command
>  - fix typos
>  - use QERR_UNDEFINED_ERROR for errors instead of unstructured strings
>  - remove the CDROM hint check
>  - add a reason argument to the change callback

Does this handle the change of the rtc data?  I can't see how/where.
(Not that I know if it is important at all until reboot).

cmos_init_hb() uses the size to guess the right geometry of the drives,
if we change the size of the drive, should we change that one?



Later, Juan.

hw/pc.c
static void pc_cmos_init_late(void *opaque)
{
    pc_cmos_init_late_arg *arg = opaque;
    ISADevice *s = arg->rtc_state;
    pint val;
    BlockDriverState *hd_table[4];
    int i;

    ide_get_bs(hd_table, arg->idebus0);
    ide_get_bs(hd_table + 2, arg->idebus1);

    rtc_set_memory(s, 0x12, (hd_table[0] ? 0xf0 : 0) | (hd_table[1] ? 0x0f : 0));
    if (hd_table[0])
        cmos_init_hd(0x19, 0x1b, hd_table[0], s);
    if (hd_table[1])
        cmos_init_hd(0x1a, 0x24, hd_table[1], s);

.....
}

static void cmos_init_hd(int type_ofs, int info_ofs, BlockDriverState *hd,
                         ISADevice *s)
{
    int cylinders, heads, sectors;
    bdrv_get_geometry_hint(hd, &cylinders, &heads, &sectors);
    rtc_set_memory(s, type_ofs, 47);
    rtc_set_memory(s, info_ofs, cylinders);
    rtc_set_memory(s, info_ofs + 1, cylinders >> 8);
    rtc_set_memory(s, info_ofs + 2, heads);
....

  parent reply	other threads:[~2011-01-19 17:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 17:02 [Qemu-devel] [PATCH 0/3 v2] allow online resizing of block devices Christoph Hellwig
2011-01-19 17:02 ` [Qemu-devel] [PATCH 1/3] block: add resize monitor command Christoph Hellwig
2011-01-20  8:56   ` Stefan Hajnoczi
2011-01-20  9:43     ` Christoph Hellwig
2011-01-19 17:02 ` [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize Christoph Hellwig
2011-01-20  9:14   ` Stefan Hajnoczi
2011-01-20  9:44     ` Christoph Hellwig
2011-01-21 10:41   ` Kevin Wolf
2011-01-19 17:03 ` [Qemu-devel] [PATCH 3/3] virtio-blk: tell the guest about size changes Christoph Hellwig
2011-01-19 17:26 ` Juan Quintela [this message]
2011-01-20  9:42   ` [Qemu-devel] Re: [PATCH 0/3 v2] allow online resizing of block devices Christoph Hellwig

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=m3oc7cst2e.fsf@trasno.org \
    --to=quintela@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.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.