OSDN Git Service

virtio-mem: simplify high-level plug handling in Sub Block Mode
authorDavid Hildenbrand <david@redhat.com>
Wed, 2 Jun 2021 18:57:16 +0000 (20:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 8 Jul 2021 11:49:02 +0000 (07:49 -0400)
commitf4cf803dff4c87656cf25d9c5ec3cf828839efec
tree3a70246dc1dbb2bd4c4a88ce3549b5fc5fbbd96d
parent49d42872d520365df619e5092ff7fb225e3079b3
virtio-mem: simplify high-level plug handling in Sub Block Mode

Let's simplify high-level memory block selection when plugging in Sub
Block Mode.

No need for two separate loops when selecting memory blocks for plugging
memory. Avoid passing the "online" state by simply obtaining the state
in virtio_mem_sbm_plug_any_sb().

Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20210602185720.31821-4-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c