All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH v8 21/21] libxl: add support for migrating HVM guests without a device model
Date: Thu, 26 Nov 2015 19:10:56 +0100	[thread overview]
Message-ID: <56574B30.20700@citrix.com> (raw)
In-Reply-To: <56437789.40905@citrix.com>

El 11/11/15 a les 18.14, Andrew Cooper ha escrit:
> On 06/11/15 16:05, Roger Pau Monne wrote:
>> diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
>> index 52a60d7..0a6eaf9 100644
>> --- a/tools/libxl/libxl_stream_write.c
>> +++ b/tools/libxl/libxl_stream_write.c
>> @@ -232,6 +232,9 @@ void libxl__stream_write_start(libxl__egc *egc,
>>              stream->emu_sub_hdr.id = EMULATOR_QEMU_UPSTREAM;
>>              break;
>>  
>> +        case LIBXL_DEVICE_MODEL_VERSION_NONE:
>> +            break;
>> +
> 
> This (in principle) leaves stream->emu_sub_hdr.id uninitialised
> (although its value will be zero because of libxl__stream_write_init()).
> 
> I would be tempted to (ab)use EMULATOR_UNKNOWN here and have
> setup_emulator_write() assert id != UNKNOWN, to catch calls which slip
> through the cracks.

This seems fine to me and I've implemented it.

> 
>>          default:
>>              rc = ERROR_FAIL;
>>              LOG(ERROR, "Unknown emulator for HVM domain");
>> @@ -359,6 +362,12 @@ static void write_emulator_xenstore_record(libxl__egc *egc,
>>      char *buf = NULL;
>>      uint32_t len = 0;
>>  
>> +    if (libxl__device_model_version_running(gc, dss->domid) ==
>> +        LIBXL_DEVICE_MODEL_VERSION_NONE) {
>> +        emulator_xenstore_record_done(egc, stream);
>> +        return;
>> +    }
>> +
> 
> libxl__device_model_version_running() performs a xenstore action, which
> is a steep overhead for constant information.
> 
> It would be better to introduce a new field in libxl__stream_write_state
> and cache libxl__device_model_version_running() once in
> libxl__stream_write_start().  You can then also use that for an
> assertion in setup_emulator_write()

Right, so I've ended up adding two asserts in setup_emulator_write:

assert(stream->emu_sub_hdr.id != EMULATOR_UNKNOWN);
assert(stream->device_model_version != LIBXL_DEVICE_MODEL_VERSION_NONE);

Roger.

      reply	other threads:[~2015-11-26 18:11 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 16:05 [PATCH v8 00/21] Introduce HVM without dm and new boot ABI Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 01/21] xen/x86: add bitmap of enabled emulated devices Roger Pau Monne
2015-11-16 12:18   ` Jan Beulich
2015-11-16 18:33     ` Andrew Cooper
2015-11-17  9:42       ` Jan Beulich
2015-11-17  9:58         ` Juergen Gross
2015-11-17 10:30           ` Andrew Cooper
2015-11-17 10:35             ` Juergen Gross
2015-11-26 10:25       ` Roger Pau Monné
2015-11-06 16:05 ` [PATCH v8 02/21] xen/vlapic: fixes for HVM code when running without a vlapic Roger Pau Monne
2015-11-06 16:10   ` Andrew Cooper
2015-11-26  5:41   ` Tian, Kevin
2015-11-06 16:05 ` [PATCH v8 03/21] xen/x86: allow disabling the emulated local apic Roger Pau Monne
2015-11-26  5:47   ` Tian, Kevin
2015-11-06 16:05 ` [PATCH v8 04/21] xen/x86: allow disabling the emulated HPET Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 05/21] xen/x86: allow disabling power management Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 06/21] xen/x86: allow disabling the emulated RTC Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 07/21] xen/x86: allow disabling the emulated IO APIC Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 08/21] xen/x86: allow disabling the emulated PIC Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 09/21] xen/x86: set the vPMU interface based on the presence of a lapic Roger Pau Monne
2015-11-09 15:04   ` Jan Beulich
2015-11-10 11:30     ` [PATCH v8.1 " Roger Pau Monne
2015-11-10 14:21       ` Boris Ostrovsky
2015-11-06 16:05 ` [PATCH v8 10/21] xen/x86: allow disabling the emulated VGA Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 11/21] xen/x86: allow disabling the emulated IOMMU Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 12/21] xen/x86: allow disabling the emulated PIT Roger Pau Monne
2015-11-09 15:31   ` Jan Beulich
2015-11-06 16:05 ` [PATCH v8 13/21] xen/x86: make sure the HVM callback vector is correctly set Roger Pau Monne
2015-11-10 16:41   ` Jan Beulich
2015-11-06 16:05 ` [PATCH v8 14/21] xen/x86: allow disabling all emulated devices inside of Xen Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 15/21] elfnotes: intorduce a new PHYS_ENTRY elfnote Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 16/21] libxc: allow creating domains without emulated devices Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 17/21] xen/x86: allow HVM guests to use hypercalls to bring up vCPUs Roger Pau Monne
2015-11-12 16:57   ` Jan Beulich
2015-11-26 16:57     ` Roger Pau Monné
2015-11-27  8:00       ` Jan Beulich
2015-11-27  9:47         ` Roger Pau Monné
2015-11-27 10:03           ` Jan Beulich
2015-11-06 16:05 ` [PATCH v8 18/21] libxc/xen: introduce a start info structure for HVMlite guests Roger Pau Monne
2015-11-10 16:53   ` Jan Beulich
2015-11-06 16:05 ` [PATCH v8 19/21] libxc: switch xc_dom_elfloader to be used with HVMlite domains Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 20/21] libxl: allow the creation of HVM domains without a device model Roger Pau Monne
2015-11-06 16:05 ` [PATCH v8 21/21] libxl: add support for migrating HVM guests " Roger Pau Monne
2015-11-11 15:49   ` Wei Liu
2015-11-11 15:55     ` Ian Jackson
2015-11-11 17:14   ` Andrew Cooper
2015-11-26 18:10     ` Roger Pau Monné [this message]

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=56574B30.20700@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.