diff --git a/virttest/qemu_devices/qcontainer.py b/virttest/qemu_devices/qcontainer.py index d1bdfcd5a8..c1cd0c203a 100644 --- a/virttest/qemu_devices/qcontainer.py +++ b/virttest/qemu_devices/qcontainer.py @@ -1965,6 +1965,9 @@ def chardev_define_by_params(self, chardev_id, params, file_name=None): chardev_param.update( {'debug': params.get('chardev_debug'), 'name': params.get('chardev_name')}) + elif 'ringbuf' in backend: + chardev_param.update( + {'ringbuf_write_size': int(params.get('ringbuf_write_size'))}) return qdevices.CharDevice(chardev_param, chardev_id) def cdroms_define_by_params(self, name, image_params, media=None, diff --git a/virttest/qemu_devices/qdevices.py b/virttest/qemu_devices/qdevices.py index b442754bdd..3fa294160f 100644 --- a/virttest/qemu_devices/qdevices.py +++ b/virttest/qemu_devices/qdevices.py @@ -1294,6 +1294,9 @@ def get_supported_options(self, backend): special_opts = ["host", "port", "localaddr", "localport", "ipv4", "ipv6"] + elif backend == 'ringbuf': + special_opts = ["ringbuf_write_size"] + return set(common_opts + special_opts) def format_params(self, params): @@ -1364,6 +1367,11 @@ def get_qmp_args(self): args["backend"]["data"] = {"device": self.get_param("path")} return args + if self.params.get("backend") in "ringbuf": + args["backend"]["data"] = { + "size": self.get_param("ringbuf_write_size")} + return args + raise DeviceError("chardev '%s' not support hotplug" % self.params.get("backend"))