All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Kamala Narasimhan <Kamala.Narasimhan@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH] xl: Special case tap/aio for disk validation
Date: Thu, 27 Jan 2011 15:17:01 +0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1101271506410.7277@kaball-desktop> (raw)
In-Reply-To: <4D407A06.1050902@gmail.com>

On Wed, 26 Jan 2011, Kamala Narasimhan wrote:
> 
> Current disk validation code will fail when the disk file path is prefixed with tap:aio:vhd in the disk configuration file option.  This patch special cases tap:aio validation.
> 
> Note:  It appears qcow/qcow2 file format does not work with the current tapdisk.  So, I am checking only for vhd file format.  If there are other formats to check also, let me know.
> 

This patch made me realize that we really need a specification for the
disk format syntax in the config file and a better xl parser to match it.
The syntax should be clear and at the same time backward compatible as
much as we can.
The followings are disk configurations supported in libxl and what they
mean:

- phy:/path/to/device
blkback is used as block backend, if blkback is missing from your dom0
kernel, this configuration will fail.
A block device must be specified because blkback cannot handle files by
itself.
The format must be raw.

- file:/path/to/file
tapdisk2 is used as block backend, if tapdisk2 is missing qemu is used
instead.
Both a file or a block device can be specified.
The format is raw.

- tap:/path/to/file
same as file:

- tap:qcow:/path/to/file
qemu is used as block backend because tapdisk2 has broken qcow support.
Both a file or a block device can be specified.
The format is qcow.

- tap:qcow2:/path/to/file
qemu is used as block backend because tapdisk2 has broken qcow2 support.
Both a file or a block device can be specified.
The format is qcow2.

- tap:vhd:/path/to/file
tapdisk2 is used as block backend, if tapdisk2 is missing qemu is used
instead.
Both a file or a block device can be specified.
The format is vhd.


The previous cases cover all the supported disk formats, but for
backward compatibility we also support the following disk configurations:

- tap:aio:, tap:aio:qcow:, tap:aio:qcow2:, tap:aio:vhd:
considering that aio is just an implementation detail, it should not be
part of a user exposed interface, in the xl/libxenlight context aio is
miningless. aio: should just be ignored by the xl config parser.

- tap:tapdisk:
exactly as for aio:, tapdisk: should just be ignored.

- tap:ioemu:
exactly as for aio: and tapdisk:, ioemu: should just be ignored.





Following these notes, we need:

- a document describing this in full details.

- A fix for parse_disk_config.
The new algorithm should assume format=raw and ignore tap:, tap2:, aio:,
tapdisk:, ioemu:, until it gets to a real disk format (qcow:, qcow2:,
vhd:) or the file name.

- A fix for validate_virtual_disk.

- A fix for the usage of aio in libxl: aio is currently considered a
type and should be renamed PHYSTYPE_RAW.

- A fix for libxl_device_disk_add so that QCOW and QCOW2 are
handled by qemu.

All these fixes don't have to be separate patches, some of them might
be collapsed in a sigle patch.

The last fix should be something like this:

---


diff -r 7873885ec74d tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Jan 27 09:37:19 2011 +0000
+++ b/tools/libxl/libxl.c	Thu Jan 27 14:56:51 2011 +0000
@@ -917,8 +919,6 @@ int libxl_device_disk_add(libxl_ctx *ctx
             /* let's pretend is tap:aio for the moment */
             disk->phystype = PHYSTYPE_AIO;
         case PHYSTYPE_AIO:
-        case PHYSTYPE_QCOW:
-        case PHYSTYPE_QCOW2:
         case PHYSTYPE_VHD:
             if (libxl__blktap_enabled(&gc)) {
                 const char *dev = libxl__blktap_devpath(&gc,
@@ -939,6 +939,8 @@ int libxl_device_disk_add(libxl_ctx *ctx
 
                 break;
             }
+        case PHYSTYPE_QCOW:
+        case PHYSTYPE_QCOW2:
             flexarray_append(back, "params");
             flexarray_append(back, libxl__sprintf(&gc, "%s:%s",
                           libxl__device_disk_string_of_phystype(disk->phystype), disk->physpath));

  reply	other threads:[~2011-01-27 15:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 19:46 [PATCH] xl: Special case tap/aio for disk validation Kamala Narasimhan
2011-01-27 15:17 ` Stefano Stabellini [this message]
2011-01-27 15:22   ` Ian Jackson
2011-01-27 15:35     ` Ian Campbell
2011-01-27 16:23       ` Ian Jackson
2011-01-27 17:46         ` Kamala Narasimhan
2011-01-27 17:59           ` Stefano Stabellini
2011-01-27 20:14             ` Kamala Narasimhan
2011-01-28  9:27               ` Ian Campbell
2011-01-28 12:51                 ` Stefano Stabellini
2011-01-27 17:53         ` Ian Campbell
2011-01-27 17:43       ` Kamala Narasimhan
2011-01-27 16:08   ` Philipp Hahn
2011-01-27 17:31   ` Kamala Narasimhan
2011-01-27 17:54     ` Stefano Stabellini
2011-01-27 18:35       ` Ian Jackson
2011-01-27 18:46         ` Ian Campbell
2011-01-27 18:46         ` Stefano Stabellini
2011-01-28  1:56       ` Kamala Narasimhan
2011-01-28 10:06         ` Ian Campbell
2011-01-28 10:25           ` Ian Campbell
2011-01-28 12:02             ` Ian Jackson
2011-01-28 13:19           ` Stefano Stabellini
2011-01-28 13:21             ` Ian Campbell
2011-01-28 13:28               ` Stefano Stabellini
2011-01-28 13:29                 ` Ian Campbell
2011-01-28 15:11                 ` Kamala Narasimhan
2011-01-28 14:43           ` Kamala Narasimhan
2011-01-28 17:22           ` Kamala Narasimhan
2011-01-28 19:10           ` Kamala Narasimhan
2011-01-31 17:28             ` Stefano Stabellini
2011-01-28 13:11         ` Stefano Stabellini
2011-01-28 17:55         ` Ian Jackson
2011-01-27 22:15   ` Kamala Narasimhan
2011-01-28 12:57     ` xl: drdb support Stefano Stabellini
2011-01-28 16:48       ` Shriram Rajagopalan
2011-01-28 17:58       ` Ian Jackson
2011-01-28 18:03         ` Stefano Stabellini
2011-01-28 18:06           ` Ian Jackson
2011-01-28 18:12             ` Stefano Stabellini
2011-01-28 18:16               ` Ian Jackson
2011-01-28 21:41           ` James Harper
2011-01-29  1:12       ` James Harper
2011-01-29 12:53         ` RE: drdb support / xend locking for live migration Pasi Kärkkäinen
2011-01-28 16:03     ` [PATCH] xl: Special case tap/aio for disk validation Jim Fehlig
2011-01-28 16:30       ` Stefano Stabellini
2011-01-28 16:52         ` Jim Fehlig
2011-01-28 17:51           ` Stefano Stabellini
2011-01-28 17:53       ` Ian Jackson
2011-01-27 22:31   ` M A Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1101271506410.7277@kaball-desktop \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Kamala.Narasimhan@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.