Skip to content

Add generic can_be_deleted to UserCreatableClass.

Lin Ma qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 4 repliesIn review
  2. v52 patches 3 repliesSuperseded
  3. v42 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v32 patches1 replySuperseded

Changes in v6 from the cover letter

Change prototype of user_creatable_can_be_deleted.
from bool user_creatable_can_be_deleted(Object *obj, Error **errp)
to bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qom: Add can_be_deleted callback to UserCreatableClassinclude/qom/object_interfaces.h qmp.c qom/object_interfaces.c+30 -02 replies
2/2hostmem: Prevent removing an in-use memory backendbackends/hostmem.c+14 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIgor MammedovAndreas Färber
SeriesR-b
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [Qemu-devel] [PATCH v6 0/2] Add generic can_be_deleted to UserCreatableClass.

The patchset adds a generic can_be_deleted callback to UserCreatableClass. It prevents removing a usercreatable object if the callback returns false.

Backends could implement the callback if it shoudn't be removed while it's in use.

Thank Peter Crosthwaite, Paolo Bonzini, Andreas Färber and Igor Mammedov for helping review.

ChangeLog:
V6:
Change prototype of user_creatable_can_be_deleted.
from bool user_creatable_can_be_deleted(Object *obj, Error **errp)
to bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp)

V5:
Use specific caster instead of dynamic cast in user_creatable_can_be_deleted.

V4:
Add function user_creatable_can_be_deleted to wrapper can_be_deleted method. Remove some unnecessary code.

V3:
Move the callback to the correct place: UserCreatableClass. Move the backend callback implementation to hostmem.c.

V2:
Make it generic, add the can_be_deleted callback to TypeInfo and TypeImpl. Implement the callback in hostmem-file.c and hostmem-ram.c.

V1:
Initial version, hard coded in object_del to prevent removing an in-use host memory backend.

Lin Ma (2):
qom: Add can_be_deleted callback to UserCreatableClass
hostmem: Prevent removing an in-use memory backend

 backends/hostmem.c              | 14 ++++++++++++++
 include/qom/object_interfaces.h | 13 +++++++++++++
 qmp.c                           |  5 +++++
 qom/object_interfaces.c         | 12 ++++++++++++
 4 files changed, 44 insertions(+)
Signature · 1 line
2.1.4