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: Mark McLoughlin
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 14:31:55 +0100

On Thu, 2009-07-09 at 12:01 +0200, Gerd Hoffmann wrote:
> I'd prefer to not introduce those virtio-$type-pci-$version devices in
> the first place.

Ah, I see why ... with your -device stuff, these new devices types would
become part of the public interface.

If they were to be public, we'd probably want them to become
virtio-$type-pci-$feature instead. As pointed out before, that becomes
cumbersome.

> diff --git a/hw/pc.c b/hw/pc.c
> index 38678da..cd64ccf 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -1460,6 +1460,21 @@ static QEMUMachine pc_machine = {
>      .is_default = 1,
>  };
>  
> +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.

Hmm, if this was a machine config file, would be do something like
"include compat-props-0.10.conf"? Maybe something similar is in order
here?

Cheers,
Mark.





reply via email to

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