/* then tell it to start listening */
if (!ndmp_connection_mover_listen(self->ndmp,
- for_writing? NDMP4_MOVER_MODE_READ : NDMP4_MOVER_MODE_WRITE,
- NDMP4_ADDR_TCP,
+ for_writing? NDMP9_MOVER_MODE_READ : NDMP9_MOVER_MODE_WRITE,
+ NDMP9_ADDR_TCP,
addrs)) {
set_error_from_ndmp(self);
return FALSE;
return FALSE;
}
- if (state != NDMP4_MOVER_STATE_LISTEN)
+ if (state != NDMP9_MOVER_STATE_LISTEN)
break;
/* back off a little bit to give the other side time to breathe,
}
/* double-check state */
- if (state != NDMP4_MOVER_STATE_ACTIVE) {
+ if (state != NDMP9_MOVER_STATE_ACTIVE) {
device_set_error(DEVICE(self),
g_strdup("mover did not enter the ACTIVE state as expected"),
DEVICE_STATUS_DEVICE_ERROR);
self->listen_addrs = NULL;
if (self->for_writing)
- mode = NDMP4_MOVER_MODE_READ;
+ mode = NDMP9_MOVER_MODE_READ;
else
- mode = NDMP4_MOVER_MODE_WRITE;
+ mode = NDMP9_MOVER_MODE_WRITE;
/* set up the new directtcp connection */
if (self->directtcp_conn)
}
if (self->for_writing)
- mode = NDMP4_MOVER_MODE_READ;
+ mode = NDMP9_MOVER_MODE_READ;
else
- mode = NDMP4_MOVER_MODE_WRITE;
+ mode = NDMP9_MOVER_MODE_WRITE;
if (!ndmp_connection_mover_connect(self->ndmp, mode, addrs)) {
set_error_from_ndmp(self);
/* if this is false, then the caller did not use use_connection correctly */
g_assert(self->directtcp_conn != NULL);
g_assert(self->ndmp == nconn->ndmp);
- g_assert(nconn->mode == NDMP4_MOVER_MODE_READ);
+ g_assert(nconn->mode == NDMP9_MOVER_MODE_READ);
if (!ndmp_connection_mover_get_state(self->ndmp,
&mover_state, &bytes_moved_before, NULL, NULL)) {
}
/* the mover had best be PAUSED right now */
- g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
+ g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED);
if (!ndmp_connection_mover_set_window(self->ndmp,
nconn->offset,
/* if this is false, then the caller did not use use_connection correctly */
g_assert(nconn != NULL);
g_assert(self->ndmp == nconn->ndmp);
- g_assert(nconn->mode == NDMP4_MOVER_MODE_WRITE);
+ g_assert(nconn->mode == NDMP9_MOVER_MODE_WRITE);
if (!ndmp_connection_mover_get_state(self->ndmp,
&mover_state, &bytes_moved_before, NULL, NULL)) {
}
/* the mover had best be PAUSED right now */
- g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
+ g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED);
if (!ndmp_connection_mover_set_window(self->ndmp,
nconn->offset,
if (read_block_size != 0 &&
((gsize)read_block_size < p_self->block_size ||
- (gsize)read_block_size > p_self->max_block_size))
+ (gsize)read_block_size > p_self->max_block_size)) {
+ device_set_error(p_self,
+ g_strdup_printf("Error setting READ-BLOCk-SIZE property to '%zu', it must be between %zu and %zu", read_block_size, p_self->block_size, p_self->max_block_size),
+ DEVICE_STATUS_DEVICE_ERROR);
return FALSE;
+ }
self->read_block_size = read_block_size;
char *device_node)
{
Device *rval;
- NdmpDevice * ndmp_rval;
g_assert(0 == strcmp(device_type, NDMP_DEVICE_NAME));
rval = DEVICE(g_object_new(TYPE_NDMP_DEVICE, NULL));
- ndmp_rval = (NdmpDevice *)rval;
device_open_device(rval, device_name, device_type, device_node);
return rval;