xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Cc: Jim Fehlig <jfehlig@suse.com>, xen-devel@lists.xen.org
Subject: [PATCH 5/5] libxl: Support user-specified <emulator>
Date: Fri, 19 Sep 2014 13:23:14 -0600	[thread overview]
Message-ID: <1411154594-14871-6-git-send-email-jfehlig@suse.com> (raw)
In-Reply-To: <1411154594-14871-1-git-send-email-jfehlig@suse.com>

With the introduction of the libxlDomainGetEmulatorType function,
it is trivial to support a user-specfied <emulator> in the libxl
driver.  This patch is based loosely on David Scott's old patch
to do the same

https://www.redhat.com/archives/libvir-list/2013-April/msg02119.html

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 src/libxl/libxl_conf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 09211f8..882dcff 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -705,6 +705,21 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
         if (VIR_STRDUP(b_info->u.hvm.boot, bootorder) < 0)
             goto error;
 
+        if (def->emulator) {
+            if (!virFileExists(def->emulator)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                               _("emulator '%s' not found"),
+                               def->emulator);
+                goto error;
+            }
+
+            VIR_FREE(b_info->device_model);
+            if (VIR_STRDUP(b_info->device_model, def->emulator) < 0)
+                goto error;
+
+            b_info->device_model_version = libxlDomainGetEmulatorType(def);
+        }
+
         if (def->nserials) {
             if (def->nserials > 1) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-- 
1.8.4.5

  parent reply	other threads:[~2014-09-19 19:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 19:23 [PATCH 0/5] libxl: user-specified domain config improvements Jim Fehlig
2014-09-19 19:23 ` [PATCH 1/5] libxl: Copy user-specified keymap to libxl build info struct Jim Fehlig
2014-09-19 19:23 ` [PATCH 2/5] Xen: Defer setting default vram value to Xen drivers Jim Fehlig
2014-10-06  8:04   ` [libvirt] " Michal Privoznik
2014-09-19 19:23 ` [PATCH 3/5] libxl: Add function to determine device model type Jim Fehlig
2014-09-19 19:23 ` [PATCH 4/5] libxl: Implement basic video device selection Jim Fehlig
2014-10-14  8:47   ` [libvirt] " John Ferlan
     [not found]   ` <543CE32F.8070407@redhat.com>
2014-10-16 19:16     ` Jim Fehlig
2014-09-19 19:23 ` Jim Fehlig [this message]
2014-10-06  8:04   ` [libvirt] [PATCH 5/5] libxl: Support user-specified <emulator> Michal Privoznik
2014-10-06  8:03 ` [libvirt] [PATCH 0/5] libxl: user-specified domain config improvements Michal Privoznik
     [not found] ` <1411154594-14871-4-git-send-email-jfehlig@suse.com>
2014-10-06  8:04   ` [libvirt] [PATCH 3/5] libxl: Add function to determine device model type Michal Privoznik
     [not found]   ` <54324CF3.8050507@redhat.com>
2014-10-10 21:22     ` Jim Fehlig
     [not found] ` <54324CEE.5000505@redhat.com>
2014-10-10 21:23   ` [libvirt] [PATCH 0/5] libxl: user-specified domain config improvements Jim Fehlig

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=1411154594-14871-6-git-send-email-jfehlig@suse.com \
    --to=jfehlig@suse.com \
    --cc=libvir-list@redhat.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 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).