qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 4/9] Add host_from_stream_offset_versioned fu


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH v5 4/9] Add host_from_stream_offset_versioned function
Date: Wed, 04 Jan 2012 14:59:13 -0600
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 01/04/2012 06:00 AM, Stefan Hajnoczi wrote:
On Tue, Jan 3, 2012 at 3:34 PM, Orit Wasserman<address@hidden>  wrote:
+static inline void *host_from_stream_offset_versioned(int version_id,
+        QEMUFile *f, ram_addr_t offset, int flags)
+{
+        void *host;
+        if (version_id == 3) {
+                host = qemu_get_ram_ptr(offset);
+        } else {
+                host = host_from_stream_offset(f, offset, flags);
+        }
+        if (!host) {
+            fprintf(stderr, "Failed to convert RAM address to host"
+                    " for offset 0x%lX!\n", offset);
+            abort();
+        }

Please use RAM_ADDR_FMT instead of %lX.

Aborting isn't ideal but I guess there is nothing else we can do at this point.


Currently we we return -EINVAL to qemu_loadvm_state() when !host, which prints potentially useful warnings and exits gracefully for migration, and for savevm we print the warnings and fire up the main_loop with vcpus paused...

Not sure what the rationale is for the latter, but it may have some utility (debugging maybe?).

In any case, since the error paths are covered in some fashion I don't think we should resort to aborting here, maybe just print the warnings and check for NULL return in the callers as before.

Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]