From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33185 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORfWR-0003JX-HU for qemu-devel@nongnu.org; Thu, 24 Jun 2010 02:02:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORfWP-0003AB-Jl for qemu-devel@nongnu.org; Thu, 24 Jun 2010 02:02:47 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:46381) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORfWP-00039y-FJ for qemu-devel@nongnu.org; Thu, 24 Jun 2010 02:02:45 -0400 Received: by gwb19 with SMTP id 19so1994571gwb.4 for ; Wed, 23 Jun 2010 23:02:44 -0700 (PDT) MIME-Version: 1.0 Sender: tamura.yoshiaki@gmail.com In-Reply-To: <20100624044046.16168.32804.stgit@localhost.localdomain> References: <20100624044046.16168.32804.stgit@localhost.localdomain> Date: Thu, 24 Jun 2010 15:02:43 +0900 Message-ID: Subject: Re: [Qemu-devel] [PATCH 00/15] Make migration work with hotplug From: Yoshiaki Tamura Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, armbru@redhat.com, paul@codesourcery.com, cam@cs.ualberta.ca, kraxel@redhat.com 2010/6/24 Alex Williamson : > Ok, new approach. =A0I'm going to attempt to extract myself for the > canonical device path approach, because we're missing too many pieces > to make that work. =A0Instead, I'll take Anthony's advice and try to > simplify. =A0We still want a unique name for ramblocks and savevm, but > the hotplug problem today is only for PCI devices. =A0PCI conveniently > has globally unique, dare I say canonical, addressing in the form of > ::.. =A0To get to this, let's add a new > function on the BusInfo structure called get_dev_path(). =A0For a PCI > device, we can simply traverse up the qdev tree to the BusInfo > structure, look for the function, and call it to return a global PCI > address. > > For some buses, these functions could chain up to their parent bus > appending strings together to get a unique path. =A0An example would be > USB, where the USB port number may not be unique. =A0If we traverse up > to the PCI device providing USB, and then to the PCI bus, we get a > globally unique PCI path, appended with a USB port number. > > To make this work for ramblocks and savevm, we need a DeviceState > pointer when the they are create/registered, and we need a caller > provided context in case there are multiple ramblocks/savevm > associated with a device. =A0Savevm already provies the context, > and I've attempted to make reasonable guesses at these for the > ramblocks. =A0Note that most of the ramblocks aren't associated with > a device, so I don't think it makes sense to link savevm and > ramblocks together with the same absolute id string. > > Once we have savevm with unique id strings, rather than hotplug > unfriendly instance numbers, we can be sure that the right driver > instance is loading the correct vmstate. =A0I've also implemented > a compat field for this, so we can still accept incoming migrations > from previous versions. > > Once we have ramblocks with a unique id string, we can switch to > using id + offset for migration, which enables a ram_addr_t space > that supports gaps, which enables us to implement qemu_ram_free(). > With that, I think we can finally do migrations reliable after > hotplug! =A0Note that the target VM still needs to be created to > match the current devices and bus addresses of the source VM. =A0We > can also still maintain compatibility for migrations here by bumping > the ram migration version and supporting both new and old (just > hope the source hasn't done any hotplugs). > > Sound reasonable? =A0Is get_dev_path the right name? =A0In the right > place? =A0The PCI return is currently "dddd:bb:dd.f", should this be > "PCI:dddd:bb:dd.f"? =A0Something else? =A0Thanks, Hi Alex, Is there additional overhead to save rams introduce by this series? If so, how much? Thanks, Yoshi > > Alex > > --- > > Alex Williamson (15): > =A0 =A0 =A0ramblocks: No more being lazy about duplicate names > =A0 =A0 =A0pci: Free the space allocated for the option rom on removal > =A0 =A0 =A0qemu_ram_free: Implement it > =A0 =A0 =A0savevm: Create a new continue flag to avoid resending block na= me > =A0 =A0 =A0savevm: Use RAM blocks for basis of migration > =A0 =A0 =A0savevm: Migrate RAM based on name/offset > =A0 =A0 =A0ramblocks: Make use of DeviceState pointer and BusInfo.get_dev= _path > =A0 =A0 =A0qemu_ram_alloc: Add DeviceState and name parameters > =A0 =A0 =A0virtio-net: Incorporate a DeviceState pointer and let savevm t= rack instances > =A0 =A0 =A0eepro100: Add a dev field to eeprom new/free functions > =A0 =A0 =A0savevm: Make use of DeviceState > =A0 =A0 =A0savevm: Add DeviceState param > =A0 =A0 =A0pci: Implement BusInfo.get_dev_path() > =A0 =A0 =A0qdev: Add a get_dev_path() function to BusInfo > =A0 =A0 =A0Remove uses of ram.last_offset (aka last_ram_offset) > > > =A0arch_init.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0183 +++++++++++++= ++++++++++++++++++++++------ > =A0audio/audio.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0block-migration.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0cpu-all.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A05 + > =A0cpu-common.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0exec.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 96 +++++++= ++++++++++++--- > =A0hw/adb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/ads7846.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/an5206.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/arm_gic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/arm_timer.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/armv7m.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A09 +- > =A0hw/armv7m_nvic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/axis_dev88.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/cirrus_vga.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/cuda.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/dma.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/dummy_m68k.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/eepro100.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A08 +- > =A0hw/eeprom93xx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A08 +- > =A0hw/eeprom93xx.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/etraxfs.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A06 + > =A0hw/fw_cfg.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/g364fb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/grackle_pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/gt64xxx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 - > =A0hw/gumstix.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A06 + > =A0hw/heathrow_pic.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/hw.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 18 ++-- > =A0hw/i2c.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/i8254.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/i8259.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/ide/cmd646.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/ide/isa.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/ide/macio.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/ide/microdrive.c =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/ide/mmio.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/ide/piix.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/integratorcp.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/m48t59.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/mac_dbdma.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/mac_nvram.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/mainstone.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A06 + > =A0hw/max111x.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 - > =A0hw/mcf5208.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/mips_jazz.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/mips_malta.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/mips_mipssim.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/mips_r4k.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 + > =A0hw/mipsnet.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/mst_fpga.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/musicpal.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 11 ++ > =A0hw/nand.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/omap1.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A06 + > =A0hw/omap2.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A06 + > =A0hw/omap_sx1.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 12 ++- > =A0hw/onenand.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/openpic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A05 + > =A0hw/palm.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/pc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A08 +- > =A0hw/pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 34 +++++++- > =A0hw/pckbd.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/petalogix_s3adsp1800_mmu.c | =A0 =A07 +- > =A0hw/piix4.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pl011.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pl022.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pl061.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/ppc405_boards.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 18 ++-- > =A0hw/ppc405_uc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/ppc4xx_devs.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 + > =A0hw/ppc4xx_pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/ppc_newworld.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 + > =A0hw/ppc_oldworld.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 + > =A0hw/ppc_prep.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/ppce500_mpc8544ds.c =A0 =A0 =A0 =A0| =A0 =A03 - > =A0hw/ppce500_pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/ps2.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/pxa2xx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 39 +++++---- > =A0hw/pxa2xx_dma.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/pxa2xx_gpio.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pxa2xx_keypad.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pxa2xx_lcd.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/pxa2xx_mmci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/pxa2xx_pic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/pxa2xx_timer.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/qdev.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/qdev.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 + > =A0hw/r2d.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/rc4030.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/realview.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 + > =A0hw/s390-virtio.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/serial.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/sm501.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/spitz.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 11 +- > =A0hw/ssd0323.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 - > =A0hw/ssi-sd.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/stellaris.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 11 +- > =A0hw/stellaris_enet.c =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/stellaris_input.c =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/sun4m.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A08 +- > =A0hw/sun4u.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/syborg.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/syborg_fb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/syborg_interrupt.c =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/syborg_keyboard.c =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/syborg_pointer.c =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/syborg_rtc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/syborg_serial.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/syborg_timer.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/tc6393xb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/tcx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/tosa.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/tsc2005.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/tsc210x.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 - > =A0hw/unin_pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 + > =A0hw/versatilepb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/vga-isa-mm.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/vga-isa.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/vga.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/virtio-balloon.c =A0 =A0 =A0 =A0 =A0 | =A0 =A03 - > =A0hw/virtio-blk.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/virtio-net.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A07 +- > =A0hw/virtio-serial-bus.c =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/vmmouse.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/vmware_vga.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0hw/zaurus.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0qemu-timer.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0savevm.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0106 +++++++++= ++++++++++++--- > =A0slirp/slirp.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A05 + > =A0vl.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0130 files changed, 648 insertions(+), 286 deletions(-) > > >