* [Qemu-devel] [PATCH] sheepdog: support creating images on remote hosts
@ 2011-01-27 16:33 MORITA Kazutaka
2011-01-28 13:08 ` [Qemu-devel] " Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: MORITA Kazutaka @ 2011-01-27 16:33 UTC (permalink / raw)
To: kwolf; +Cc: sheepdog, qemu-devel, kvm
This patch parses the input filename in sd_create(), and enables us
specifying a target server to create sheepdog images.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
---
block/sheepdog.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index e62820a..a54e0de 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1294,12 +1294,23 @@ static int do_sd_create(char *filename, int64_t vdi_size,
static int sd_create(const char *filename, QEMUOptionParameter *options)
{
int ret;
- uint32_t vid = 0;
+ uint32_t vid = 0, base_vid = 0;
int64_t vdi_size = 0;
char *backing_file = NULL;
+ BDRVSheepdogState s;
+ char vdi[SD_MAX_VDI_LEN], tag[SD_MAX_VDI_TAG_LEN];
+ uint32_t snapid;
strstart(filename, "sheepdog:", (const char **)&filename);
+ memset(&s, 0, sizeof(s));
+ memset(vdi, 0, sizeof(vdi));
+ memset(tag, 0, sizeof(tag));
+ if (parse_vdiname(&s, filename, vdi, &snapid, tag) < 0) {
+ error_report("invalid filename\n");
+ return -EINVAL;
+ }
+
while (options && options->name) {
if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
vdi_size = options->value.n;
@@ -1338,11 +1349,11 @@ static int sd_create(const char *filename, QEMUOptionParameter *options)
return -EINVAL;
}
- vid = s->inode.vdi_id;
+ base_vid = s->inode.vdi_id;
bdrv_delete(bs);
}
- return do_sd_create((char *)filename, vdi_size, vid, NULL, 0, NULL, NULL);
+ return do_sd_create((char *)vdi, vdi_size, base_vid, &vid, 0, s.addr, s.port);
}
static void sd_close(BlockDriverState *bs)
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] sheepdog: support creating images on remote hosts
2011-01-27 16:33 [Qemu-devel] [PATCH] sheepdog: support creating images on remote hosts MORITA Kazutaka
@ 2011-01-28 13:08 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-01-28 13:08 UTC (permalink / raw)
To: MORITA Kazutaka; +Cc: sheepdog, qemu-devel, kvm
Am 27.01.2011 17:33, schrieb MORITA Kazutaka:
> This patch parses the input filename in sd_create(), and enables us
> specifying a target server to create sheepdog images.
>
> Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-28 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-27 16:33 [Qemu-devel] [PATCH] sheepdog: support creating images on remote hosts MORITA Kazutaka
2011-01-28 13:08 ` [Qemu-devel] " Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).