WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel]xl create PV guest with qcow/qcow2 disk images fail

On Thu, 2011-10-27 at 04:08 +0100, Chun Yan Liu wrote:
> Thank you all. Have tested pv-grub and qemu-nbd trick. Both work. 
> 
> Following is the test patch

I'm afraid that something has horribly mangled your patch (you can see
some of what I received quoted below). Documentation/SubmittingPatches
in the Linux source tree has a bunch of hints for various MUAs. Or you
could consider usign the "hg email" extension
(http://wiki.xen.org/xenwiki/SubmittingXenPatches has a good description
of this).

Ian.


>  that starts qemu-nbd to mount a non-raw qdisk in domain0, so that it
> can work with qcow/qcow2 disk image and using pygrub. I don't know if
> we need such a patch, or prefer to ask user to use pv-grub instead.
> Just post here for any chance of use. Thanks. 
> 
>   
> 
> Patch description: start qemu-nbd to mount non-raw qdisk in dom0 so
> that xl can create PV guest with qcow/qcow2 disk image and using
> pygrub. 
> 
> Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx> 
> 
> 
> diff -r b4cf57bbc3fb tools/libxl/libxl.c 
> 
> --- a/tools/libxl/libxl.cThu Oct 20 15:24:46 2011 +0800 
> 
> +++ b/tools/libxl/libxl.cThu Oct 20 15:48:45 2011 +0800 
> 
> @@ -1078,12 +1078,41 @@ 
> 
>      return rc; 
> 
>  } 
> 
>   
> 
> +static char * nbd_mount_disk(libxl_device_disk *disk) 
> 
> +{ 
> 
> +    int i; 
> 
> +    int nbds_max = 16; 
> 
> +    char *nbd_dev, *cmd; 
> 
> +    char *ret = NULL; 
> 
> + 
> 
> +    for (i = 0; i < nbds_max; i++) { 
> 
> +        asprintf(&nbd_dev,"/dev/nbd%d", i); 
> 
> +        asprintf(&cmd, "qemu-nbd -c %s %s", nbd_dev,
> disk->pdev_path); 
> 
> +        if (system(cmd) == 0) { 
> 
> +            ret = strdup(nbd_dev); 
> 
> +            break; 
> 
> +        } 
> 
> +    } 
> 
> + 
> 
> +    return ret; 
> 
> +} 
> 
> + 
> 
> +static int nbd_unmount_disk(char *diskpath) { 
> 
> +    char *cmd; 
> 
> +    asprintf(&cmd, "qemu-nbd -d %s", diskpath); 
> 
> +    if (system(cmd) == 0) 
> 
> +        return 0; 
> 
> +    else 
> 
> +        return ERROR_FAIL; 
> 
> +} 
> 
> + 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel