* [Qemu-devel] [PATCH 1/8] migration: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 2/8] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() Thomas Huth
` (6 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Amit Shah, Juan Quintela, qemu-devel, Thomas Huth
migrate_rdma_pin_all(), qsb_clone() and qsb_set_length()
are completely unused and thus can be deleted.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
---
include/migration/migration.h | 1 -
include/migration/qemu-file.h | 2 -
migration/migration.c | 9 -------
migration/qemu-file-buf.c | 53 -----------------------------------------
4 files changed, 0 insertions(+), 65 deletions(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 703b7d7..0a1cea0 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -139,7 +139,6 @@ void migrate_add_blocker(Error *reason);
*/
void migrate_del_blocker(Error *reason);
-bool migrate_rdma_pin_all(void);
bool migrate_zero_blocks(void);
bool migrate_auto_converge(void);
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index a923cec..45d7f71 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -133,9 +133,7 @@ bool qemu_file_mode_is_not_valid(const char *mode);
bool qemu_file_is_writable(QEMUFile *f);
QEMUSizedBuffer *qsb_create(const uint8_t *buffer, size_t len);
-QEMUSizedBuffer *qsb_clone(const QEMUSizedBuffer *);
void qsb_free(QEMUSizedBuffer *);
-size_t qsb_set_length(QEMUSizedBuffer *qsb, size_t length);
size_t qsb_get_length(const QEMUSizedBuffer *qsb);
ssize_t qsb_get_buffer(const QEMUSizedBuffer *, off_t start, size_t count,
uint8_t *buf);
diff --git a/migration/migration.c b/migration/migration.c
index b3adbc6..6f1a490 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -540,15 +540,6 @@ void qmp_migrate_set_downtime(double value, Error **errp)
max_downtime = (uint64_t)value;
}
-bool migrate_rdma_pin_all(void)
-{
- MigrationState *s;
-
- s = migrate_get_current();
-
- return s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL];
-}
-
bool migrate_auto_converge(void)
{
MigrationState *s;
diff --git a/migration/qemu-file-buf.c b/migration/qemu-file-buf.c
index e97e0bd..3b79c09 100644
--- a/migration/qemu-file-buf.c
+++ b/migration/qemu-file-buf.c
@@ -124,28 +124,6 @@ size_t qsb_get_length(const QEMUSizedBuffer *qsb)
}
/**
- * Set the length of the buffer; the primary usage of this
- * function is to truncate the number of used bytes in the buffer.
- * The size will not be extended beyond the current number of
- * allocated bytes in the QEMUSizedBuffer.
- *
- * @qsb: A QEMUSizedBuffer
- * @new_len: The new length of bytes in the buffer
- *
- * Returns the number of bytes the buffer was truncated or extended
- * to.
- */
-size_t qsb_set_length(QEMUSizedBuffer *qsb, size_t new_len)
-{
- if (new_len <= qsb->size) {
- qsb->used = new_len;
- } else {
- qsb->used = qsb->size;
- }
- return qsb->used;
-}
-
-/**
* Get the iovec that holds the data for a given position @pos.
*
* @qsb: A QEMUSizedBuffer
@@ -361,37 +339,6 @@ ssize_t qsb_write_at(QEMUSizedBuffer *qsb, const uint8_t *source,
return count;
}
-/**
- * Create a deep copy of the given QEMUSizedBuffer.
- *
- * @qsb: A QEMUSizedBuffer
- *
- * Returns a clone of @qsb or NULL on allocation failure
- */
-QEMUSizedBuffer *qsb_clone(const QEMUSizedBuffer *qsb)
-{
- QEMUSizedBuffer *out = qsb_create(NULL, qsb_get_length(qsb));
- size_t i;
- ssize_t res;
- off_t pos = 0;
-
- if (!out) {
- return NULL;
- }
-
- for (i = 0; i < qsb->n_iov; i++) {
- res = qsb_write_at(out, qsb->iov[i].iov_base,
- pos, qsb->iov[i].iov_len);
- if (res < 0) {
- qsb_free(out);
- return NULL;
- }
- pos += res;
- }
-
- return out;
-}
-
typedef struct QEMUBuffer {
QEMUSizedBuffer *qsb;
QEMUFile *file;
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 2/8] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 1/8] migration: Remove " Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 3/8] pci: Remove unused functions Thomas Huth
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Dmitry Fleytman, qemu-devel, Thomas Huth
The function is not used anymore and thus can be deleted.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>
---
hw/net/vmxnet_rx_pkt.c | 7 -------
hw/net/vmxnet_rx_pkt.h | 9 ---------
2 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/hw/net/vmxnet_rx_pkt.c b/hw/net/vmxnet_rx_pkt.c
index a40e346..acbca6a 100644
--- a/hw/net/vmxnet_rx_pkt.c
+++ b/hw/net/vmxnet_rx_pkt.c
@@ -172,13 +172,6 @@ bool vmxnet_rx_pkt_has_virt_hdr(struct VmxnetRxPkt *pkt)
return pkt->has_virt_hdr;
}
-uint16_t vmxnet_rx_pkt_get_num_frags(struct VmxnetRxPkt *pkt)
-{
- assert(pkt);
-
- return pkt->vec_len;
-}
-
uint16_t vmxnet_rx_pkt_get_vlan_tag(struct VmxnetRxPkt *pkt)
{
assert(pkt);
diff --git a/hw/net/vmxnet_rx_pkt.h b/hw/net/vmxnet_rx_pkt.h
index 6b2c60e..5f8352a 100644
--- a/hw/net/vmxnet_rx_pkt.h
+++ b/hw/net/vmxnet_rx_pkt.h
@@ -114,15 +114,6 @@ bool vmxnet_rx_pkt_is_vlan_stripped(struct VmxnetRxPkt *pkt);
bool vmxnet_rx_pkt_has_virt_hdr(struct VmxnetRxPkt *pkt);
/**
- * returns number of frags attached to the packet
- *
- * @pkt: packet
- * @ret: number of frags
- *
- */
-uint16_t vmxnet_rx_pkt_get_num_frags(struct VmxnetRxPkt *pkt);
-
-/**
* attach data to rx packet
*
* @pkt: packet
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 3/8] pci: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 1/8] migration: Remove " Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 2/8] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-10 15:05 ` Michael S. Tsirkin
2015-03-18 13:19 ` Michael S. Tsirkin
2015-03-09 17:30 ` [Qemu-devel] [PATCH 4/8] monitor: " Thomas Huth
` (4 subsequent siblings)
7 siblings, 2 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Michael S. Tsirkin, qemu-devel, Anthony Liguori, Thomas Huth
The functions pcie_ari_init(), pcie_cap_is_arifwd_enabled()
and ich9_d2pbr_init() are completely unused and thus can
be deleted.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Anthony Liguori <aliguori@amazon.com>
---
hw/pci-bridge/i82801b11.c | 21 ---------------------
hw/pci/pcie.c | 25 -------------------------
include/hw/i386/ich9.h | 1 -
include/hw/pci/pcie.h | 3 ---
4 files changed, 0 insertions(+), 50 deletions(-)
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 14cd7fd..7e79bc0 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -101,27 +101,6 @@ static const TypeInfo i82801b11_bridge_info = {
.class_init = i82801b11_bridge_class_init,
};
-PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
-{
- PCIDevice *d;
- PCIBridge *br;
- char buf[16];
- DeviceState *qdev;
-
- d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
- if (!d) {
- return NULL;
- }
- br = PCI_BRIDGE(d);
- qdev = DEVICE(d);
-
- snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
- pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
- qdev_init_nofail(qdev);
-
- return pci_bridge_get_sec_bus(br);
-}
-
static void d2pbr_register(void)
{
type_register_static(&i82801b11_bridge_info);
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 1abbbb1..9b9f63d 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -515,19 +515,6 @@ void pcie_cap_arifwd_reset(PCIDevice *dev)
pci_long_test_and_clear_mask(devctl2, PCI_EXP_DEVCTL2_ARI);
}
-bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev)
-{
- if (!pci_is_express(dev)) {
- return false;
- }
- if (!dev->exp.exp_cap) {
- return false;
- }
-
- return pci_get_long(dev->config + dev->exp.exp_cap + PCI_EXP_DEVCTL2) &
- PCI_EXP_DEVCTL2_ARI;
-}
-
/**************************************************************************
* pci express extended capability list management functions
* uint16_t ext_cap_id (16 bit)
@@ -621,15 +608,3 @@ void pcie_add_capability(PCIDevice *dev,
/* Check capability by default */
memset(dev->cmask + offset, 0xFF, size);
}
-
-/**************************************************************************
- * pci express extended capability helper functions
- */
-
-/* ARI */
-void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn)
-{
- pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
- offset, PCI_ARI_SIZEOF);
- pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8);
-}
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index 59ea25b..5cede9b 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -19,7 +19,6 @@ void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin);
void ich9_lpc_pm_init(PCIDevice *pci_lpc);
-PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
#define ICH9_CC_SIZE (16 * 1024) /* 16KB */
diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h
index b48a7a2..ae0969a 100644
--- a/include/hw/pci/pcie.h
+++ b/include/hw/pci/pcie.h
@@ -106,7 +106,6 @@ void pcie_cap_flr_write_config(PCIDevice *dev,
/* ARI forwarding capability and control */
void pcie_cap_arifwd_init(PCIDevice *dev);
void pcie_cap_arifwd_reset(PCIDevice *dev);
-bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev);
/* PCI express extended capability helper functions */
uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id);
@@ -114,8 +113,6 @@ void pcie_add_capability(PCIDevice *dev,
uint16_t cap_id, uint8_t cap_ver,
uint16_t offset, uint16_t size);
-void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn);
-
extern const VMStateDescription vmstate_pcie_device;
#define VMSTATE_PCIE_DEVICE(_field, _state) { \
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 3/8] pci: Remove unused functions
2015-03-09 17:30 ` [Qemu-devel] [PATCH 3/8] pci: Remove unused functions Thomas Huth
@ 2015-03-10 15:05 ` Michael S. Tsirkin
2015-03-18 13:19 ` Michael S. Tsirkin
1 sibling, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2015-03-10 15:05 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel
On Mon, Mar 09, 2015 at 06:30:10PM +0100, Thomas Huth wrote:
> The functions pcie_ari_init(), pcie_cap_is_arifwd_enabled()
> and ich9_d2pbr_init() are completely unused and thus can
> be deleted.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Anthony Liguori <aliguori@amazon.com>
I'd rather split ich9 out.
We might want to revert ari patch at some point
if/when we want to support ARI.
> ---
> hw/pci-bridge/i82801b11.c | 21 ---------------------
> hw/pci/pcie.c | 25 -------------------------
> include/hw/i386/ich9.h | 1 -
> include/hw/pci/pcie.h | 3 ---
> 4 files changed, 0 insertions(+), 50 deletions(-)
>
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 14cd7fd..7e79bc0 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -101,27 +101,6 @@ static const TypeInfo i82801b11_bridge_info = {
> .class_init = i82801b11_bridge_class_init,
> };
>
> -PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
> -{
> - PCIDevice *d;
> - PCIBridge *br;
> - char buf[16];
> - DeviceState *qdev;
> -
> - d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
> - if (!d) {
> - return NULL;
> - }
> - br = PCI_BRIDGE(d);
> - qdev = DEVICE(d);
> -
> - snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
> - pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
> - qdev_init_nofail(qdev);
> -
> - return pci_bridge_get_sec_bus(br);
> -}
> -
> static void d2pbr_register(void)
> {
> type_register_static(&i82801b11_bridge_info);
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 1abbbb1..9b9f63d 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -515,19 +515,6 @@ void pcie_cap_arifwd_reset(PCIDevice *dev)
> pci_long_test_and_clear_mask(devctl2, PCI_EXP_DEVCTL2_ARI);
> }
>
> -bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev)
> -{
> - if (!pci_is_express(dev)) {
> - return false;
> - }
> - if (!dev->exp.exp_cap) {
> - return false;
> - }
> -
> - return pci_get_long(dev->config + dev->exp.exp_cap + PCI_EXP_DEVCTL2) &
> - PCI_EXP_DEVCTL2_ARI;
> -}
> -
> /**************************************************************************
> * pci express extended capability list management functions
> * uint16_t ext_cap_id (16 bit)
> @@ -621,15 +608,3 @@ void pcie_add_capability(PCIDevice *dev,
> /* Check capability by default */
> memset(dev->cmask + offset, 0xFF, size);
> }
> -
> -/**************************************************************************
> - * pci express extended capability helper functions
> - */
> -
> -/* ARI */
> -void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn)
> -{
> - pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
> - offset, PCI_ARI_SIZEOF);
> - pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8);
> -}
> diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
> index 59ea25b..5cede9b 100644
> --- a/include/hw/i386/ich9.h
> +++ b/include/hw/i386/ich9.h
> @@ -19,7 +19,6 @@ void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
> int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
> PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin);
> void ich9_lpc_pm_init(PCIDevice *pci_lpc);
> -PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
> I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
>
> #define ICH9_CC_SIZE (16 * 1024) /* 16KB */
> diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h
> index b48a7a2..ae0969a 100644
> --- a/include/hw/pci/pcie.h
> +++ b/include/hw/pci/pcie.h
> @@ -106,7 +106,6 @@ void pcie_cap_flr_write_config(PCIDevice *dev,
> /* ARI forwarding capability and control */
> void pcie_cap_arifwd_init(PCIDevice *dev);
> void pcie_cap_arifwd_reset(PCIDevice *dev);
> -bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev);
>
> /* PCI express extended capability helper functions */
> uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id);
> @@ -114,8 +113,6 @@ void pcie_add_capability(PCIDevice *dev,
> uint16_t cap_id, uint8_t cap_ver,
> uint16_t offset, uint16_t size);
>
> -void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn);
> -
> extern const VMStateDescription vmstate_pcie_device;
>
> #define VMSTATE_PCIE_DEVICE(_field, _state) { \
> --
> 1.7.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 3/8] pci: Remove unused functions
2015-03-09 17:30 ` [Qemu-devel] [PATCH 3/8] pci: Remove unused functions Thomas Huth
2015-03-10 15:05 ` Michael S. Tsirkin
@ 2015-03-18 13:19 ` Michael S. Tsirkin
1 sibling, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2015-03-18 13:19 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel, Anthony Liguori
On Mon, Mar 09, 2015 at 06:30:10PM +0100, Thomas Huth wrote:
> The functions pcie_ari_init(), pcie_cap_is_arifwd_enabled()
> and ich9_d2pbr_init() are completely unused and thus can
> be deleted.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Anthony Liguori <aliguori@amazon.com>
Pls split this out to two patches. ARI might be useful in the future.
ich9_d2pbr_init can go I think.
> ---
> hw/pci-bridge/i82801b11.c | 21 ---------------------
> hw/pci/pcie.c | 25 -------------------------
> include/hw/i386/ich9.h | 1 -
> include/hw/pci/pcie.h | 3 ---
> 4 files changed, 0 insertions(+), 50 deletions(-)
>
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 14cd7fd..7e79bc0 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -101,27 +101,6 @@ static const TypeInfo i82801b11_bridge_info = {
> .class_init = i82801b11_bridge_class_init,
> };
>
> -PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
> -{
> - PCIDevice *d;
> - PCIBridge *br;
> - char buf[16];
> - DeviceState *qdev;
> -
> - d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
> - if (!d) {
> - return NULL;
> - }
> - br = PCI_BRIDGE(d);
> - qdev = DEVICE(d);
> -
> - snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
> - pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
> - qdev_init_nofail(qdev);
> -
> - return pci_bridge_get_sec_bus(br);
> -}
> -
> static void d2pbr_register(void)
> {
> type_register_static(&i82801b11_bridge_info);
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 1abbbb1..9b9f63d 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -515,19 +515,6 @@ void pcie_cap_arifwd_reset(PCIDevice *dev)
> pci_long_test_and_clear_mask(devctl2, PCI_EXP_DEVCTL2_ARI);
> }
>
> -bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev)
> -{
> - if (!pci_is_express(dev)) {
> - return false;
> - }
> - if (!dev->exp.exp_cap) {
> - return false;
> - }
> -
> - return pci_get_long(dev->config + dev->exp.exp_cap + PCI_EXP_DEVCTL2) &
> - PCI_EXP_DEVCTL2_ARI;
> -}
> -
> /**************************************************************************
> * pci express extended capability list management functions
> * uint16_t ext_cap_id (16 bit)
> @@ -621,15 +608,3 @@ void pcie_add_capability(PCIDevice *dev,
> /* Check capability by default */
> memset(dev->cmask + offset, 0xFF, size);
> }
> -
> -/**************************************************************************
> - * pci express extended capability helper functions
> - */
> -
> -/* ARI */
> -void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn)
> -{
> - pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
> - offset, PCI_ARI_SIZEOF);
> - pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8);
> -}
> diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
> index 59ea25b..5cede9b 100644
> --- a/include/hw/i386/ich9.h
> +++ b/include/hw/i386/ich9.h
> @@ -19,7 +19,6 @@ void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
> int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
> PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin);
> void ich9_lpc_pm_init(PCIDevice *pci_lpc);
> -PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
> I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
>
> #define ICH9_CC_SIZE (16 * 1024) /* 16KB */
> diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h
> index b48a7a2..ae0969a 100644
> --- a/include/hw/pci/pcie.h
> +++ b/include/hw/pci/pcie.h
> @@ -106,7 +106,6 @@ void pcie_cap_flr_write_config(PCIDevice *dev,
> /* ARI forwarding capability and control */
> void pcie_cap_arifwd_init(PCIDevice *dev);
> void pcie_cap_arifwd_reset(PCIDevice *dev);
> -bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev);
>
> /* PCI express extended capability helper functions */
> uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id);
> @@ -114,8 +113,6 @@ void pcie_add_capability(PCIDevice *dev,
> uint16_t cap_id, uint8_t cap_ver,
> uint16_t offset, uint16_t size);
>
> -void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn);
> -
> extern const VMStateDescription vmstate_pcie_device;
>
> #define VMSTATE_PCIE_DEVICE(_field, _state) { \
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 4/8] monitor: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
` (2 preceding siblings ...)
2015-03-09 17:30 ` [Qemu-devel] [PATCH 3/8] pci: Remove unused functions Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 5/8] ioport: " Thomas Huth
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Luiz Capitulino, qemu-devel, Thomas Huth
The functions ringbuf_read_completion() and monitor_get_rs()
are not used anywhere anymore, so let's remove them.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
---
hmp.h | 1 -
include/monitor/monitor.h | 1 -
monitor.c | 13 -------------
3 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/hmp.h b/hmp.h
index 81177b2..0c96e9a 100644
--- a/hmp.h
+++ b/hmp.h
@@ -106,7 +106,6 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str);
void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str);
void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str);
void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str);
-void ringbuf_read_completion(ReadLineState *rs, int nb_args, const char *str);
void watchdog_action_completion(ReadLineState *rs, int nb_args,
const char *str);
void migrate_set_capability_completion(ReadLineState *rs, int nb_args,
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 1c06bed..df67d56 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -47,7 +47,6 @@ typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
void monitor_set_error(Monitor *mon, QError *qerror);
void monitor_read_command(Monitor *mon, int show_prompt);
-ReadLineState *monitor_get_rs(Monitor *mon);
int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
void *opaque);
diff --git a/monitor.c b/monitor.c
index c86a89e..18d7f23 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4385,14 +4385,6 @@ static void ringbuf_completion(ReadLineState *rs, const char *str)
qapi_free_ChardevInfoList(start);
}
-void ringbuf_read_completion(ReadLineState *rs, int nb_args, const char *str)
-{
- if (nb_args != 2) {
- return;
- }
- ringbuf_completion(rs, str);
-}
-
void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str)
{
if (nb_args != 2) {
@@ -5370,11 +5362,6 @@ static void bdrv_password_cb(void *opaque, const char *password,
monitor_read_command(mon, 1);
}
-ReadLineState *monitor_get_rs(Monitor *mon)
-{
- return mon->rs;
-}
-
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
BlockCompletionFunc *completion_cb,
void *opaque)
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 5/8] ioport: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
` (3 preceding siblings ...)
2015-03-09 17:30 ` [Qemu-devel] [PATCH 4/8] monitor: " Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-09 19:23 ` Paolo Bonzini
2015-03-09 17:30 ` [Qemu-devel] [PATCH 6/8] usb: " Thomas Huth
` (2 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Paolo Bonzini, qemu-devel, Thomas Huth
The functions portio_list_destroy() and portio_list_del()
are not used anywhere, so let's remove them.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
include/exec/ioport.h | 2 --
ioport.c | 24 ------------------------
2 files changed, 0 insertions(+), 26 deletions(-)
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index 3bd6722..218c835 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -71,10 +71,8 @@ void portio_list_init(PortioList *piolist, Object *owner,
const struct MemoryRegionPortio *callbacks,
void *opaque, const char *name);
void portio_list_set_flush_coalesced(PortioList *piolist);
-void portio_list_destroy(PortioList *piolist);
void portio_list_add(PortioList *piolist,
struct MemoryRegion *address_space,
uint32_t addr);
-void portio_list_del(PortioList *piolist);
#endif /* IOPORT_H */
diff --git a/ioport.c b/ioport.c
index 783a3ae..712b9e2 100644
--- a/ioport.c
+++ b/ioport.c
@@ -147,19 +147,6 @@ void portio_list_set_flush_coalesced(PortioList *piolist)
piolist->flush_coalesced_mmio = true;
}
-void portio_list_destroy(PortioList *piolist)
-{
- MemoryRegionPortioList *mrpio;
- unsigned i;
-
- for (i = 0; i < piolist->nr; ++i) {
- mrpio = container_of(piolist->regions[i], MemoryRegionPortioList, mr);
- object_unparent(OBJECT(&mrpio->mr));
- g_free(mrpio);
- }
- g_free(piolist->regions);
-}
-
static const MemoryRegionPortio *find_portio(MemoryRegionPortioList *mrpio,
uint64_t offset, unsigned size,
bool write)
@@ -290,14 +277,3 @@ void portio_list_add(PortioList *piolist,
/* There will always be an open sub-list. */
portio_list_add_1(piolist, pio_start, count, start, off_low, off_high);
}
-
-void portio_list_del(PortioList *piolist)
-{
- MemoryRegionPortioList *mrpio;
- unsigned i;
-
- for (i = 0; i < piolist->nr; ++i) {
- mrpio = container_of(piolist->regions[i], MemoryRegionPortioList, mr);
- memory_region_del_subregion(piolist->address_space, &mrpio->mr);
- }
-}
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 5/8] ioport: Remove unused functions
2015-03-09 17:30 ` [Qemu-devel] [PATCH 5/8] ioport: " Thomas Huth
@ 2015-03-09 19:23 ` Paolo Bonzini
2015-03-10 6:09 ` Thomas Huth
0 siblings, 1 reply; 14+ messages in thread
From: Paolo Bonzini @ 2015-03-09 19:23 UTC (permalink / raw)
To: Thomas Huth, qemu-trivial; +Cc: qemu-devel
On 09/03/2015 18:30, Thomas Huth wrote:
> The functions portio_list_destroy() and portio_list_del()
> are not used anywhere, so let's remove them.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
I think it's better to provide a complete API, mimicking memory_region_*
as much as possible, so I'd rather keep these.
Paolo
> ---
> include/exec/ioport.h | 2 --
> ioport.c | 24 ------------------------
> 2 files changed, 0 insertions(+), 26 deletions(-)
>
> diff --git a/include/exec/ioport.h b/include/exec/ioport.h
> index 3bd6722..218c835 100644
> --- a/include/exec/ioport.h
> +++ b/include/exec/ioport.h
> @@ -71,10 +71,8 @@ void portio_list_init(PortioList *piolist, Object *owner,
> const struct MemoryRegionPortio *callbacks,
> void *opaque, const char *name);
> void portio_list_set_flush_coalesced(PortioList *piolist);
> -void portio_list_destroy(PortioList *piolist);
> void portio_list_add(PortioList *piolist,
> struct MemoryRegion *address_space,
> uint32_t addr);
> -void portio_list_del(PortioList *piolist);
>
> #endif /* IOPORT_H */
> diff --git a/ioport.c b/ioport.c
> index 783a3ae..712b9e2 100644
> --- a/ioport.c
> +++ b/ioport.c
> @@ -147,19 +147,6 @@ void portio_list_set_flush_coalesced(PortioList *piolist)
> piolist->flush_coalesced_mmio = true;
> }
>
> -void portio_list_destroy(PortioList *piolist)
> -{
> - MemoryRegionPortioList *mrpio;
> - unsigned i;
> -
> - for (i = 0; i < piolist->nr; ++i) {
> - mrpio = container_of(piolist->regions[i], MemoryRegionPortioList, mr);
> - object_unparent(OBJECT(&mrpio->mr));
> - g_free(mrpio);
> - }
> - g_free(piolist->regions);
> -}
> -
> static const MemoryRegionPortio *find_portio(MemoryRegionPortioList *mrpio,
> uint64_t offset, unsigned size,
> bool write)
> @@ -290,14 +277,3 @@ void portio_list_add(PortioList *piolist,
> /* There will always be an open sub-list. */
> portio_list_add_1(piolist, pio_start, count, start, off_low, off_high);
> }
> -
> -void portio_list_del(PortioList *piolist)
> -{
> - MemoryRegionPortioList *mrpio;
> - unsigned i;
> -
> - for (i = 0; i < piolist->nr; ++i) {
> - mrpio = container_of(piolist->regions[i], MemoryRegionPortioList, mr);
> - memory_region_del_subregion(piolist->address_space, &mrpio->mr);
> - }
> -}
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 5/8] ioport: Remove unused functions
2015-03-09 19:23 ` Paolo Bonzini
@ 2015-03-10 6:09 ` Thomas Huth
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-10 6:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-trivial, qemu-devel
On Mon, 09 Mar 2015 20:23:24 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 09/03/2015 18:30, Thomas Huth wrote:
> > The functions portio_list_destroy() and portio_list_del()
> > are not used anywhere, so let's remove them.
> >
> > Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
>
> I think it's better to provide a complete API, mimicking memory_region_*
> as much as possible, so I'd rather keep these.
Ok, then let's keep then and drop this patch.
Thomas
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 6/8] usb: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
` (4 preceding siblings ...)
2015-03-09 17:30 ` [Qemu-devel] [PATCH 5/8] ioport: " Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-10 8:38 ` Gerd Hoffmann
2015-03-09 17:30 ` [Qemu-devel] [PATCH 7/8] util: " Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 8/8] Remove various " Thomas Huth
7 siblings, 1 reply; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Gerd Hoffmann, qemu-devel, Thomas Huth
Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
not used anymore.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/core.c | 41 -----------------------------------------
include/hw/usb.h | 5 -----
2 files changed, 0 insertions(+), 46 deletions(-)
diff --git a/hw/usb/core.c b/hw/usb/core.c
index cf34755..d0025db 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -331,23 +331,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
usb_packet_complete(s, p);
}
-/* XXX: fix overflow */
-int set_usb_string(uint8_t *buf, const char *str)
-{
- int len, i;
- uint8_t *q;
-
- q = buf;
- len = strlen(str);
- *q++ = 2 * len + 2;
- *q++ = 3;
- for(i = 0; i < len; i++) {
- *q++ = str[i];
- *q++ = 0;
- }
- return q - buf;
-}
-
USBDevice *usb_find_device(USBPort *port, uint8_t addr)
{
USBDevice *dev = port->dev;
@@ -749,12 +732,6 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
uep->type = type;
}
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
-{
- struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
- return uep->ifnum;
-}
-
void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
{
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -782,12 +759,6 @@ void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
uep->max_packet_size = size * microframes;
}
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep)
-{
- struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
- return uep->max_packet_size;
-}
-
void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
{
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -801,18 +772,6 @@ void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
}
}
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep)
-{
- struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
- return uep->max_streams;
-}
-
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled)
-{
- struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
- uep->pipeline = enabled;
-}
-
void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted)
{
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
diff --git a/include/hw/usb.h b/include/hw/usb.h
index e6dfb87..bdd570a 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -445,15 +445,11 @@ void usb_ep_reset(USBDevice *dev);
void usb_ep_dump(USBDevice *dev);
struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
uint16_t raw);
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep);
void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw);
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep);
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled);
void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted);
USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
uint64_t id);
@@ -469,7 +465,6 @@ void usb_port_reset(USBPort *port);
void usb_device_reset(USBDevice *dev);
void usb_wakeup(USBEndpoint *ep, unsigned int stream);
void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
-int set_usb_string(uint8_t *buf, const char *str);
/* usb-linux.c */
USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 6/8] usb: Remove unused functions
2015-03-09 17:30 ` [Qemu-devel] [PATCH 6/8] usb: " Thomas Huth
@ 2015-03-10 8:38 ` Gerd Hoffmann
0 siblings, 0 replies; 14+ messages in thread
From: Gerd Hoffmann @ 2015-03-10 8:38 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel
On Mo, 2015-03-09 at 18:30 +0100, Thomas Huth wrote:
> Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
> usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
> not used anymore.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/usb/core.c | 41 -----------------------------------------
> include/hw/usb.h | 5 -----
> 2 files changed, 0 insertions(+), 46 deletions(-)
>
> diff --git a/hw/usb/core.c b/hw/usb/core.c
> index cf34755..d0025db 100644
> --- a/hw/usb/core.c
> +++ b/hw/usb/core.c
> @@ -331,23 +331,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
> usb_packet_complete(s, p);
> }
>
> -/* XXX: fix overflow */
> -int set_usb_string(uint8_t *buf, const char *str)
> -{
> - int len, i;
> - uint8_t *q;
> -
> - q = buf;
> - len = strlen(str);
> - *q++ = 2 * len + 2;
> - *q++ = 3;
> - for(i = 0; i < len; i++) {
> - *q++ = str[i];
> - *q++ = 0;
> - }
> - return q - buf;
> -}
> -
> USBDevice *usb_find_device(USBPort *port, uint8_t addr)
> {
> USBDevice *dev = port->dev;
> @@ -749,12 +732,6 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
> uep->type = type;
> }
>
> -uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
> -{
> - struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> - return uep->ifnum;
> -}
> -
> void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
> {
> struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> @@ -782,12 +759,6 @@ void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
> uep->max_packet_size = size * microframes;
> }
>
> -int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep)
> -{
> - struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> - return uep->max_packet_size;
> -}
> -
> void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
> {
> struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> @@ -801,18 +772,6 @@ void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
> }
> }
>
> -int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep)
> -{
> - struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> - return uep->max_streams;
> -}
> -
> -void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled)
> -{
> - struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> - uep->pipeline = enabled;
> -}
> -
> void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted)
> {
> struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> diff --git a/include/hw/usb.h b/include/hw/usb.h
> index e6dfb87..bdd570a 100644
> --- a/include/hw/usb.h
> +++ b/include/hw/usb.h
> @@ -445,15 +445,11 @@ void usb_ep_reset(USBDevice *dev);
> void usb_ep_dump(USBDevice *dev);
> struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
> uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
> -uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
> void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
> void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
> void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
> uint16_t raw);
> -int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep);
> void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw);
> -int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep);
> -void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled);
> void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted);
> USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
> uint64_t id);
> @@ -469,7 +465,6 @@ void usb_port_reset(USBPort *port);
> void usb_device_reset(USBDevice *dev);
> void usb_wakeup(USBEndpoint *ep, unsigned int stream);
> void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
> -int set_usb_string(uint8_t *buf, const char *str);
>
> /* usb-linux.c */
> USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 7/8] util: Remove unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
` (5 preceding siblings ...)
2015-03-09 17:30 ` [Qemu-devel] [PATCH 6/8] usb: " Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
2015-03-09 17:30 ` [Qemu-devel] [PATCH 8/8] Remove various " Thomas Huth
7 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: Markus Armbruster, qemu-devel, Thomas Huth
Delete the unused functions qemu_signalfd_available(),
qemu_send_full() and qemu_recv_full().
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>
---
include/qemu-common.h | 4 ---
include/qemu/compatfd.h | 1 -
util/compatfd.c | 19 -------------
util/osdep.c | 66 -----------------------------------------------
4 files changed, 0 insertions(+), 90 deletions(-)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 1b5cffb..6b373ff 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -217,10 +217,6 @@ void *qemu_oom_check(void *ptr);
ssize_t qemu_write_full(int fd, const void *buf, size_t count)
QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
- QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
- QEMU_WARN_UNUSED_RESULT;
#ifndef _WIN32
int qemu_pipe(int pipefd[2]);
diff --git a/include/qemu/compatfd.h b/include/qemu/compatfd.h
index 6b04877..fc37915 100644
--- a/include/qemu/compatfd.h
+++ b/include/qemu/compatfd.h
@@ -39,6 +39,5 @@ struct qemu_signalfd_siginfo {
};
int qemu_signalfd(const sigset_t *mask);
-bool qemu_signalfd_available(void);
#endif
diff --git a/util/compatfd.c b/util/compatfd.c
index 341ada6..e857150 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -108,22 +108,3 @@ int qemu_signalfd(const sigset_t *mask)
return qemu_signalfd_compat(mask);
}
-
-bool qemu_signalfd_available(void)
-{
-#ifdef CONFIG_SIGNALFD
- sigset_t mask;
- int fd;
- bool ok;
- sigemptyset(&mask);
- errno = 0;
- fd = syscall(SYS_signalfd, -1, &mask, _NSIG / 8);
- ok = (errno != ENOSYS);
- if (fd >= 0) {
- close(fd);
- }
- return ok;
-#else
- return false;
-#endif
-}
diff --git a/util/osdep.c b/util/osdep.c
index b2bd154..f938b69 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -310,72 +310,6 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
return ret;
}
-/*
- * A variant of send(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- * - return a short write (then name is wrong)
- * - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
-{
- ssize_t ret = 0;
- ssize_t total = 0;
-
- while (count) {
- ret = send(fd, buf, count, flags);
- if (ret < 0) {
- if (errno == EINTR) {
- continue;
- }
- break;
- }
-
- count -= ret;
- buf += ret;
- total += ret;
- }
-
- return total;
-}
-
-/*
- * A variant of recv(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- * - return a short write (then name is wrong)
- * - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
-{
- ssize_t ret = 0;
- ssize_t total = 0;
-
- while (count) {
- ret = qemu_recv(fd, buf, count, flags);
- if (ret <= 0) {
- if (ret < 0 && errno == EINTR) {
- continue;
- }
- break;
- }
-
- count -= ret;
- buf += ret;
- total += ret;
- }
-
- return total;
-}
-
void qemu_set_version(const char *version)
{
qemu_version = version;
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 8/8] Remove various unused functions
2015-03-09 17:30 [Qemu-devel] [PATCH 0/8] Remove more unused functions Thomas Huth
` (6 preceding siblings ...)
2015-03-09 17:30 ` [Qemu-devel] [PATCH 7/8] util: " Thomas Huth
@ 2015-03-09 17:30 ` Thomas Huth
7 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2015-03-09 17:30 UTC (permalink / raw)
To: qemu-trivial; +Cc: qemu-devel, Thomas Huth
The functions tpm_backend_thread_tpm_reset(), serial_set_frequency()
and iothread_find() are completely unused, let's remove them.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
---
backends/tpm.c | 11 -----------
hw/char/serial.c | 7 -------
include/hw/char/serial.h | 1 -
include/sysemu/iothread.h | 1 -
include/sysemu/tpm_backend_int.h | 2 --
iothread.c | 12 ------------
6 files changed, 0 insertions(+), 34 deletions(-)
diff --git a/backends/tpm.c b/backends/tpm.c
index 01860c4..0566202 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -165,17 +165,6 @@ void tpm_backend_thread_end(TPMBackendThread *tbt)
}
}
-void tpm_backend_thread_tpm_reset(TPMBackendThread *tbt,
- GFunc func, gpointer user_data)
-{
- if (!tbt->pool) {
- tpm_backend_thread_create(tbt, func, user_data);
- } else {
- g_thread_pool_push(tbt->pool, (gpointer)TPM_BACKEND_CMD_TPM_RESET,
- NULL);
- }
-}
-
static const TypeInfo tpm_backend_info = {
.name = TYPE_TPM_BACKEND,
.parent = TYPE_OBJECT,
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 55011cf..231ec7d 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -876,13 +876,6 @@ void serial_exit_core(SerialState *s)
qemu_unregister_reset(serial_reset, s);
}
-/* Change the main reference oscillator frequency. */
-void serial_set_frequency(SerialState *s, uint32_t frequency)
-{
- s->baudbase = frequency;
- serial_update_parameters(s);
-}
-
const MemoryRegionOps serial_io_ops = {
.read = serial_ioport_read,
.write = serial_ioport_write,
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 15beb6b..4be245f 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -80,7 +80,6 @@ extern const MemoryRegionOps serial_io_ops;
void serial_realize_core(SerialState *s, Error **errp);
void serial_exit_core(SerialState *s);
-void serial_set_frequency(SerialState *s, uint32_t frequency);
/* legacy pre qom */
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h
index 7c01a61..2eefea1 100644
--- a/include/sysemu/iothread.h
+++ b/include/sysemu/iothread.h
@@ -33,7 +33,6 @@ typedef struct {
#define IOTHREAD(obj) \
OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD)
-IOThread *iothread_find(const char *id);
char *iothread_get_id(IOThread *iothread);
AioContext *iothread_get_aio_context(IOThread *iothread);
diff --git a/include/sysemu/tpm_backend_int.h b/include/sysemu/tpm_backend_int.h
index 05d94d0..40f693a 100644
--- a/include/sysemu/tpm_backend_int.h
+++ b/include/sysemu/tpm_backend_int.h
@@ -32,8 +32,6 @@ void tpm_backend_thread_deliver_request(TPMBackendThread *tbt);
void tpm_backend_thread_create(TPMBackendThread *tbt,
GFunc func, gpointer user_data);
void tpm_backend_thread_end(TPMBackendThread *tbt);
-void tpm_backend_thread_tpm_reset(TPMBackendThread *tbt,
- GFunc func, gpointer user_data);
typedef enum TPMBackendCmd {
TPM_BACKEND_CMD_INIT = 1,
diff --git a/iothread.c b/iothread.c
index 342a23f..878a594 100644
--- a/iothread.c
+++ b/iothread.c
@@ -121,18 +121,6 @@ static void iothread_register_types(void)
type_init(iothread_register_types)
-IOThread *iothread_find(const char *id)
-{
- Object *container = container_get(object_get_root(), IOTHREADS_PATH);
- Object *child;
-
- child = object_property_get_link(container, id, NULL);
- if (!child) {
- return NULL;
- }
- return (IOThread *)object_dynamic_cast(child, TYPE_IOTHREAD);
-}
-
char *iothread_get_id(IOThread *iothread)
{
return object_get_canonical_path_component(OBJECT(iothread));
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread