block: Accept node-name for drive-backup

In order to remove the necessity to use BlockBackend names in the
external API, we want to allow node-names everywhere. This converts
drive-backup and the corresponding transaction action to accept a
node-name without lifting the restriction that we're operating at a root
node.

In case of an invalid device name, the command returns the GenericError
error class now instead of DeviceNotFound, because this is what
qmp_get_root_bs() returns.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Kevin Wolf committed 2016-09-05 19:06:47 +02:00
1 parent 7b5dca3f02
commit b7e4fa2242
4 files changed
+14 -35

No files matched your search

+2 -5
View File
@@ -134,10 +134,7 @@ class TestSingleDrive(iotests.QMPTestCase):
def do_test_device_not_found(self, cmd, **args):
result = self.vm.qmp(cmd, **args)
if cmd == 'drive-backup':
self.assert_qmp(result, 'error/class', 'DeviceNotFound')
else:
self.assert_qmp(result, 'error/class', 'GenericError')
self.assert_qmp(result, 'error/class', 'GenericError')
def test_device_not_found(self):
self.do_test_device_not_found('drive-backup', device='nonexistent',
@@ -371,7 +368,7 @@ class TestSingleTransaction(iotests.QMPTestCase):
'sync': 'full' },
}
])
self.assert_qmp(result, 'error/class', 'DeviceNotFound')
self.assert_qmp(result, 'error/class', 'GenericError')
result = self.vm.qmp('transaction', actions=[{
'type': 'blockdev-backup',