qemu-e2k/block/export/virtio-blk-handler.h
Xie Yongji 0862a087fd vduse-blk: Add serial option
Add a 'serial' option to allow user to specify this value
explicitly. And the default value is changed to an empty
string as what we did in "hw/block/virtio-blk.c".

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Message-Id: <20220614051532.92-6-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-06-24 17:07:06 +02:00

38 lines
1.1 KiB
C

/*
* Handler for virtio-blk I/O
*
* Copyright (C) 2022 Bytedance Inc. and/or its affiliates. All rights reserved.
*
* Author:
* Xie Yongji <xieyongji@bytedance.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*/
#ifndef VIRTIO_BLK_HANDLER_H
#define VIRTIO_BLK_HANDLER_H
#include "sysemu/block-backend.h"
#define VIRTIO_BLK_SECTOR_BITS 9
#define VIRTIO_BLK_SECTOR_SIZE (1ULL << VIRTIO_BLK_SECTOR_BITS)
#define VIRTIO_BLK_MAX_DISCARD_SECTORS 32768
#define VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS 32768
typedef struct {
BlockBackend *blk;
char *serial;
uint32_t logical_block_size;
bool writable;
} VirtioBlkHandler;
int coroutine_fn virtio_blk_process_req(VirtioBlkHandler *handler,
struct iovec *in_iov,
struct iovec *out_iov,
unsigned int in_num,
unsigned int out_num);
#endif /* VIRTIO_BLK_HANDLER_H */