qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibi


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x
Date: Thu, 09 Jul 2009 15:47:18 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 07/09/09 15:31, Mark McLoughlin wrote:
+static QEMUMachine pc_machine_v0_10 = {
+    .name = "pc-0.10",
+    .desc = "Standard PC, qemu 0.10",
+    .init = pc_init_pci,
+    .max_cpus = 255,
+    .compat_props = (CompatProperty[]) {
+        {
+            .driver   = "virtio-blk-pci",
+            .property = "class",
+            .value    = "0x0180", /* PCI_CLASS_STORAGE_OTHER */
+        },
+        { /* end of list */ }
+    },
+};

I did actually experiment with something similar to this, but backed off
because I didn't like putting such details (i.e. the class value) in
hw/pc.c rather than keeping them self contained in the driver code.
Especially since it'll have to be replicated for every machine which can
use the device.

We don't need to have the list inline.  We can have

CompatProperty compat_qemu_0_10[] {
    [ properties here ]
};

somewhere and then just reference it like this:

static QEMUMachine pc_machine_v0_10 = {
    .name = "pc-0.10",
    [ ... ]
    .compat_props = &compat_qemu_0_10,
};

from multiple machine types.

cheers,
  Gerd





reply via email to

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