qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [v9 Patch 4/6]Qemu: Add commandline -drive option 'host


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [v9 Patch 4/6]Qemu: Add commandline -drive option 'hostcache'
Date: Wed, 16 Nov 2011 20:06:39 +0000

On Fri, Nov 11, 2011 at 6:48 AM, Supriya Kannery
<address@hidden> wrote:
> +        if ((hostcache = qemu_opt_get_bool(opts, "hostcache", -1)) != -1) {

This does not work.  qemu_opt_get_bool() takes a bool default argument
and returns a bool.  (bool)-1 == true.  But (int)true == 1 and you
cannot expect it to ever equal -1.

Try this:

if (qemu_opt_get(opts, "hostcache") &&
    !qemu_opt_get_bool(opts, "hostcache", false)) {
    bdrv_flags |= BDRV_O_NOCACHE;
}

Stefan



reply via email to

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