Christoph Hellwig <h...@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, §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); ....