]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-mem: factor out adding/removing memory from Linux
authorDavid Hildenbrand <david@redhat.com>
Thu, 12 Nov 2020 13:38:10 +0000 (14:38 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 18 Dec 2020 21:14:27 +0000 (16:14 -0500)
commit0f6a8100bdd1dfb67cc2a51b3fa2c721474478c2
treeef970a2b1771710e0786a31bd7107d7045104541
parentbefa93b51aa18a6671801d8bcf42f8792a64716d
virtio-mem: factor out adding/removing memory from Linux

Let's use wrappers for the low-level functions that dev_dbg/dev_warn
and work on addr + size, such that we can reuse them for adding/removing
in other granularity.

We only warn when adding memory failed, because that's something to pay
attention to. We won't warn when removing failed, we'll reuse that in
racy context soon (and we do have proper BUG_ON() statements in the
current cases where it must never happen).

Reviewed-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20201112133815.13332-25-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c