mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-21 21:25:19 +00:00
virtio-devices: fs: avoid unnecessary string allocation
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
f3b0f59646
commit
11c593e3b9
@ -398,8 +398,8 @@ impl Fs {
|
||||
|
||||
// Create virtio-fs device configuration.
|
||||
let mut config = VirtioFsConfig::default();
|
||||
let tag_bytes_vec = tag.to_string().into_bytes();
|
||||
config.tag[..tag_bytes_vec.len()].copy_from_slice(tag_bytes_vec.as_slice());
|
||||
let tag_bytes_slice = tag.as_bytes();
|
||||
config.tag[..tag_bytes_slice.len()].copy_from_slice(tag_bytes_slice);
|
||||
config.num_request_queues = req_num_queues as u32;
|
||||
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user