]> Git Repo - qemu.git/commitdiff
qmp: make block job command naming consistent
authorStefan Hajnoczi <[email protected]>
Wed, 11 Apr 2012 15:27:10 +0000 (16:27 +0100)
committerLuiz Capitulino <[email protected]>
Mon, 23 Apr 2012 16:02:01 +0000 (13:02 -0300)
The block streaming and job commands used '_' instead of '-' for reasons
of compatibility with libvirt, which already included support for the
'_' naming.  However, the semantics of block_job_cancel have changed and
libvirt now needs to handle the new semantics.

Since the old semantics were never in a QEMU release we can still rename
the commands to use '-' instead of '_'.  Libvirt is also happy because
the new name can be used to distinguish QEMU binaries that support the
latest block-job-cancel semantics from those that include a downstream
block_job_cancel command.

Therefore, let's apply the QAPI/QMP naming rules to the block streaming
and job commands.  QEMU 1.1 will be the first release with these
commands so no upstream users can break.

Note that HMP commands are left with '_' because that is the convention
there.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
qapi-schema.json
qmp-commands.hx
tests/qemu-iotests/030

index ace55f397ab5459f5354f7618b6eb7dc482c9bbb..64998959db2e360cfccb2039c9e5bdec22033f18 100644 (file)
   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
 
-# @block_stream:
+##
+# @block-stream:
 #
 # Copy data from a backing file into a block device.
 #
 # backing file has been copied.  This command returns immediately once streaming
 # has started.  The status of ongoing block streaming operations can be checked
 # with query-block-jobs.  The operation can be stopped before it has completed
-# using the block_job_cancel command.
+# using the block-job-cancel command.
 #
 # If a base file is specified then sectors are not copied from that base file and
 # its backing chain.  When streaming completes the image file will have the base
 #
 # Since: 1.1
 ##
-{ 'command': 'block_stream', 'data': { 'device': 'str', '*base': 'str' } }
+{ 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str' } }
 
 ##
-# @block_job_set_speed:
+# @block-job-set-speed:
 #
 # Set maximum speed for a background block operation.
 #
 #
 # Since: 1.1
 ##
-{ 'command': 'block_job_set_speed',
+{ 'command': 'block-job-set-speed',
   'data': { 'device': 'str', 'value': 'int' } }
 
 ##
-# @block_job_cancel:
+# @block-job-cancel:
 #
 # Stop an active block streaming operation.
 #
 #
 # Since: 1.1
 ##
-{ 'command': 'block_job_cancel', 'data': { 'device': 'str' } }
+{ 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
 
 ##
 # @ObjectTypeInfo:
index c09ee859a1854f21c8aa3657c7b536da22abdc8d..f97233223d09336e6040239c80a6914c731df28a 100644 (file)
@@ -687,19 +687,19 @@ Example:
 EQMP
 
     {
-        .name       = "block_stream",
+        .name       = "block-stream",
         .args_type  = "device:B,base:s?",
         .mhandler.cmd_new = qmp_marshal_input_block_stream,
     },
 
     {
-        .name       = "block_job_set_speed",
+        .name       = "block-job-set-speed",
         .args_type  = "device:B,value:o",
         .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
     },
 
     {
-        .name       = "block_job_cancel",
+        .name       = "block-job-cancel",
         .args_type  = "device:B",
         .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
     },
index 1faf984200372b5bd32f80e8766d28b752b31fd4..978fd82224f031e17f789dca0a42e4808fbfd071 100755 (executable)
@@ -49,7 +49,7 @@ class TestSingleDrive(ImageStreamingTestCase):
     def test_stream(self):
         self.assert_no_active_streams()
 
-        result = self.vm.qmp('block_stream', device='drive0')
+        result = self.vm.qmp('block-stream', device='drive0')
         self.assert_qmp(result, 'return', {})
 
         completed = False
@@ -68,7 +68,7 @@ class TestSingleDrive(ImageStreamingTestCase):
                          'image file not fully populated after streaming')
 
     def test_device_not_found(self):
-        result = self.vm.qmp('block_stream', device='nonexistent')
+        result = self.vm.qmp('block-stream', device='nonexistent')
         self.assert_qmp(result, 'error/class', 'DeviceNotFound')
 
 class TestStreamStop(ImageStreamingTestCase):
@@ -90,14 +90,14 @@ class TestStreamStop(ImageStreamingTestCase):
 
         self.assert_no_active_streams()
 
-        result = self.vm.qmp('block_stream', device='drive0')
+        result = self.vm.qmp('block-stream', device='drive0')
         self.assert_qmp(result, 'return', {})
 
         time.sleep(1)
         events = self.vm.get_qmp_events(wait=False)
         self.assertEqual(events, [], 'unexpected QMP event: %s' % events)
 
-        self.vm.qmp('block_job_cancel', device='drive0')
+        self.vm.qmp('block-job-cancel', device='drive0')
         self.assert_qmp(result, 'return', {})
 
         cancelled = False
@@ -129,10 +129,10 @@ class TestSetSpeed(ImageStreamingTestCase):
     def perf_test_set_speed(self):
         self.assert_no_active_streams()
 
-        result = self.vm.qmp('block_stream', device='drive0')
+        result = self.vm.qmp('block-stream', device='drive0')
         self.assert_qmp(result, 'return', {})
 
-        result = self.vm.qmp('block_job_set_speed', device='drive0', value=8 * 1024 * 1024)
+        result = self.vm.qmp('block-job-set-speed', device='drive0', value=8 * 1024 * 1024)
         self.assert_qmp(result, 'return', {})
 
         completed = False
This page took 0.03751 seconds and 4 git commands to generate.