From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40994 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfbpD-0006g8-Ip for qemu-devel@nongnu.org; Wed, 19 Jan 2011 12:28:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfbpC-0006vb-8r for qemu-devel@nongnu.org; Wed, 19 Jan 2011 12:28:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfbpB-0006vS-Vw for qemu-devel@nongnu.org; Wed, 19 Jan 2011 12:28:02 -0500 From: Juan Quintela In-Reply-To: <20110119170238.GA9615@lst.de> (Christoph Hellwig's message of "Wed, 19 Jan 2011 18:02:38 +0100") References: <20110119170238.GA9615@lst.de> Date: Wed, 19 Jan 2011 18:26:49 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 0/3 v2] allow online resizing of block devices Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig 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, §ors); 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); ....