virtio-ccw: remove qdev_unparent in unplug routing
Quoted 34 lines · Christian Borntraeger
Quoted 23 lines · Paolo Bonzini
Il 25/02/2013 09:09, Christian Borntraeger ha scritto:
Quoted 6 lines
Hmm, the old sequence was
object_unparent(OBJECT(dev)); qdev_free(dev) ---+ | VQuoted 6 lines
...
object_unparent(OBJECT(dev)); now the last reference is gone, object is freed
object_unref(OBJECT(dev)); now the reference of a deleted object becomes -1
...Isnt that a problem in itself that we modify a reference counter in an deleted object?
The second
object_unparentshould do nothing. So before you had:object_unparent(OBJECT(dev)); leaves refcount=1
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); do nothing
object_unref(OBJECT(dev)); refcount=0, object freedQuoted 8 lines
After the
object_unrefwas removed you had:object_unparent(OBJECT(dev)); refcount=0, object freed
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); dangling pointer!
Quoted 1 line
Got it. Thanks
So is the patch valid?
Alex
Quoted 37 lines · On Fri, 8 Mar 2013 21:11:13 +0100 Alexander Graf <[email protected]> wrote:
Quoted 34 lines · Christian Borntraeger
Quoted 31 lines · Paolo Bonzini
Il 25/02/2013 09:09, Christian Borntraeger ha scritto:
Quoted 6 lines
Hmm, the old sequence was
object_unparent(OBJECT(dev)); qdev_free(dev) ---+ | VQuoted 6 lines
...
object_unparent(OBJECT(dev)); now the last reference is gone, object is freed
object_unref(OBJECT(dev)); now the reference of a deleted object becomes -1
...Isnt that a problem in itself that we modify a reference counter in an deleted object?
The second
object_unparentshould do nothing. So before you had:object_unparent(OBJECT(dev)); leaves refcount=1
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); do nothing
object_unref(OBJECT(dev)); refcount=0, object freedAfter the
object_unrefwas removed you had:object_unparent(OBJECT(dev)); refcount=0, object freed
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); dangling pointer!
Quoted 3 lines
Quoted 1 line
Got it. Thanks
So is the patch valid?
To my understanding, yes.
Quoted 4 lines
Alex
Il 11/03/2013 13:04, Cornelia Huck ha scritto:
Quoted 40 lines
Quoted 37 lines · On Fri, 8 Mar 2013 21:11:13 +0100 Alexander Graf <[email protected]> wrote:
Quoted 34 lines · Christian Borntraeger
Quoted 31 lines · Paolo Bonzini
Il 25/02/2013 09:09, Christian Borntraeger ha scritto:
Quoted 6 lines
Hmm, the old sequence was
object_unparent(OBJECT(dev)); qdev_free(dev) ---+ | VQuoted 6 lines
...
object_unparent(OBJECT(dev)); now the last reference is gone, object is freed
object_unref(OBJECT(dev)); now the reference of a deleted object becomes -1
...Isnt that a problem in itself that we modify a reference counter in an deleted object?
The second
object_unparentshould do nothing. So before you had:object_unparent(OBJECT(dev)); leaves refcount=1
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); do nothing
object_unref(OBJECT(dev)); refcount=0, object freedAfter the
object_unrefwas removed you had:object_unparent(OBJECT(dev)); refcount=0, object freed
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); dangling pointer!
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Got it. Thanks
So is the patch valid?
To my understanding, yes.
Yes, except that the "fixed a crash" part in the commit message is probably no longer accurate. No big deal. :)
Paolo
Quoted 38 lines · Paolo Bonzini
Il 11/03/2013 13:04, Cornelia Huck ha scritto:
Quoted 37 lines
Quoted 34 lines · On Fri, 8 Mar 2013 21:11:13 +0100 Alexander Graf<[email protected]> wrote:
Quoted 32 lines · Christian Borntraeger
Quoted 30 lines · Paolo Bonzini
Il 25/02/2013 09:09, Christian Borntraeger ha scritto:
Quoted 6 lines
Hmm, the old sequence was
object_unparent(OBJECT(dev)); qdev_free(dev) ---+ | VQuoted 6 lines
...
object_unparent(OBJECT(dev)); now the last reference is gone, object is freed
object_unref(OBJECT(dev)); now the reference of a deleted object becomes -1
...Isnt that a problem in itself that we modify a reference counter in an deleted object?
The second
object_unparentshould do nothing. So before you had:object_unparent(OBJECT(dev)); leaves refcount=1
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); do nothing
object_unref(OBJECT(dev)); refcount=0, object freedAfter the
object_unrefwas removed you had:object_unparent(OBJECT(dev)); refcount=0, object freed
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); dangling pointer!
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line
Got it. Thanks
So is the patch valid?
To my understanding, yes.
Yes, except that the "fixed a crash" part in the commit message is probably no longer accurate. No big deal. :)
Ok, Connie could you please include it in your next pull then please?
Alex
Quoted 39 lines · On Mon, 11 Mar 2013 13:22:45 +0100 Alexander Graf <[email protected]> wrote:
Quoted 38 lines · Paolo Bonzini
Il 11/03/2013 13:04, Cornelia Huck ha scritto:
Quoted 37 lines
Quoted 34 lines · On Fri, 8 Mar 2013 21:11:13 +0100 Alexander Graf<[email protected]> wrote:
Quoted 32 lines · Christian Borntraeger
Quoted 30 lines · Paolo Bonzini
Il 25/02/2013 09:09, Christian Borntraeger ha scritto:
Quoted 6 lines
Hmm, the old sequence was
object_unparent(OBJECT(dev)); qdev_free(dev) ---+ | VQuoted 6 lines
...
object_unparent(OBJECT(dev)); now the last reference is gone, object is freed
object_unref(OBJECT(dev)); now the reference of a deleted object becomes -1
...Isnt that a problem in itself that we modify a reference counter in an deleted object?
The second
object_unparentshould do nothing. So before you had:object_unparent(OBJECT(dev)); leaves refcount=1
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); do nothing
object_unref(OBJECT(dev)); refcount=0, object freedAfter the
object_unrefwas removed you had:object_unparent(OBJECT(dev)); refcount=0, object freed
qdev_free(dev)---+
|
V
object_unparent(OBJECT(dev)); dangling pointer!
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line
Got it. Thanks
So is the patch valid?
To my understanding, yes.
Yes, except that the "fixed a crash" part in the commit message is probably no longer accurate. No big deal. :)
Ok, Connie could you please include it in your next pull then please?
Sure, will do.
Quoted 4 lines
Alex