Hello,
This patch series adds a 'fedora-13' machine type to differentiate from the upstream 0.12 machine type.
It also backports a few virtio-serial fixes from upstream: disabling MSI, disabling virtio-serial for older machine types.
If there are no objections, I'll commit this to the F-13 repo.
Amit Shah (3): pc: Add a Fedora-13 machine type that contains backports from upstream pc: Add backward compatibility options for virtio-serial virtio-serial: pci: Allow MSI to be disabled
Michael S. Tsirkin (1): virtio-serial: don't set MULTIPORT for 1 port dev
hw/pc.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- hw/virtio-pci.c | 6 +++--- hw/virtio-serial-bus.c | 6 ++++-- 3 files changed, 52 insertions(+), 7 deletions(-)
We have a few features backported from the upstream 0.13 machine type in the repo here.
Add a 'fedora-13' machine type and use that by default so that users can fall back to a released upstream machine type if desired.
The fedora-13 machine type has the new multiport-supported virtio-serial and vhost-net patches as of now not present in the 0.12 machine type.
This is based on upstream commit d76fa62dba54a156ca0f5e79eb33756c9015e02c
Signed-off-by: Amit Shah amit.shah@redhat.com --- hw/pc.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c index acbfeba..d705dd3 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1327,11 +1327,9 @@ void cmos_set_s3_resume(void)
static QEMUMachine pc_machine = { .name = "pc-0.12", - .alias = "pc", .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, - .is_default = 1, };
static QEMUMachine pc_machine_v0_11 = { @@ -1400,3 +1398,20 @@ static void pc_machine_init(void) }
machine_init(pc_machine_init); + +/* Fedora machine types */ +static QEMUMachine pc_machine_f13 = { + .name = "fedora-13", + .alias = "pc", + .desc = "Standard PC", + .init = pc_init_pci, + .max_cpus = 255, + .is_default = 1, +}; + +static void fedora_machine_init(void) +{ + qemu_register_machine(&pc_machine_f13); +} + +machine_init(fedora_machine_init);
virtio-serial-pci can support multiple ports in the current F-13 version that will become upstream version 0.13. Add compatibility options for the 0.12, 0.11 and 0.10 pc machine types.
Based on upstream commit 8bfbde6d35c82cc376681289dae2de5e18a087a4
Signed-off-by: Amit Shah amit.shah@redhat.com --- hw/pc.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c index d705dd3..e13b17e 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1330,6 +1330,18 @@ static QEMUMachine pc_machine = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + { + .driver = "virtio-serial-pci", + .property = "max_nr_ports", + .value = stringify(1), + },{ + .driver = "virtio-serial-pci", + .property = "vectors", + .value = stringify(0), + }, + { /* end of list */ } + } };
static QEMUMachine pc_machine_v0_11 = { @@ -1343,6 +1355,14 @@ static QEMUMachine pc_machine_v0_11 = { .property = "vectors", .value = stringify(0), },{ + .driver = "virtio-serial-pci", + .property = "max_nr_ports", + .value = stringify(1), + },{ + .driver = "virtio-serial-pci", + .property = "vectors", + .value = stringify(0), + },{ .driver = "PCI", .property = "rombar", .value = stringify(0), @@ -1366,6 +1386,14 @@ static QEMUMachine pc_machine_v0_10 = { .property = "class", .value = stringify(PCI_CLASS_DISPLAY_OTHER), },{ + .driver = "virtio-serial-pci", + .property = "max_nr_ports", + .value = stringify(1), + },{ + .driver = "virtio-serial-pci", + .property = "vectors", + .value = stringify(0), + },{ .driver = "virtio-net-pci", .property = "vectors", .value = stringify(0),
From: Michael S. Tsirkin mst@redhat.com
Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, all serial devices declare MULTIPORT feature. To allow 0.12 compatibility, we should clear this when max_nr_ports is 1.
Upsream commit: ee4d45be0d791eb8bb0f767cd0f17ea8f697281b
Signed-off-by: Michael S. Tsirkin mst@redhat.com Signed-off-by: Amit Shah amit.shah@redhat.com Signed-off-by: Anthony Liguori aliguori@us.ibm.com --- hw/virtio-serial-bus.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index ab456ea..d0e0219 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -335,8 +335,10 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
static uint32_t get_features(VirtIODevice *vdev, uint32_t features) { - features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT); - + VirtIOSerial *vser = DO_UPCAST(VirtIOSerial, vdev, vdev); + if (vser->bus->max_nr_ports > 1) { + features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT); + } return features; }
Michael noted we don't allow disabling of MSI for the virtio-serial-pci device. Fix that.
Upstream commit: 7b665b668aa92bf0bba696f085dff87539d95529
Signed-off-by: Amit Shah amit.shah@redhat.com CC: "Michael S. Tsirkin" mst@redhat.com Signed-off-by: Anthony Liguori aliguori@us.ibm.com --- hw/virtio-pci.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 9a02682..636c8c3 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -598,8 +598,8 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev) if (!vdev) { return -1; } - vdev->nvectors = proxy->nvectors ? proxy->nvectors - : proxy->max_virtserial_ports + 1; + vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1 + : proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, @@ -683,7 +683,7 @@ static PCIDeviceInfo virtio_info[] = { .init = virtio_serial_init_pci, .exit = virtio_exit_pci, .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1), DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
On Thu, Feb 25, 2010 at 06:41:12PM +0530, Amit Shah wrote:
Hello,
This patch series adds a 'fedora-13' machine type to differentiate from the upstream 0.12 machine type.
It also backports a few virtio-serial fixes from upstream: disabling MSI, disabling virtio-serial for older machine types.
If there are no objections, I'll commit this to the F-13 repo.
Thanks, applied to F-13 git, and they will be in the next F-13 qemu package.
Justin