From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAiZr-0004F1-Kw for qemu-devel@nongnu.org; Thu, 22 Mar 2012 10:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAiZm-0000QN-JM for qemu-devel@nongnu.org; Thu, 22 Mar 2012 10:01:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38857 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAiZm-0000Q5-9z for qemu-devel@nongnu.org; Thu, 22 Mar 2012 10:01:14 -0400 Message-ID: <4F6B30A8.6060903@suse.de> Date: Thu, 22 Mar 2012 15:01:12 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1332418064-23091-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1332418064-23091-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] usb/vmstate: add parent dev path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori Am 22.03.2012 13:07, schrieb Gerd Hoffmann: > ... to make vmstate id string truely unique with multiple host > controllers, i.e. move from "1/usb-ptr" to "0000:00:01.3/1/usb-ptr" > (usb tabled connected to piix3 uhci). >=20 > This obviously breaks migration. To handle this the usb bus > property "full-path" is added. When setting this to false old > behavior is maintained. This way current qemu will be compatible > with old versions when started using '-M pc-$oldversion'. >=20 > Signed-off-by: Gerd Hoffmann > --- > hw/pc_piix.c | 28 ++++++++++++++++++++++++++++ > hw/usb.h | 5 +++++ > hw/usb/bus.c | 18 +++++++++++++++++- > 3 files changed, 50 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index 3f99f9a..8cb7d5f 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -386,6 +386,10 @@ static QEMUMachine pc_machine_v1_0 =3D { > .driver =3D "isa-fdc", > .property =3D "check_media_rate", > .value =3D "off", > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", This touches on our "favorite" bit/bool topic again. While I agree that "no" makes sense for a property of that name, the current code still expects "on" and "off". In particular, "yes" would not work as expected. We should either merge support for yes/no or use "off" here. I had a patch for the former but didn't resubmit after the QOM merge since I thought we would want to move this from qdev to Object first. Andreas > }, > { /* end of list */ } > }, > @@ -405,6 +409,10 @@ static QEMUMachine pc_machine_v0_15 =3D { > .driver =3D "isa-fdc", > .property =3D "check_media_rate", > .value =3D "off", > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > }, > @@ -449,6 +457,10 @@ static QEMUMachine pc_machine_v0_14 =3D { > .driver =3D "pc-sysfw", > .property =3D "rom_only", > .value =3D stringify(1), > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > }, > @@ -505,6 +517,10 @@ static QEMUMachine pc_machine_v0_13 =3D { > .driver =3D "pc-sysfw", > .property =3D "rom_only", > .value =3D stringify(1), > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > }, > @@ -565,6 +581,10 @@ static QEMUMachine pc_machine_v0_12 =3D { > .driver =3D "pc-sysfw", > .property =3D "rom_only", > .value =3D stringify(1), > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > } > @@ -633,6 +653,10 @@ static QEMUMachine pc_machine_v0_11 =3D { > .driver =3D "pc-sysfw", > .property =3D "rom_only", > .value =3D stringify(1), > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > } > @@ -713,6 +737,10 @@ static QEMUMachine pc_machine_v0_10 =3D { > .driver =3D "pc-sysfw", > .property =3D "rom_only", > .value =3D stringify(1), > + },{ > + .driver =3D "USB", > + .property =3D "full-path", > + .value =3D "no", > }, > { /* end of list */ } > }, > diff --git a/hw/usb/bus.c b/hw/usb/bus.c > index d3f8358..f1e567b 100644 > --- a/hw/usb/bus.c > +++ b/hw/usb/bus.c > @@ -19,6 +19,8 @@ static struct BusInfo usb_bus_info =3D { > .get_fw_dev_path =3D usb_get_fw_dev_path, > .props =3D (Property[]) { > DEFINE_PROP_STRING("port", USBDevice, port_path), > + DEFINE_PROP_BIT("full-path", USBDevice, flags, > + USB_DEV_FLAG_FULL_PATH, true), > DEFINE_PROP_END_OF_LIST() > }, > }; --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg