qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH] add VMSTATE_BOOL


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [PATCH] add VMSTATE_BOOL
Date: Tue, 09 Nov 2010 12:50:11 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat/3.1.3-1.el6 Thunderbird/3.1.3

  Hi,

+static int get_bool(QEMUFile *f, void *pv, size_t size)
+{
+    bool *v = pv;
+    *v = qemu_get_byte(f);
+    return 0;

I think we should verify that value is 0 or 1 and fail
migration otherwise, to make it more robust.

I still think such a check doesn't belong into the migration code as such a bug would exist without migration too. And if anything we should check on save not on load, otherwise qemu can write out savevm images which it will refuse to load. I wouldn't call this "robust".

cheers,
  Gerd



reply via email to

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