Changeset 372df8f in mainline for uspace/lib/c/generic/vbd.c


Ignore:
Timestamp:
2015-10-09T07:00:23Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ecfc62
Parents:
0bde8523
Message:

Let VBD handle unlabeled devices too. Now volsrv only cares about partitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/vbd.c

    r0bde8523 r372df8f  
    4343#include <vbd.h>
    4444
     45static int vbd_get_ids_internal(vbd_t *, sysarg_t, sysarg_t, sysarg_t **,
     46    size_t *);
     47
    4548int vbd_create(vbd_t **rvbd)
    4649{
     
    8588}
    8689
    87 int vbd_disk_add(vbd_t *vbd, service_id_t disk_sid)
    88 {
    89         async_exch_t *exch;
    90 
    91         exch = async_exchange_begin(vbd->sess);
    92         sysarg_t rc = async_req_1_0(exch, VBD_DISK_ADD, disk_sid);
    93         async_exchange_end(exch);
    94 
    95         return (int)rc;
    96 }
    97 
    98 int vbd_disk_remove(vbd_t *vbd, service_id_t disk_sid)
    99 {
    100         async_exch_t *exch;
    101 
    102         exch = async_exchange_begin(vbd->sess);
    103         sysarg_t rc = async_req_1_0(exch, VBD_DISK_REMOVE, disk_sid);
    104         async_exchange_end(exch);
    105 
    106         return (int)rc;
     90/** Get list of partitions as array of service IDs.
     91 *
     92 * @param vbd Virtual block device service
     93 * @param data Place to store pointer to array
     94 * @param count Place to store length of array (number of entries)
     95 *
     96 * @return EOK on success or negative error code
     97 */
     98int vbd_get_disks(vbd_t *vbd, service_id_t **data, size_t *count)
     99{
     100        return vbd_get_ids_internal(vbd, VBD_GET_DISKS, 0, data, count);
    107101}
    108102
Note: See TracChangeset for help on using the changeset viewer.