qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] read-only: allow read-only CDROM with any inter


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] read-only: allow read-only CDROM with any interface
Date: Sun, 21 Mar 2010 10:29:53 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3

On 03/21/2010 08:33 AM, Naphtali Sprei wrote:
-    if (ro == 1) {
+    if (media == MEDIA_CDROM) {
+        ro = 1;
+    }
+    if (ro == 1&&
+        media != MEDIA_CDROM) { /* CDROM is fine for any interface, don't 
check */
          if (type != IF_SCSI&&  type != IF_VIRTIO&&  type != IF_FLOPPY) {

Ug.  How about formatting this as

    if (media == MEDIA_CDROM) {
        /* CDROM is fine for any interface, don't check.  */
        ro = 1;
    } else if (ro == 1) {
        if (type != IF_SCSI ...)
    }

duplicating the MEDIA_CDROM test makes the logic harder to follow.


r~




reply via email to

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