-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/lwnbd-server.c : fix conccurency issue
- Loading branch information
Showing
34 changed files
with
262 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ LWNBD_DEBUG=1 | |
NBD_URI=1 | ||
TARGET_IP=192.168.1.10 | ||
MAKE_SILENT=1 | ||
#MAKE_FATAL=1 | ||
WORKSPACE="../workspace/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* | ||
*/ | ||
|
||
#ifndef INCLUDE_LWNBD_COMMON_H_ | ||
#define INCLUDE_LWNBD_COMMON_H_ | ||
|
||
#include "config.h" | ||
#include <stdint.h> | ||
|
||
/* | ||
* | ||
*/ | ||
|
||
/* experimental */ | ||
//#ifdef PLUGIN_COMMAND | ||
extern struct lwnbd_plugin_t *command_plugin_init(void); | ||
struct lwnbd_command | ||
{ | ||
char *name; | ||
char *desc; | ||
int (*cmd)(int argc, char **argv, void *result, int64_t *size); | ||
}; | ||
//#endif | ||
|
||
//#ifdef PLUGIN_MEMORY | ||
extern struct lwnbd_plugin_t *memory_plugin_init(void); | ||
struct memory_config | ||
{ | ||
intptr_t base; | ||
intptr_t size; | ||
char name[32]; | ||
char desc[64]; /* export description */ | ||
/* TODO readonly ? */ | ||
}; | ||
//#endif | ||
|
||
//#ifdef PLUGIN_PCMSTREAM | ||
|
||
struct pcmstream_config | ||
{ | ||
char name[32]; | ||
char desc[64]; /* export description */ | ||
// char format[32]; | ||
int rate; /** output frequency in hz */ | ||
int bits; /** bits per sample (8, 16) */ | ||
int channels; /** output channels (1, 2) */ | ||
char volume; | ||
/* input => readonly or output => writeonly */ | ||
}; | ||
//#endif | ||
|
||
extern struct lwnbd_plugin_t *file_plugin_init(void); | ||
extern struct lwnbd_server *nbd_server_init(void); | ||
|
||
#endif /* INCLUDE_LWNBD_COMMON_H_ */ |
Oops, something went wrong.