Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
qemu.5922
0186-9pfs-factor-out-virtio_pdu_-un-mars.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0186-9pfs-factor-out-virtio_pdu_-un-mars.patch of Package qemu.5922
From d4c42375f89436966f69677eab6497f959847148 Mon Sep 17 00:00:00 2001 From: Wei Liu <wei.liu2@citrix.com> Date: Thu, 3 Dec 2015 12:40:28 +0000 Subject: [PATCH] 9pfs: factor out virtio_pdu_{,un}marshal Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> (cherry picked from commit fe9fa96d7c83efc1457bd6a5b07aab7550c6d197) [BR: Fix and/or infrastructure for BSC#1020427 CVE-2016-9602] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/9pfs/virtio-9p-device.c | 14 ++++++++++++++ hw/9pfs/virtio-9p.c | 6 ++---- hw/9pfs/virtio-9p.h | 5 +++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 6b233c185d..d071924c64 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -159,6 +159,20 @@ static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp) g_free(s->tag); } +ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, + const char *fmt, va_list ap) +{ + return v9fs_iov_vmarshal(pdu->elem.in_sg, pdu->elem.in_num, + offset, 1, fmt, ap); +} + +ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, + const char *fmt, va_list ap) +{ + return v9fs_iov_vunmarshal(pdu->elem.out_sg, pdu->elem.out_num, + offset, 1, fmt, ap); +} + /* virtio-9p device */ static Property virtio_9p_properties[] = { diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 4e02b552ab..b095a9b369 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -43,8 +43,7 @@ ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...) va_list ap; va_start(ap, fmt); - ret = v9fs_iov_vmarshal(pdu->elem.in_sg, pdu->elem.in_num, - offset, 1, fmt, ap); + ret = virtio_pdu_vmarshal(pdu, offset, fmt, ap); va_end(ap); return ret; @@ -56,8 +55,7 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...) va_list ap; va_start(ap, fmt); - ret = v9fs_iov_vunmarshal(pdu->elem.out_sg, pdu->elem.out_num, - offset, 1, fmt, ap); + ret = virtio_pdu_vunmarshal(pdu, offset, fmt, ap); va_end(ap); return ret; diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index d6f3ac08a7..e298949fde 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -323,6 +323,11 @@ extern int v9fs_name_to_path(V9fsState *s, V9fsPath *dirpath, ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...); ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...); +ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, + const char *fmt, va_list ap); +ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, + const char *fmt, va_list ap); + #define TYPE_VIRTIO_9P "virtio-9p-device" #define VIRTIO_9P(obj) \ OBJECT_CHECK(V9fsState, (obj), TYPE_VIRTIO_9P)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor