All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Protect against long IDs
@ 2017-01-09 20:13 Dr. David Alan Gilbert (git)
  2017-01-09 20:13 ` [Qemu-devel] [PATCH 1/3] vmstate_register_with_alias_id: Take an Error ** Dr. David Alan Gilbert (git)
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2017-01-09 20:13 UTC (permalink / raw)
  To: qemu-devel, mst, pbonzini, quintela, amit.shah

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

QEMU currently asserts if you try and create a PCI device
on the end of a very long chain, because the ID string
exceeds the maximum length, and ends up aliasing.

Fail with a clean error in this common case;  there's
lots of other places that call the various registration
functions that now check for this error; I've only made
sure the common qdev path fails cleanly.

With these patches it fails with the slightly cleaner:

qemu-system-x86_64: -device x3130-upstream,id=pci.52,bus=pci.51,addr=0x0: Path too long for VMState (0000:00:0f.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0:00.0)

I don't think in real uses we'll end up with paths this long,
so I'm not intending to fix the paths to be dynamic lengths
unless we find a really good case where it happens.

This corresponds to:
  https://bugzilla.redhat.com/show_bug.cgi?id=1342434

Dave

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Dr. David Alan Gilbert (3):
  vmstate_register_with_alias_id: Take an Error **
  migration: Check for ID length
  vmstate registration: check return values

 hw/core/qdev.c              |  7 +++++--
 hw/intc/apic_common.c       |  2 +-
 include/migration/vmstate.h |  7 +++++--
 migration/savevm.c          | 24 ++++++++++++++++++------
 stubs/vmstate.c             |  3 ++-
 5 files changed, 31 insertions(+), 12 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-02-01 12:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09 20:13 [Qemu-devel] [PATCH 0/3] Protect against long IDs Dr. David Alan Gilbert (git)
2017-01-09 20:13 ` [Qemu-devel] [PATCH 1/3] vmstate_register_with_alias_id: Take an Error ** Dr. David Alan Gilbert (git)
2017-02-01 12:56   ` Juan Quintela
2017-01-09 20:13 ` [Qemu-devel] [PATCH 2/3] migration: Check for ID length Dr. David Alan Gilbert (git)
2017-02-01 12:57   ` Juan Quintela
2017-01-09 20:13 ` [Qemu-devel] [PATCH 3/3] vmstate registration: check return values Dr. David Alan Gilbert (git)
2017-01-09 21:39   ` Peter Maydell
2017-01-10  9:26     ` Dr. David Alan Gilbert
2017-01-10 10:10       ` Peter Maydell
2017-01-10 10:34         ` Dr. David Alan Gilbert
2017-01-10 10:44           ` Peter Maydell
2017-02-01 12:58   ` Juan Quintela

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.