Re: [Qemu-devel] [PATCH] virtio-net: put virtio net header inline with data

2013-06-06 Thread Jesse Larrew
On 06/06/2013 03:09 PM, Dave Jones wrote: > On Thu, Jun 06, 2013 at 02:59:44PM -0500, Jesse Larrew wrote: > > > > pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest); > > > +if (vi->mergeable_rx_bufs) > > > +

Re: [Qemu-devel] [PATCH] virtio-net: put virtio net header inline with data

2013-06-06 Thread Jesse Larrew
r > s/g */ > + > #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ > #define VIRTIO_NET_S_ANNOUNCE2 /* Announcement is needed */ > > @@ -70,7 +72,9 @@ struct virtio_net_config { > __u16 max_virtqueue_pairs; > } __attribute__((packed)); > >

Re: [Qemu-devel] [PATCH 1/3] virtio: add bus_plugged() callback to VirtioDeviceClass

2013-06-04 Thread Jesse Larrew
On 06/04/2013 12:35 PM, Andreas Färber wrote: > Hi, > Hi Andreas! Thanks for the review. :) > Am 04.06.2013 18:22, schrieb Jesse Larrew: >> Virtio devices are initialized prior to plugging them into a bus. However, >> other initializations (such as host_features) don&#x

[Qemu-devel] [PATCH 3/3] virtio-net: revert MAC address workaround

2013-06-04 Thread Jesse Larrew
With a more permanent solution in place, the workaround in commit e9016ee2bda1b7757072b856b2196f691aee3388 is no longer needed. Signed-off-by: Jesse Larrew --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index

[Qemu-devel] [PATCH 1/3] virtio: add bus_plugged() callback to VirtioDeviceClass

2013-06-04 Thread Jesse Larrew
the bus is attached and host_features is available for use. This patch extends struct VirtioDeviceClass to add a bus_plugged() method. If implemented by a device, it will be called after the device is attached to a bus. Signed-off-by: Jesse Larrew --- hw/virtio/virtio.c | 3 +++ include

[Qemu-devel] [PATCH 2/3] virtio-net: implement bus_plugged()

2013-06-04 Thread Jesse Larrew
. Signed-off-by: Jesse Larrew --- hw/net/virtio-net.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3a6829c..e09288f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -21,6 +21,7 @@ #include "hw/virtio/virtio-

[Qemu-devel] [PATCH 0/3] Notify devices when a bus is attached

2013-06-04 Thread Jesse Larrew
The virtio-net driver can determine the required size of the config struct dynamically by inspecting the feature bits in host_features. The natural place to perform this calculation is within the driver's init routine. However, host_features isn't set until later when the device is plugged into a b

Re: [Qemu-devel] [PATCH] e1000: cleanup process_tx_desc

2013-06-04 Thread Jesse Larrew
*s, struct e1000_tx_desc *dp) > > if (!(txd_lower & E1000_TXD_CMD_EOP)) > return; > -if (!(tp->tse && tp->cptse && tp->size < hdr)) > +if (!(tp->tse && tp->cptse && tp->size < tp->hdr_len)) > xmit_seg(s); Braces here as well. > tp->tso_frames = 0; > tp->sum_needed = 0; > Although the style issues were present to begin with, we may as well take the opportunity to fix them. Sincerely, Jesse Larrew Software Engineer, KVM Team IBM Linux Technology Center Phone: (512) 973-2052 (T/L: 363-2052) jlar...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH] target-i386: cpu: fix potential buffer overrun in get_register_name_32()

2013-06-03 Thread Jesse Larrew
onst char *get_register_name_32(unsigned int reg) > { > -if (reg > CPU_NB_REGS32) { > +if (reg >= CPU_NB_REGS32) { > return NULL; > } > return x86_reg_info_32[reg].name; > Looks obvious now that it's been spotted. ;) Reviewed by: Jesse Lar

Re: [Qemu-devel] [PATCH] Fix mask of pte index

2013-05-20 Thread Jesse Larrew
lt; 12); > memory_mapping_list_add_merge_sorted(list, start_paddr, > start_vaddr, 1 << 12); > } > Verified that this agrees with the spec for IA-32e/PAE paging. Note that walk_pte2() is correct; only walk_pte() has the typo. Reviewed by: Jesse Larrew Jesse Larrew Softwa

[Qemu-devel] [PATCH] libqtest: only call fclose() on open files

2013-04-29 Thread Jesse Larrew
libqtest.c can segfault when calling fclose() if the pidfile wasn't opened successfully. This patch fixes the issue. Signed-off-by: Jesse Larrew --- tests/libqtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 884f959..87

Re: [Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-29 Thread Jesse Larrew
On 04/29/2013 10:29 AM, KONRAD Frédéric wrote: > On 29/04/2013 17:14, Jesse Larrew wrote: >> On 04/29/2013 09:55 AM, KONRAD Frédéric wrote: >>> On 29/04/2013 16:42, Jesse Larrew wrote: >>>> On 04/25/2013 01:59 AM, Michael S. Tsirkin wrote: >>>>> On Thu,

Re: [Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-29 Thread Jesse Larrew
On 04/29/2013 09:55 AM, KONRAD Frédéric wrote: > On 29/04/2013 16:42, Jesse Larrew wrote: >> On 04/25/2013 01:59 AM, Michael S. Tsirkin wrote: >>> On Thu, Apr 25, 2013 at 02:21:29PM +0800, Jason Wang wrote: >>>> Commit 14f9b664 (hw/virtio-net.c: set config size using

Re: [Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-29 Thread Jesse Larrew
gt;> >> Fix this by counting VIRTIO_NET_F_MAC and make sure the config at least >> contains >> the mac address. >> >> Cc: Jesse Larrew >> Signed-off-by: Jason Wang >> --- >> hw/net/virtio-net.c |3 ++- >> 1 files changed, 2 insertions(+

Re: [Qemu-devel] [PATCH v2 3/3] debugcon: fix compiler warning when open DEBUG_DEBUGCON

2013-04-15 Thread Jesse Larrew
que, hwaddr > addr, unsigned width) > DebugconState *s = opaque; > > #ifdef DEBUG_DEBUGCON > -printf("debugcon: read addr=0x%04x\n", addr); > +printf("debugcon: read addr=0x%04" HWADDR_PRIx "\n", addr); I noticed that you only added b

Re: [Qemu-devel] [PATCH v2 2/3] debugcon: make debug message more readable

2013-04-15 Thread Jesse Larrew
; val); I like the reformatting, but it looks like you accidentally clobbered the 'x' when you added the ']'. This is the cause of the compiler warnings in patch #3. Jesse Larrew Software Engineer, KVM Team IBM Linux Technology Center Phone: (512) 973-2052 (T/L: 363-2052) jlar...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH v2 1/3] debugcon: fix always print "addr=0x0, val=0x0" bug

2013-04-15 Thread Jesse Larrew
ugcon.c > @@ -55,7 +55,7 @@ static void debugcon_ioport_write(void *opaque, hwaddr > addr, uint64_t val, > unsigned char ch = val; > > #ifdef DEBUG_DEBUGCON > -printf("debugcon: write addr=0x%04x val=0x%02x\n", addr, val); > + printf("debugcon: write

Re: [Qemu-devel] [PATCH v3] hw/i386/pc: prompt not multboot or morden kernel image

2013-04-09 Thread Jesse Larrew
On 04/09/2013 12:05 AM, li guang wrote: > 在 2013-04-08一的 23:36 -0500,Jesse Larrew写道: >> On 04/08/2013 09:27 PM, liguang wrote: >>> if head magic is missing or wrong unexpectedly, we'd >>> better to prompt memssage for this. >>> e.g. >>> I make a mi

Re: [Qemu-devel] [PATCH v3] hw/i386/pc: prompt not multboot or morden kernel image

2013-04-08 Thread Jesse Larrew
eading through the code is that this branch can be legitimately triggered by an older kernel (protocol < 0x200). In that case, the error message above would also be misleading. I think a better solution might be to simply validate that the arch specified in the ELF header matches the arch that

Re: [Qemu-devel] [PATCH v4] Add GDB qAttached support

2013-03-14 Thread Jesse Larrew
f (strncmp(p, "Attached", 8) == 0) { > +put_packet(s, GDB_ATTACHED); > +break; > +} > /* Unrecognised 'q' command. */ > goto unknown_command; > Reviewed-by: Jesse Larrew Jesse Larrew Software Engineer, KVM Team IBM Linux Technology Center Phone: (512) 973-2052 (T/L: 363-2052) jlar...@linux.vnet.ibm.com

Re: [Qemu-devel] Build failure with -werror on i386

2013-02-26 Thread Jesse Larrew
tree builds can be flaky sometimes, because 'make distclean' can leave some stale bits lying around... Maybe this is the issue? > > This was produced on an Ubuntu 10.04 x86_64 machine. > > regards, > David > Sincerely, Jesse Larrew Software Engineer, KVM Team IBM Linux Technology Center Phone: (512) 973-2052 (T/L: 363-2052) jlar...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a header

2013-02-19 Thread Jesse Larrew
Move the definition of struct VirtIOFeature from virtio-net.c to virtio.h so other virtio devices can benefit. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 12 hw/virtio.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/virtio-net.c b

[Qemu-devel] [PATCH 3/8] virtio: pass host features to driver init functions

2013-02-19 Thread Jesse Larrew
Drivers affected: * virtio_balloon * virtio_serial_bus * virtio_scsi * virtio_blk * virtio_9p * virtio_rng Signed-off-by: Jesse Larrew --- hw/s390x/s390-virtio-bus.c | 8 +--- hw/s390x/virtio-ccw.c | 11 +++ hw/virtio-balloon.c| 2 +- hw/virtio-blk.c

[Qemu-devel] [PATCH 7/8] virtio-scsi: fill in table of feature sizes

2013-02-19 Thread Jesse Larrew
Since none of the existing feature bits changed the layout of struct VirtIOSCSIConf, set the minimum struct size to use the full struct (i.e endof(struct VirtIOSCSIConf, cmd_per_lun)). Signed-off-by: Jesse Larrew --- hw/virtio-scsi.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[Qemu-devel] [PATCH 5/8] virtio-balloon: fill in the table of feature_sizes

2013-02-19 Thread Jesse Larrew
There are two feature bits for virtio-balloon: VIRTIO_BALLOON_F_MUST_TELL_HOST, and VIRTIO_BALLOON_F_STATS_VQ. Since these features don't require additional fields in the config struct, set the 'end' field to the end of the last field in the struct. Signed-off-by: Jesse

[Qemu-devel] [PATCH 4/8] virtio: set config size using host features

2013-02-19 Thread Jesse Larrew
table that uses the full size of the config struct. These dummy tables will be replaced on a per-driver basis. Signed-off-by: Jesse Larrew --- hw/9pfs/virtio-9p-device.c | 15 ++- hw/virtio-balloon.c| 15 --- hw/virtio-blk.c| 14 +++--- hw/virtio

[Qemu-devel] [PATCH 1/8] virtio-net: replace redundant config_size field with config_len

2013-02-19 Thread Jesse Larrew
len instead. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 573c669..bdbfc18 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -73,7 +73,6 @@ typedef struct VirtIONet

[Qemu-devel] [PATCH 6/8] virtio-serial: fill in the feature table

2013-02-19 Thread Jesse Larrew
VIRTIO_CONSOLE_F_MULTIPORT is set when max_nr_ports > 1, so set the config size to include max_nr_ports. Signed-off-by: Jesse Larrew --- hw/virtio-serial-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 9cd9

[Qemu-devel] [PATCH 8/8] virtio-blk: fill in the feature table

2013-02-19 Thread Jesse Larrew
Fill in the feature table with the last field of struct virtio_blk_config at the time that the feature flag was introduced. The table was constructed by searching through the git history. Signed-off-by: Jesse Larrew --- hw/virtio-blk.c | 22 -- 1 file changed, 20 insertions

[Qemu-devel] [PATCH v2 0/8] virtio: set config size using host features

2013-02-19 Thread Jesse Larrew
To ensure compatibility between qemu versions, virtio drivers should set the size of their config structs according to the feature bits that are set. This should keep the size from changing as new features are introduced and avoid breaking older drivers. Changes since v1: * Fixed a build error on

[Qemu-devel] [PATCH 0/8] virtio: set config size using host features

2013-02-18 Thread Jesse Larrew
To ensure compatibility between qemu versions, virtio drivers should set the size of their config structs according to the feature bits that are set. This should keep the size from changing as new features are introduced and avoid breaking older drivers. [PATCH 1/8] virtio-net: replace redundant c

[Qemu-devel] [PATCH 6/8] virtio-serial: fill in the feature table

2013-02-18 Thread Jesse Larrew
VIRTIO_CONSOLE_F_MULTIPORT is set when max_nr_ports > 1, so set the config size to include max_nr_ports. Signed-off-by: Jesse Larrew --- hw/virtio-serial-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 9cd9

[Qemu-devel] [PATCH 7/8] virtio-scsi: fill in table of feature sizes

2013-02-18 Thread Jesse Larrew
Since none of the existing feature bits changed the layout of struct VirtIOSCSIConf, set the minimum struct size to use the full struct (i.e endof(struct VirtIOSCSIConf, cmd_per_lun)). Signed-off-by: Jesse Larrew --- hw/virtio-scsi.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a header

2013-02-18 Thread Jesse Larrew
Move the definition of struct VirtIOFeature from virtio-net.c to virtio.h so other virtio devices can benefit. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 12 hw/virtio.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/virtio-net.c b

[Qemu-devel] [PATCH 3/8] virtio: pass host features to driver init functions

2013-02-18 Thread Jesse Larrew
Drivers affected: * virtio_balloon * virtio_serial_bus * virtio_scsi * virtio_blk * virtio_9p * virtio_rng Signed-off-by: Jesse Larrew --- hw/s390x/s390-virtio-bus.c | 7 --- hw/s390x/virtio-ccw.c | 11 +++ hw/virtio-balloon.c| 2 +- hw/virtio-blk.c

[Qemu-devel] [PATCH 5/8] virtio-balloon: fill in the table of feature_sizes

2013-02-18 Thread Jesse Larrew
There are two feature bits for virtio-balloon: VIRTIO_BALLOON_F_MUST_TELL_HOST, and VIRTIO_BALLOON_F_STATS_VQ. Since these features don't require additional fields in the config struct, set the 'end' field to the end of the last field in the struct. Signed-off-by: Jesse

[Qemu-devel] [PATCH 4/8] virtio: set config size using host features

2013-02-18 Thread Jesse Larrew
table that uses the full size of the config struct. These dummy tables will be replaced on a per-driver basis. Signed-off-by: Jesse Larrew --- hw/9pfs/virtio-9p-device.c | 15 ++- hw/virtio-balloon.c| 15 --- hw/virtio-blk.c| 14 +++--- hw/virtio

[Qemu-devel] [PATCH 8/8] virtio-blk: fill in the feature table

2013-02-18 Thread Jesse Larrew
Fill in the feature table with the last field of struct virtio_blk_config at the time that the feature flag was introduced. The table was constructed by searching through the git history. Signed-off-by: Jesse Larrew --- hw/virtio-blk.c | 22 -- 1 file changed, 20 insertions

[Qemu-devel] [PATCH 1/8] virtio-net: replace redundant config_size field with config_len

2013-02-18 Thread Jesse Larrew
len instead. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 573c669..bdbfc18 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -73,7 +73,6 @@ typedef struct VirtIONet

[Qemu-devel] [PATCH 0/2] virtio-net config_size cleanups

2013-02-07 Thread Jesse Larrew
This patch set includes some minor cleanups requested by the community for the virtio-net config size solution. [PATCH 1/2] hw/virtio-net: use existing macros to implement endof [PATCH 2/2] hw/virtio-net: fix config_size data type

[Qemu-devel] [PATCH 2/2] hw/virtio-net: fix config_size data type

2013-02-07 Thread Jesse Larrew
Since the new config_size member of struct VirtIONet specifies a size, it should be declared as size_t. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 663f33c..573c669 100644 --- a/hw

[Qemu-devel] [PATCH 1/2] hw/virtio-net: use existing macros to implement endof

2013-02-07 Thread Jesse Larrew
Clarify the definition of endof() by using the offsetof() and sizeof() macros to handle the pointer magic. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 8f521b3..663f33c 100644 --- a/hw

[Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features

2013-02-05 Thread Jesse Larrew
set of features enabled. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index f1c2884..8f521b3 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c

[Qemu-devel] [PATCH V2 0/3] set config size using available features

2013-02-05 Thread Jesse Larrew
This patch set fixes an issue with virtio Windows drivers when multiqueue is enabled. This is a narrow fix for 1.4, and I intend to generalize the approach for all virtio devices in 1.5. Changes since V1: * Added missing parentheses around the endof() macro definition. * Fixed spelling errors in t

[Qemu-devel] [PATCH 1/3] virtio-net: pass host features to virtio_net_init

2013-02-05 Thread Jesse Larrew
From: Anthony Liguori Signed-off-by: Anthony Liguori --- hw/s390x/s390-virtio-bus.c | 3 ++- hw/s390x/virtio-ccw.c | 3 ++- hw/virtio-net.c| 3 ++- hw/virtio-pci.c| 3 ++- hw/virtio.h| 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PATCH 3/3] hw/virtio-net: disable multiqueue by default

2013-02-05 Thread Jesse Larrew
The new multiqueue feature adds fields to the virtio device config, which breaks Windows guests. Disable the feature by default until the Windows drivers are fixed. Signed-off-by: Jesse Larrew --- hw/virtio-net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio

[Qemu-devel] [PATCH 1/3] virtio-net: pass host features to virtio_net_init

2013-02-05 Thread Jesse Larrew
From: Anthony Liguori Signed-off-by: Anthony Liguori --- hw/s390x/s390-virtio-bus.c | 3 ++- hw/s390x/virtio-ccw.c | 3 ++- hw/virtio-net.c| 3 ++- hw/virtio-pci.c| 3 ++- hw/virtio.h| 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PATCH 0/3] set config size using available features

2013-02-05 Thread Jesse Larrew
This patch set fixes an issue with virtio Windows drivers when multiqueue is enabled. This is a narrow fix for 1.4, and I intend to generalize the approach for all virtio devices in 1.5.

[Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features

2013-02-05 Thread Jesse Larrew
set of features enabled. Signed-off-by: Jesse Larrew --- hw/virtio-net.c | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index f1c2884..2956bc1 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c

[Qemu-devel] [PATCH 3/3] hw/virtio-net: disable multiqueue by default

2013-02-05 Thread Jesse Larrew
The new multiqueue feature adds fields to the virtio device config, which breaks Windows guests. Disable the feature by default until the Windows drivers are fixed. Signed-off-by: Jesse Larrew --- hw/virtio-net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio

[Qemu-devel] [Bug 659351] Re: QEMU uses obsolete gethostbyname and inet_aton rather than getaddrinfo

2013-01-29 Thread Jesse Larrew
** Changed in: qemu Assignee: (unassigned) => Jesse Larrew (jlarrew) ** Changed in: qemu Status: New => In Progress -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/659351 Title:

Re: [Qemu-devel] [PATCH][TRIVIAL] vl: coding style cleanups

2013-01-28 Thread Jesse Larrew
On 01/25/2013 04:11 AM, Andreas Färber wrote: > Am 25.01.2013 10:56, schrieb Alexander Graf: >> >> Am 25.01.2013 um 10:47 schrieb Andreas Färber : >> >>> Am 25.01.2013 00:04, schrieb Jesse Larrew: >>>> >>>> Reformat the option parsing code in m

[Qemu-devel] [PATCH][TRIVIAL] vl: coding style cleanups

2013-01-24 Thread Jesse Larrew
Reformat the option parsing code in main() and various supporting functions to conform to the QEMU coding style. Signed-off-by: Jesse Larrew --- vl.c | 476 +-- 1 file changed, 260 insertions(+), 216 deletions(-) diff --git a