diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 4ece6c2..6fe7e58 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -20,6 +20,7 @@
 #include "qemu/timer.h"
 #include "virtio-net.h"
 #include "vhost_net.h"
+#include "virtio-bus.h"
 
 #define VIRTIO_NET_VM_VERSION    11
 
@@ -30,6 +31,9 @@
  * - we could suppress RX interrupt if we were so inclined.
  */
 
+/*
+ * Moving to QOM later in this serie.
+ */
 static VirtIONet *to_virtio_net(VirtIODevice *vdev)
 {
     return (VirtIONet *)vdev;
@@ -969,14 +973,33 @@ static NetClientInfo net_virtio_info = {
     .link_status_changed = virtio_net_set_link_status,
 };
 
-VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
-                              virtio_net_conf *net)
+void virtio_net_set_conf(DeviceState *dev, virtio_net_conf *net_conf,
+                         NICConf *nic_conf)
 {
-    VirtIONet *n;
+    VirtIONet *n = VIRTIO_NET(dev);
+    memcpy(&(n->net_conf), net_conf, sizeof(struct virtio_net_conf));
+    memcpy(&(n->nic_conf), nic_conf, sizeof(struct NICConf));
+}
 
-    n = (VirtIONet *)virtio_common_init("virtio-net", VIRTIO_ID_NET,
-                                        sizeof(struct virtio_net_config),
-                                        sizeof(VirtIONet));
+static VirtIODevice *virtio_net_common_init(DeviceState *dev, NICConf *conf,
+                                           virtio_net_conf *net, VirtIONet **pn)
+{
+    VirtIONet *n = *pn;
+
+    /*
+     * We have two cases here : the old virtio-net-pci device, and the
+     * refactored virtio-net.
+     */
+    if (n == NULL) {
+        /* virtio-net-pci */
+        n = (VirtIONet *)virtio_common_init("virtio-net", VIRTIO_ID_NET,
+                                            sizeof(struct virtio_net_config),
+                                            sizeof(VirtIONet));
+    } else {
+        /* virtio-net */
+        virtio_init(VIRTIO_DEVICE(n), "virtio-net", VIRTIO_ID_NET,
+                                      sizeof(struct virtio_net_config));
+    }
 
     n->vdev.get_config = virtio_net_get_config;
     n->vdev.set_config = virtio_net_set_config;
@@ -1036,6 +1059,13 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
     return &n->vdev;
 }
 
+VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
+                              virtio_net_conf *net)
+{
+    VirtIONet *n = NULL;
+    return virtio_net_common_init(dev, conf, net, &n);
+}
+
 void virtio_net_exit(VirtIODevice *vdev)
 {
     VirtIONet *n = DO_UPCAST(VirtIONet, vdev, vdev);
@@ -1060,3 +1090,76 @@ void virtio_net_exit(VirtIODevice *vdev)
     qemu_del_net_client(&n->nic->nc);
     virtio_cleanup(&n->vdev);
 }
+
+static int virtio_net_device_init(VirtIODevice *vdev)
+{
+    DeviceState *qdev = DEVICE(vdev);
+    VirtIONet *n = VIRTIO_NET(vdev);
+    if (virtio_net_common_init(qdev, &(n->nic_conf),
+                               &(n->net_conf), &n) == NULL) {
+        return -1;
+    }
+    return 0;
+}
+
+static int virtio_net_device_exit(DeviceState *qdev)
+{
+    VirtIONet *n = VIRTIO_NET(qdev);
+    VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
+
+    /* This will stop vhost backend if appropriate. */
+    virtio_net_set_status(vdev, 0);
+
+    qemu_purge_queued_packets(&n->nic->nc);
+
+    unregister_savevm(qdev, "virtio-net", n);
+
+    g_free(n->mac_table.macs);
+    g_free(n->vlans);
+
+    if (n->tx_timer) {
+        qemu_del_timer(n->tx_timer);
+        qemu_free_timer(n->tx_timer);
+    } else {
+        qemu_bh_delete(n->tx_bh);
+    }
+
+    qemu_del_net_client(&n->nic->nc);
+    virtio_common_cleanup(vdev);
+    return 0;
+}
+
+static Property virtio_net_properties[] = {
+    DEFINE_VIRTIO_NET_PROPERTIES(VirtIONet),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void virtio_net_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
+    dc->exit = virtio_net_device_exit;
+    dc->props = virtio_net_properties;
+    vdc->init = virtio_net_device_init;
+    vdc->get_config = virtio_net_get_config;
+    vdc->set_config = virtio_net_set_config;
+    vdc->get_features = virtio_net_get_features;
+    vdc->set_features = virtio_net_set_features;
+    vdc->bad_features = virtio_net_bad_features;
+    vdc->reset = virtio_net_reset;
+    vdc->set_status = virtio_net_set_status;
+}
+
+static const TypeInfo virtio_net_info = {
+    .name = TYPE_VIRTIO_NET,
+    .parent = TYPE_VIRTIO_DEVICE,
+    .instance_size = sizeof(VirtIONet),
+    .class_init = virtio_net_class_init,
+};
+
+static void virtio_register_types(void)
+{
+    type_register_static(&virtio_net_info);
+}
+
+type_init(virtio_register_types)
diff --git a/hw/virtio-net.h b/hw/virtio-net.h
index f6ff85d..2bdc8fd 100644
--- a/hw/virtio-net.h
+++ b/hw/virtio-net.h
@@ -17,6 +17,10 @@
 #include "virtio.h"
 #include "pci/pci.h"
 
+#define TYPE_VIRTIO_NET "virtio-net"
+#define VIRTIO_NET(obj) \
+        OBJECT_CHECK(VirtIONet, (obj), TYPE_VIRTIO_NET)
+
 #define ETH_ALEN    6
 
 /* from Linux's virtio_net.h */
@@ -162,6 +166,8 @@ typedef struct VirtIONet {
         uint8_t *macs;
     } mac_table;
     uint32_t *vlans;
+    virtio_net_conf net_conf;
+    NICConf nic_conf;
     DeviceState *qdev;
 } VirtIONet;
 
@@ -200,4 +206,16 @@ typedef struct VirtIONet {
         DEFINE_PROP_BIT("ctrl_rx", _state, _field, VIRTIO_NET_F_CTRL_RX, true), \
         DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN, true), \
         DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true)
+
+#define DEFINE_VIRTIO_NET_PROPERTIES(_state)                        \
+        DEFINE_NIC_PROPERTIES(_state, nic_conf),                    \
+        DEFINE_PROP_UINT32("x-txtimer", _state, net_conf.txtimer,   \
+                           TX_TIMER_INTERVAL),                      \
+        DEFINE_PROP_INT32("x-txburst", _state, net_conf.txburst,    \
+                          TX_BURST),                                \
+        DEFINE_PROP_STRING("tx", _state, net_conf.tx)
+
+void virtio_net_set_conf(DeviceState *dev, virtio_net_conf *net_conf,
+                         NICConf *nic_conf);
+
 #endif
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 6043ee4..8ed6a08 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -819,7 +819,7 @@ static int virtio_net_init_pci(PCIDevice *pci_dev)
     VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
     VirtIODevice *vdev;
 
-    vdev = virtio_net_init(&pci_dev->qdev, &proxy->nic, &proxy->net);
+    vdev = virtio_net_init(&pci_dev->qdev, &proxy->nic_conf, &proxy->net_conf);
 
     vdev->nvectors = proxy->nvectors;
     virtio_init_pci(proxy, vdev);
@@ -904,10 +904,7 @@ static Property virtio_net_properties[] = {
     DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false),
     DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
     DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features),
-    DEFINE_NIC_PROPERTIES(VirtIOPCIProxy, nic),
-    DEFINE_PROP_UINT32("x-txtimer", VirtIOPCIProxy, net.txtimer, TX_TIMER_INTERVAL),
-    DEFINE_PROP_INT32("x-txburst", VirtIOPCIProxy, net.txburst, TX_BURST),
-    DEFINE_PROP_STRING("tx", VirtIOPCIProxy, net.tx),
+    DEFINE_VIRTIO_NET_PROPERTIES(VirtIOPCIProxy),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -1113,6 +1110,11 @@ static void virtio_pci_device_plugged(DeviceState *d)
                                  PCI_DEVICE_ID_VIRTIO_BLOCK);
         pci_config_set_class(proxy->pci_dev.config, PCI_CLASS_STORAGE_SCSI);
         break;
+    case VIRTIO_ID_NET:
+        pci_config_set_device_id(proxy->pci_dev.config,
+                                 PCI_DEVICE_ID_VIRTIO_NET);
+        pci_config_set_class(proxy->pci_dev.config, PCI_CLASS_NETWORK_ETHERNET);
+        break;
     default:
         error_report("unknown device id\n");
         break;
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index 9f22f79..e6647e2 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -69,13 +69,13 @@ struct VirtIOPCIProxy {
     uint32_t flags;
     uint32_t class_code;
     uint32_t nvectors;
-    NICConf nic;
+    NICConf nic_conf;
     uint32_t host_features;
 #ifdef CONFIG_LINUX
     V9fsConf fsconf;
 #endif
     virtio_serial_conf serial;
-    virtio_net_conf net;
+    virtio_net_conf net_conf;
     VirtIOSCSIConf scsi;
     VirtIORNGConf rng;
     bool ioeventfd_disabled;
