[sheepdog] [PATCH] sheep: notify vdi copies number before we create the vdi

Liu Yuan namei.unix at gmail.com
Thu Nov 29 05:55:05 CET 2012


On 11/27/2012 07:19 PM, levin li wrote:
> +static int notify_vdi_add(uint32_t vdi_id, uint32_t nr_copies)
> +{
> +	struct sd_req hdr;
> +	int ret = SD_RES_SUCCESS;
> +	char *buf;
> +
> +	sd_init_req(&hdr, SD_OP_NOTIFY_VDI_ADD);
> +	hdr.flags = SD_FLAG_CMD_WRITE;

flags isn't necessary.

Thanks,
Yuan
> +	hdr.data_length = sizeof(vdi_id) + sizeof(nr_copies);
> +
> +	buf = xmalloc(sizeof(vdi_id) + sizeof(nr_copies));
> +	memcpy(buf, &vdi_id, sizeof(vdi_id));
> +	memcpy(buf + sizeof(vdi_id), &nr_copies, sizeof(nr_copies));




More information about the sheepdog mailing list