1/**
2 * \file
3 * \brief block_server client process.
4 */
5
6/*
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#include <stdio.h>
16
17#include <barrelfish/barrelfish.h>
18
19#include <if/block_service_defs.h>
20
21#include <bulk_transfer/bulk_transfer.h>
22#include <bulk_transfer/bulk_allocator.h>
23
24#include "bs_connector.h"
25#include "benchmark.h"
26
27struct bs_connection service;
28
29/**
30 * \brief Main function for the network block server client.
31 *
32 */
33int main(int argc, char *argv[])
34{
35    debug_printf("block service user started...\n");
36
37    errval_t err;
38
39    struct bulk_channel_callbacks *rx_cb = bench_get_rx_cb();
40    struct bulk_channel_callbacks *tx_cb = bench_get_tx_cb();
41    err = bs_service_connect(&service, rx_cb, tx_cb);
42    if (err_is_fail(err)) {
43        USER_PANIC_ERR(err, "could not connect to the block service.\n");
44        exit(EXIT_FAILURE);
45    }
46
47    err = bench_init(&service);
48    assert(!err_is_fail(err));
49
50    err = bench_run();
51    if (err_is_fail(err)) {
52        USER_PANIC_ERR(err, "failure while running benchmark\n");
53        exit(EXIT_FAILURE);
54    }
55
56    while(true);
57
58}
59
60