All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Scott <dave.scott@eu.citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: libvirt, libxl and QDISKs
Date: Fri, 26 Apr 2013 11:37:06 +0100	[thread overview]
Message-ID: <517A58D2.6090205@eu.citrix.com> (raw)
In-Reply-To: <517A079B.60503@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1798 bytes --]

On 26/04/13 05:50, Jim Fehlig wrote:
> Jim Fehlig wrote:
>> Ian Campbell wrote:
>>
>>> On Thu, 2013-04-25 at 14:22 +0100, Dave Scott wrote:
>>>
>>>
>>>> On 25/04/13 13:43, Ian Campbell wrote:
>>>>
>>>>
>>>
>>>
>>>> It looks like we could define a "qdisk" driverName.
>>>>
>>>>
>>> Yes, I think this would work. WRT to your comment below it looks like
>>> other libvirt drivers call this driver "qemu".
>>>
>>>
>>
>> IMO, we should just extend the above to map driverName 'qemu' to backend
>> 'qdisk'.  But what about the formats?  I though qdisk could handle all
>> of them, particularly with qemu-upstream, even vmdk?
>>
>
> Something like the attached, which seems to work well for me when
> specifying driverName = qemu, e.g.
>
>      <disk type='file' device='disk'>
>        <driver name='qemu'/>
>        <source file='/var/lib/xen/images/sles11sp2-pv/disk0.raw'/>
>        <target dev='xvda' bus='xen'/>
>      </disk>

This also works for me!

On a related note, what do you think about the attached patch? It allows 
the user to select a non-default qemu via the <emulator> element. My 
domain XML looked like this:

   <devices>
     <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
     <disk device="disk" type="network">
       <driver name='qemu'/>
       <source protocol="rbd" name="rbd:rbd/ubuntu1204.img"/>
       <target dev="hda"/>
     </disk>
     <graphics type="vnc" port="-1" autoport="yes" listen="0.0.0.0"/>
   </devices>

Now that upstream qemu is the default in xen-4.3, it seems useful to be 
able to select the traditional qemu for older VMs.

Also I backported this to my xen-4.2 system and used this patch + your 
patch + the previous 'stat()' fix to successfully start a VM on ceph 
storage via libvirt + libxl (my quest is almost complete!)

Cheers,
Dave



[-- Attachment #2: libxl-make-emulator.patch --]
[-- Type: text/x-patch, Size: 1378 bytes --]

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index f549a5d..abbd3c0 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -811,6 +811,30 @@ libxlMakeCapabilities(libxl_ctx *ctx)
 }
 
 int
+libxlMakeEmulator(virDomainDefPtr def, libxl_domain_config *d_config)
+{
+    /* No explicit override means use the default */
+    if (!def->emulator) {
+        return 0;
+    }
+    if (strstr(def->emulator, "/qemu-system-")) {
+        d_config->b_info.device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+        return 0;
+    }
+    if (strstr(def->emulator, "/qemu-dm")) {
+        d_config->b_info.device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+        return 0;
+    }
+    virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("libxenlight doesn't support emulator '%s'"),
+                   def->emulator);
+    return -1;
+}
+
+
+int
 libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
                        virDomainDefPtr def, libxl_domain_config *d_config)
 {
@@ -834,6 +858,10 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         goto error;
     }
 
+    if (libxlMakeEmulator(def, d_config) < 0) {
+        goto error;
+    }
+
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
     d_config->on_crash = def->onCrash;

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-04-26 10:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 14:22 libvirt, libxl and QDISKs David Scott
2013-04-24 15:55 ` Stefano Stabellini
2013-04-25  8:55 ` Ian Campbell
2013-04-25 10:36   ` George Dunlap
2013-04-25 11:33     ` Ian Campbell
2013-04-25 11:55       ` Stefano Stabellini
2013-04-25 11:57         ` Ian Campbell
2013-04-25 12:12           ` David Scott
2013-04-25 12:43             ` Ian Campbell
2013-04-25 13:22               ` David Scott
2013-04-25 13:56                 ` Ian Campbell
2013-04-26  1:27                   ` Jim Fehlig
2013-04-26  4:50                     ` Jim Fehlig
2013-04-26 10:37                       ` David Scott [this message]
2013-04-26 23:44                         ` Jim Fehlig
     [not found]                         ` <517B1170.4020300@suse.com>
2013-04-29  9:41                           ` David Scott
2013-04-26  8:49                     ` Ian Campbell
2013-04-26 10:10                     ` Stefano Stabellini
2013-04-26 10:13                       ` Ian Campbell
2013-04-26 10:28                         ` Stefano Stabellini
2013-04-26 11:31                       ` Marek Marczykowski
2013-04-26 11:40                         ` Ian Campbell
2013-04-26 11:48                           ` Stefano Stabellini
2013-04-26 13:27                             ` Ian Campbell
2013-04-26 17:10                               ` Stefano Stabellini
2013-04-29  8:23                                 ` Ian Campbell
2013-04-29 10:07                                   ` Stefano Stabellini
2013-04-26 11:50                           ` Marek Marczykowski
2013-04-29 21:00                             ` Jim Fehlig
2013-04-26 11:45                         ` Stefano Stabellini
2013-04-26 14:36                       ` Roger Pau Monné
2013-04-25 18:26         ` Sylvain Munaut

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=517A58D2.6090205@eu.citrix.com \
    --to=dave.scott@eu.citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jfehlig@suse.com \
    --cc=xen-devel@lists.xen.org \
    /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.