Commit Graph

7 Commits

Author SHA1 Message Date
Peter Krempa
7ee3df5775 qemu: block: refactor and rename qemuBuildGlusterDriveJSONHosts
New name is qemuBlockStorageSourceBuildHostsJSONSocketAddress since it
formats the JSON object in accordance with qemu's SocketAddress type.

Since the new naming in qemu uses 'inet' instead of 'tcp' add a
compatibility layer for gluster which uses the old name.
2017-07-14 16:05:46 +02:00
Peter Krempa
bb8ebe69dd qemu: block: Refactor and rename qemuGetDriveSourceProps
Rename it to qemuBlockStorageSourceGetBackendProps and refactor it to
return the JSON object instead of filling a pointer since now it's
always expected to return data.
2017-07-14 16:05:46 +02:00
Peter Krempa
7677f8a7d9 qemu: Move qemuGetDriveSourceProps to qemu_block
Pure code movement except for the tweaks necessary for cross-usage.
2017-07-14 16:05:46 +02:00
Nikolay Shirokovskiy
dd8e40790b qemu: take current async job into account in qemuBlockNodeNamesDetect
Becase it can be called during migration out (namely on cancelling
blockjobs).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2017-04-27 14:38:29 +02:00
Peter Krempa
51c4b744d8 qemu: block: Add code to fetch block node data by node name
To allow updating stats based on the node name, add a helper function
that will fetch the required data from 'query-named-block-nodes' and
return it in hash table for easy lookup.
2017-03-27 10:35:19 +02:00
Peter Krempa
0feebab2c4 qemu: block: Add code to detect node names when necessary
Detect the node names when setting block threshold and when reconnecting
or when they are cleared when a block job finishes. This operation will
become a no-op once we fully support node names.
2017-03-27 10:35:19 +02:00
Peter Krempa
dbad8f8aee qemu: block: Add code to allow detection of auto-allocated node names
qemu for some time already sets node names automatically for the block
nodes. This patch adds code that attempts a best-effort detection of the
node names for the backing chain from the output of
'query-named-block-nodes'. The only drawback is that the data provided
by qemu needs to be matched by the filename as seen by qemu and thus
if two disks share a single backing store file the detection won't work.

This will allow us to use qemu commands such as
'block-set-write-threshold' which only accepts node names.

In this patch only the detection code is added, it will be used later.
2017-03-27 10:35:19 +02:00